diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-06-12 12:46:14 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-06-12 12:46:14 -0700 |
| commit | 6fff95981bfef5527518fbebac879c71877810ff (patch) | |
| tree | ee12cecc6843ad931806109417e6aed865602ff3 /nix/lib | |
| parent | use a dedicated SSH key for agenix (diff) | |
| download | infra-6fff95981bfef5527518fbebac879c71877810ff.tar.gz | |
pass `self` to the home-manager modules
This is to avoid using relative paths, which is always annoying to get
right.
Diffstat (limited to '')
| -rw-r--r-- | nix/lib/mkSystem.nix | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/nix/lib/mkSystem.nix b/nix/lib/mkSystem.nix index 7c438b6..3241dd9 100644 --- a/nix/lib/mkSystem.nix +++ b/nix/lib/mkSystem.nix @@ -1,12 +1,13 @@ # This function creates a NixOS system based on our VM setup for a # particular architecture. { + self, nixpkgs, inputs, overlays, }: -name: +systemName: { system, user, @@ -15,11 +16,11 @@ name: let # The config files for this system. - machineConfig = ../machines/${name}; + machineConfig = ../machines/${systemName}; userOSConfig = ../users/${user}/${if darwin then "darwin" else "nixos"}.nix; userHMConfig = ../users/${user}/home-manager.nix; - # NixOS vs nix-darwin functionst + # NixOS vs nix-darwin functions systemFunc = if darwin then inputs.darwin.lib.darwinSystem else nixpkgs.lib.nixosSystem; home-manager = if darwin then inputs.home-manager.darwinModules else inputs.home-manager.nixosModules; @@ -44,9 +45,15 @@ systemFunc rec { inputs.agenix.homeManagerModules.default ]; home-manager.users.${user} = import userHMConfig { - inputs = inputs; - darwin = darwin; - systemName = name; + inherit + self + inputs + darwin + systemName + ; + }; + home-manager.extraSpecialArgs = { + inherit self inputs; }; } @@ -55,7 +62,7 @@ systemFunc rec { { config._module.args = { currentSystem = system; - currentSystemName = name; + currentSystemName = systemName; currentSystemUser = user; inputs = inputs; }; |
