diff --git a/nix/modules/hosts.nix b/nix/configurations.nix similarity index 100% rename from nix/modules/hosts.nix rename to nix/configurations.nix diff --git a/nix/lib/default.nix b/nix/lib/default.nix index b75aefc..710a658 100644 --- a/nix/lib/default.nix +++ b/nix/lib/default.nix @@ -1,11 +1,9 @@ -{ lib, config, ... }: +{ lib, ... }: let - cfg = config.flake; - inherit (lib.attrsets) mapAttrs concatMapAttrs; + inherit (lib.attrsets) concatMapAttrs; in { flake.lib = { flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset; - forAllUsers = f: mapAttrs f cfg.manifest.users; }; } diff --git a/nix/manifest.nix b/nix/manifest.nix index f3cd69c..5c46f9f 100644 --- a/nix/manifest.nix +++ b/nix/manifest.nix @@ -8,6 +8,7 @@ let }; nixpkgs.hostPlatform = "x86_64-linux"; boot.loader.systemd-boot.enable = true; + system.stateVersion = "25.05"; networking = { inherit hostName; }; }; in diff --git a/nix/modules/home-manager.nix b/nix/modules/home-manager.nix index 2d6bf83..e81050f 100644 --- a/nix/modules/home-manager.nix +++ b/nix/modules/home-manager.nix @@ -1,18 +1,13 @@ -{ inputs, config, ... }: +{ inputs, ... }: let - inherit (cfg.lib) flattenAttrs; - cfg = config.flake; hm = inputs.home-manager; globalCfg = { - useGlobalPkgs = true; - useUserPackages = true; - sharedModules = [ - (flattenAttrs (cfg.modules.homeManager or { })) - ]; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; }; in { imports = [ hm.flakeModules.home-manager ]; flake.modules.nixos.default.imports = [ hm.nixosModules.home-manager ]; - flake.modules.nixos.default.config.home-manager = globalCfg; + flake.modules.nixos.default.config = globalCfg; } diff --git a/nix/modules/system.nix b/nix/modules/system.nix deleted file mode 100644 index c2af5c0..0000000 --- a/nix/modules/system.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - flake.modules.nixos.default = { - system.stateVersion = "25.11"; - }; - flake.modules.homeManager.default = - { osConfig, ... }: - { - home.stateVersion = osConfig.system.stateVersion; - }; -} diff --git a/nix/modules/users.nix b/nix/modules/users.nix index 6a423fd..cfdeba5 100644 --- a/nix/modules/users.nix +++ b/nix/modules/users.nix @@ -1,13 +1,12 @@ { config, lib, ... }: let - cfg = config.flake; - inherit (config.flake.lib) forAllUsers flattenAttrs; + inherit (config.flake.lib) flattenAttrs; inherit (lib.attrsets) filterAttrs; - owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) cfg.manifest.users); + owner = flattenAttrs (filterAttrs (_: v: (v.primary or false)) config.flake.manifest.users); in { flake.modules.nixos.default = - { pkgs, config, ... }: + { pkgs, ... }: { #TODO: move sudo/security options elsewhere security.sudo.wheelNeedsPassword = false; @@ -27,12 +26,5 @@ in openssh.authorizedKeys.keys = [ owner.pubkey ]; }; }; - home-manager.users = forAllUsers ( - name: _: { - #TODO: move into nixos/darwin config - should not apply to homeConfigurations - home.username = name; - home.homeDirectory = config.users.users.${name}.home; - } - ); }; }