Giter Club home page Giter Club logo

dotfiles's Introduction

dotfiles

My NixOS-managed dotfiles repository.

Installation

NixOS configurations

Reinstalling an existing configuration

These can be installed using nixos-anywhere, however the installation steps are subtly different from the upstream ones:

Warning yui has not yet been set up for this process

  1. Get the gpg secret directory from a backup. If no backup is available, set up a new gpg directory as in the new machine instructions.
  2. Boot the NixOS install disk on the machine in question, set up networking and a user password.
  3. ssh into the machine, copy the ssh public key into /root/.ssh/authorized_keys
  4. Place the desired disk encryption password in a file (secret.key), ensuring it does not end in a newline (echo -e).
  5. Run nix run --inputs-from . nixos-anywhere -- -f .#<hostname> root@<ip> --no-reboot --disk-encryption-keys /tmp/secret.key secret.key
    • If some permission error around secret.key pops up, rerun the command without the --disk-encryption-keys. They will already have been copied over, some kind of upstream bug.
  6. Before rebooting:
    1. Copy the gpg dir acquired in step 1 to /mnt/var/lib/sops
    2. Place a copy of /etc/sops/secrets.yaml in /mnt/etc/sops/secrets.yaml.
    3. Set a password for tlater with nixos-enter and passwd

Setting up a new machine

Before the configuration can be installed, we need to set up a few basic things.

It's easiest to do this when the system in question is already running, and we're ssh'd into it, so we can read out some device data. So boot into the NixOS installer first (will be useful later anyway).

Create a new subdirectory of nixos-config named after the new host, and create a new nixosConfigurations entry for it.

Then set up:

  1. Basic networking. Typically a bond config, see ren/yui for examples.
  2. Make sure to include one of the network modules so that wireless networking is set up on first boot.
  3. Generate and include a new hardware-configuration.nix:
    nixos-generate-config --no-filesystems --show-hardware-config
  4. Set up a new sops target.
    1. Firstly, create a new gpg dir according to these instructions.
    2. Then, add the generated fingerprint to .sops.yaml, and re-encrypt /etc/sops/secrets.yaml.
GPG/sops setup

Non-NixOS

For non-NixOS hosts, this requires nix >=2.4 with flakes enabled. To install this on an arbitrary Linux distro, follow the upstream nix installation instructions and then run:

nix-env -iA nixpkgs.nixFlakes
mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf

After that, enter a devshell for this flake and install it with home-manager:

nix develop github:tlater/dotfiles
home-manager switch --flake github:tlater/dotfiles#gnome-vm

dotfiles's People

Contributors

tlater avatar tlater-famedly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dotfiles's Issues

Clean up remaining dotfiles that don't comply with XDG_BASE_DIRS

Likely feasible

  • ~/.python_history
    • Need to write a python shell setup script as documented here
  • ~/.esd_auth
    • Need to disable the module-esound-protcol-unix.so pulseaudio module
    • This is set system-wide in /etc/pulse/default.pa, and I'm not
      sure how to override module loads
  • ~/.mailcap
    • Only used by mutt currently, need to see if its location can
      realistically be changed
  • ~/.mbsyncrc
    • Set by home-manager, should be easy to change
  • ~/.stumpish_history
    • Need to see if this can be changed
  • ~/.Xresources ~/.xprofile ~/.xsession
    • All created and used by home-manager, though they are default
      paths, it should be possible to change
  • ~/.lyrics
    • Probably ncmpcpp? Should be easy to fix.
  • ~/.bash_history
    • Not sure what calls bash, but this should be easy
  • ~/.ipython

Less feasible

  • ~/.zcompdump
    • Fixed in #48
    • Not actually fixed
    • Fixed again in #76
  • ~/.mozilla
  • ~/.pki
    • Also caused by Firefox. Seriously, I need a different browser. Maybe I will switch to chrome after all. Or maybe patch Firefox.
  • ~/.stumpwm.d
    • Seems hard to change since it's defined both in a function which would need to be overridden, but isn't on time,
      and in a variable
    • Go upstream with this one!
  • ~/.java
    • I set _JAVA_OPTIONS, not sure why this is created anyway. Seems it's a bug
  • ~/.profile
    • Fairly standard generic "env variable" definition point, unlikely to be able to change this one
  • ~/.nix*
    • Said to be obsolete as of 5 years ago, but flakes never happened, did they?
    • See also the upstream issue

StumpWM will fail to load modules after updates

Whenever StumpWM is launched after an update, it will fail to find any modules loaded with load-module. This causes it to fail loading.

The workaround is to manually load swm-gaps after launch using the StumpWM eval: (load-module "swm-gaps").

After this, for some reason modules will load fine... I suspect there is some caching going on on the lisp end, but the workaround seems to only work when the load is invoked interactively.

Emacs: Fix socket cleanup

Emacs unconditionally cleans up its socket when it shuts down, but systemd expects the socket to be kept alive.

Hence, we need to teach emacs not to do that.

Seems there's a variable server--external-socket-initialized that will detect if systemd passed the socket to us.

There's also server-sentinel in server.el:396, which cleans up the socket file. Presumably all that needs to be done is to make it check whether an external process created the socket, and if it did, not clean it.

Screencast is broken on yui

Since #299 I'm using sway, which uses a different xdg-desktop-portal implementation than Hyprland.

Apparently, nvidia produces images in an unsupported color format, which causes xdg-desktop-portal-wlr to crash.

This is fixed in emersion/xdg-desktop-portal-wlr#191, however xdg-desktop-portal-wlr has not had a release since.

Even if I use xdpwlr directly from git, it might not actually work, and I'd need a patch for wlroots. It might work for the things I care about, though, considering the Hyprland portal worked fine, so I should try that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.