Add the nixosModules special arg.

This commit is contained in:
r-vdp 2023-04-13 12:12:41 +02:00
parent 94119b4ae6
commit 40597a9540
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View file

@ -52,7 +52,7 @@
{ {
lib = import ./nix/lib.nix { lib = import ./nix/lib.nix {
inherit nixpkgs self; inherit nixpkgs self;
nixosModules = "${nixpkgs}/nixos"; nixos = "${nixpkgs}/nixos";
}; };
} }
// //

View file

@ -1,6 +1,6 @@
{ nixpkgs # The nixpkgs flake { nixpkgs # The nixpkgs flake
, self # The system-manager flake , self # The system-manager flake
, nixosModules # The path to the nixos modules dir from nixpkgs , nixos # The path to the nixos dir from nixpkgs
, ,
}: }:
let let
@ -20,13 +20,14 @@ in
extraArgsModule = { lib, config, pkgs, ... }: { extraArgsModule = { lib, config, pkgs, ... }: {
_module.args = { _module.args = {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
utils = import "${nixosModules}/lib/utils.nix" { utils = import "${nixos}/lib/utils.nix" {
inherit lib config pkgs; inherit lib config pkgs;
}; };
}; };
}; };
config = (lib.evalModules { config = (lib.evalModules {
specialArgs = { nixosModulesPath = "${nixos}/modules"; } // extraSpecialArgs;
modules = [ modules = [
extraArgsModule extraArgsModule
./modules ./modules