diff --git a/flake.nix b/flake.nix index da49c22a..69094d3d 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,7 @@ nixosConfigurations = { nixos = nixosSystem { system = "x86_64-linux"; - specialArgs = attrs; + specialArgs = attrs // { nix-config = self; }; modules = [ ./hardware/laptop.nix { diff --git a/modules/containers.nix b/modules/containers.nix index 19072539..bcbb3ef7 100644 --- a/modules/containers.nix +++ b/modules/containers.nix @@ -1,4 +1,4 @@ -{ config, stylix, home-manager, sakaya, ... }: +{ config, nix-config, sakaya, ... }: let inherit (config.modules.system) username; @@ -39,8 +39,7 @@ let ]; specialArgs = { - inherit home-manager; - inherit stylix; + inherit nix-config; }; }; in diff --git a/modules/desktop.nix b/modules/desktop.nix index 3ff76122..49c687c9 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -1,4 +1,4 @@ -{ home-manager, stylix, pkgs, config, lib, ... }: +{ nix-config, pkgs, config, lib, ... }: let inherit (lib) mkEnableOption mkIf mkMerge; @@ -14,8 +14,8 @@ let in { imports = attrValues { - inherit (home-manager.nixosModules) home-manager; - inherit (stylix.nixosModules) stylix; + inherit (nix-config.inputs.home-manager.nixosModules) home-manager; + inherit (nix-config.inputs.stylix.nixosModules) stylix; }; options.modules.desktop = { diff --git a/modules/system.nix b/modules/system.nix index 2ccf97a3..92f77d83 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -1,14 +1,19 @@ -{ pkgs, lib, config, ... }: +{ nix-config, pkgs, lib, config, ... }: let inherit (lib) mkOption; inherit (lib.types) str listOf; inherit (pkgs.nixVersions) nix_2_19; inherit (cfg) username; + inherit (builtins) attrValues; cfg = config.modules.system; in { + imports = attrValues { + inherit (nix-config.inputs.home-manager.nixosModules) home-manager; + }; + options.modules.system = { username = mkOption { type = str; diff --git a/tests/lib.nix b/tests/lib.nix index 93748faa..a4de5139 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -8,6 +8,7 @@ in defaults.documentation.enable = lib.mkDefault false; node.specialArgs = { inherit self; + nix-config = self; }; imports = [ test ]; }).config.result