From acc36dc851dafc8963b3a7a49e673def0e1cc5ba Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 17 Aug 2022 18:43:48 +0800 Subject: [PATCH] flake.nix: refactor `extraArgs` placement --- flake.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 647c3766..8b7923a4 100644 --- a/flake.nix +++ b/flake.nix @@ -108,12 +108,14 @@ import ./lib { lib = prev; } // import ./lib/private.nix { lib = final; }); + withExtraArgs = system: { inherit inputs self system; }; + mkHost = { system ? defaultSystem, extraModules ? [ ] }: (lib'.makeOverridable inputs.nixpkgs.lib.nixosSystem) { # The system of the NixOS system. inherit system; lib = lib'; - specialArgs = { inherit system inputs self; }; + specialArgs = withExtraArgs system; modules = # Append with our custom NixOS modules from the modules folder. (lib'.modulesToList (lib'.filesToAttr ./modules/nixos)) @@ -210,7 +212,7 @@ home-manager.sharedModules = lib'.modulesToList (lib'.filesToAttr ./modules/home-manager) ++ [ userDefaultConfig ]; - home-manager.extraSpecialArgs = { inherit inputs system self; }; + home-manager.extraSpecialArgs = withExtraArgs system; # Enabling some things for sops. programs.gnupg.agent = { @@ -223,7 +225,7 @@ mkUser = { system ? defaultSystem, extraModules ? [ ] }: inputs.home-manager.lib.homeManagerConfiguration { - extraSpecialArgs = { inherit system self inputs; }; + extraSpecialArgs = withExtraArgs system; lib = lib'; pkgs = nixpkgs.legacyPackages.${builtins.currentSystem}; modules =