dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

f0ab20c

Add a dev shell with nixos-anywhere; install as vizie with sudo

By Gustaf Granström

nixos-anywhere escalates with sudo by itself when it logs in as a regular
user, so CachyOS needs no root SSH key. The dev shell is for x86_64-linux and
the MacBook (aarch64-darwin).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

3 files changed +28 −11

modifiedMIGRATION.md
@@ -27,30 +27,26 @@
2727 sudo ~/git/dot/tools/backup-to-sata
2828 ```
2929
30-- [ ] Let the Mac log in as root, which nixos-anywhere needs. Paste the Mac's
31- public key (`cat ~/.ssh/id_ed25519.pub` on the Mac) into:
32-
33- ```bash
34- sudo install -d -m700 /root/.ssh && sudo nano /root/.ssh/authorized_keys
35- ```
36-
3730 ## 2. On the Mac
3831
3932 Needs Nix (with flakes) and the GitHub CLI signed in to your account: `dot`
4033 and `philly` are private, and `gh auth setup-git` lets Nix fetch them. The
4134 Mac's public key must also be in `macKeys` in `hosts/desktop/default.nix`
42-(committed and pushed), so it can still log in after the install.
35+(committed and pushed), so it can log in to the new system.
4336
4437 ```bash
4538 gh auth setup-git
4639 gh repo clone Eiziv/dot ~/dot
40+cd ~/dot && nix develop
4741 ```
4842
49-Check from the Mac that `ssh root@10.0.0.40` logs in. Then install. **This wipes
50-the desktop's NVMe drive** without asking again:
43+`nix develop` opens a shell with nixos-anywhere in it. Then install. It logs
44+in as you (with your password, or the Mac's key if CachyOS has it), asks for
45+your sudo password once, and from then on **wipes the desktop's NVMe drive**
46+without asking again:
5147
5248 ```bash
53-nix run github:nix-community/nixos-anywhere -- --flake ~/dot#desktop --build-on remote --copy-host-keys --no-use-machine-substituters root@10.0.0.40
49+nixos-anywhere --flake .#desktop --build-on remote --copy-host-keys --no-use-machine-substituters vizie@10.0.0.40
5450 ```
5551
5652 It takes a while: the CachyOS kernel's binary cache has been down, so the
modifiedREADME.md
@@ -98,6 +98,9 @@
9898 generic x86-64 builds outside the kernel and Proton. The difference in games is
9999 small.
100100
101+`nix develop` opens a shell with nixos-anywhere and nixfmt, on this machine or
102+the Mac.
103+
101104 ## Testing in a VM
102105
103106 ```bash
modifiedflake.nix
@@ -66,6 +66,24 @@
6666 modules = [ ./hosts/desktop ];
6767 };
6868
69+ # Tools for working on this repo, here and on the MacBook:
70+ # nix develop
71+ devShells = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-darwin" ] (
72+ shellSystem:
73+ let
74+ shellPkgs = nixpkgs.legacyPackages.${shellSystem};
75+ in
76+ {
77+ default = shellPkgs.mkShellNoCC {
78+ packages = [
79+ # Installs the desktop over SSH (MIGRATION.md).
80+ shellPkgs.nixos-anywhere
81+ shellPkgs.nixfmt
82+ ];
83+ };
84+ }
85+ );
86+
6987 formatter.${system} = pkgs.nixfmt;
7088 };
7189 }