diff --git a/README.md b/README.md index 8df7da4..38a69fe 100644 --- a/README.md +++ b/README.md @@ -17,19 +17,15 @@ nix run - X1 Carbon: https://www.srid.ca/x1c7-install - Windows (via WSL): https://github.com/nix-community/NixOS-WSL - Clone this repo at `/etc/nixos` - - Edit `flake.nix` and - - add your Linux's hostname in the `nixosConfigurations` set, as well as - - update `people.myself` to your own username. - - change `users.nix` to contain your user(s) information + - Edit `flake.nix` to use your system hostname in the `nixosConfigurations` set + - Edit `users/default.nix:config` to contain your users - Run `nix run`. That's it. Re-open your shell. - macOS: - Install Nix normally (multi-user) - Install [nix-darwin](https://github.com/LnL7/nix-darwin) - This will create a `~/.nixpkgs/darwin-configuration.nix`, but we do not need that. - Clone this repo anywhere - - Edit `flake.nix` and - - update `people.myself` to your own username. - - change `users.nix` to contain your user(s) information + - Edit `users/default.nix:config` to contain your users - Run `nix run`.[^cleanup] That's it. Re-open your shell. [^cleanup]: You might have to `rm -rf /etc/nix/nix.conf`, so our flake.nix can do its thing. @@ -40,6 +36,7 @@ nix run - `nixos`: nixos config for Linux - `nix-darwin`: nix-darwin config for macOS - `systems`: top-level configuration.nix('ish) for various kinds of system +- `users`: user information ## Tips diff --git a/flake.nix b/flake.nix index a443d57..77d592b 100644 --- a/flake.nix +++ b/flake.nix @@ -42,16 +42,12 @@ systems = [ "x86_64-linux" "aarch64-darwin" ]; imports = [ ./lib.nix - ./config.nix + ./users ./home ./nixos ./nix-darwin ]; - people = { - myself = "srid"; - users = import ./users.nix; - }; flake = { # Configurations for Linux (NixOS) systems diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 2a90579..ec350bc 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -1,12 +1,12 @@ let keys = - (import ../users.nix).srid.sshKeys + (import ../users/info.nix).srid.sshKeys ++ [ (import ../systems/hetzner/ax41.info.nix).hostKeyPub ]; in # How I rekey on macOS: -# agenix -r -i =(op read 'op://Personal/id_rsa/private key') + # agenix -r -i =(op read 'op://Personal/id_rsa/private key') { "cache-priv-key.age".publicKeys = keys; } diff --git a/config.nix b/users/default.nix similarity index 89% rename from config.nix rename to users/default.nix index 310bdc7..2615758 100644 --- a/config.nix +++ b/users/default.nix @@ -38,4 +38,10 @@ in type = peopleSubmodule; }; }; + config = { + people = { + myself = "srid"; + users = import ./info.nix; + }; + }; } diff --git a/users.nix b/users/info.nix similarity index 100% rename from users.nix rename to users/info.nix