From 7585be3dac300e04fc640eea61f7ca6a6aba02dd Mon Sep 17 00:00:00 2001 From: Jonas Rabenstein Date: Sat, 22 Nov 2025 05:00:57 +0100 Subject: [PATCH 1/3] bump version --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index b70a3c3..4782076 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "hardware": { "locked": { - "lastModified": 1753122741, - "narHash": "sha256-nFxE8lk9JvGelxClCmwuJYftbHqwnc01dRN4DVLUroM=", + "lastModified": 1762847253, + "narHash": "sha256-BWWnUUT01lPwCWUvS0p6Px5UOBFeXJ8jR+ZdLX8IbrU=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "cc66fddc6cb04ab479a1bb062f4d4da27c936a22", + "rev": "899dc449bc6428b9ee6b3b8f771ca2b0ef945ab9", "type": "github" }, "original": { From e2bfb0949a05f39b06ec1d99fefaec80c4fcbcbc Mon Sep 17 00:00:00 2001 From: Jonas Rabenstein Date: Wed, 26 Nov 2025 02:50:41 +0100 Subject: [PATCH 2/3] make home-manager optional As the home-manager depends on the actual used nixpkgs version and is not always used, remove it from the base dependencies but use still use it implictely if a home-manager input exists. --- export/nixosConfigurations.nix | 10 +++++++--- flake.lock | 22 ---------------------- flake.nix | 4 ---- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/export/nixosConfigurations.nix b/export/nixosConfigurations.nix index e712097..f8e8118 100644 --- a/export/nixosConfigurations.nix +++ b/export/nixosConfigurations.nix @@ -5,9 +5,13 @@ modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${name}"; })) flake.lib.schema.base) ++ [ { config.networking.hostName = name; } ] ++ [ nixosModules.default ] - ++ [ inputs.home-manager.nixosModules.default ] - ++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ] - ++ [ { config.home-manager.extraSpecialArgs = { inherit flake namespace; }; } ] + ++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) { + imports = [ inputs.home-manager.nixosModules.default ]; + config.home-manager = { + sharedModules = [ hmModules.default ]; + extraSpecialArgs = { inherit flake namespace; }; + }; + } ++ builtins.attrValues nixosUsers ++ builtins.attrValues nixosGroups ; diff --git a/flake.lock b/flake.lock index b70a3c3..f77aaf6 100644 --- a/flake.lock +++ b/flake.lock @@ -15,27 +15,6 @@ "type": "github" } }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1747688870, - "narHash": "sha256-ypL9WAZfmJr5V70jEVzqGjjQzF0uCkz+AFQF7n9NmNc=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "d5f1f641b289553927b3801580598d200a501863", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-24.11", - "repo": "home-manager", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1751274312, @@ -55,7 +34,6 @@ "root": { "inputs": { "hardware": "hardware", - "home-manager": "home-manager", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 5f5c238..3006b89 100644 --- a/flake.nix +++ b/flake.nix @@ -2,10 +2,6 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; hardware.url = "github:nixos/nixos-hardware"; - home-manager = { - url = "github:nix-community/home-manager/release-24.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = { self, ... }@inputs: import ./lib/flake.nix inputs ./.; From a5dc014e6562146988ecf38cfbbf149f61f1780c Mon Sep 17 00:00:00 2001 From: Jonas Rabenstein Date: Wed, 26 Nov 2025 02:50:41 +0100 Subject: [PATCH 3/3] make home-manager optional As the home-manager depends on the actual used nixpkgs version and is not always used, remove it from the base dependencies but use still use it implictely if a home-manager input exists. --- export/nixosConfigurations.nix | 10 +++++++--- flake.lock | 22 ---------------------- flake.nix | 4 ---- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/export/nixosConfigurations.nix b/export/nixosConfigurations.nix index e712097..f8e8118 100644 --- a/export/nixosConfigurations.nix +++ b/export/nixosConfigurations.nix @@ -5,9 +5,13 @@ modules = builtins.concatLists (map (base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${name}"; })) flake.lib.schema.base) ++ [ { config.networking.hostName = name; } ] ++ [ nixosModules.default ] - ++ [ inputs.home-manager.nixosModules.default ] - ++ [ { config.home-manager.sharedModules = [ hmModules.default ]; } ] - ++ [ { config.home-manager.extraSpecialArgs = { inherit flake namespace; }; } ] + ++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) { + imports = [ inputs.home-manager.nixosModules.default ]; + config.home-manager = { + sharedModules = [ hmModules.default ]; + extraSpecialArgs = { inherit flake namespace; }; + }; + } ++ builtins.attrValues nixosUsers ++ builtins.attrValues nixosGroups ; diff --git a/flake.lock b/flake.lock index 4782076..40bcf9f 100644 --- a/flake.lock +++ b/flake.lock @@ -15,27 +15,6 @@ "type": "github" } }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1747688870, - "narHash": "sha256-ypL9WAZfmJr5V70jEVzqGjjQzF0uCkz+AFQF7n9NmNc=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "d5f1f641b289553927b3801580598d200a501863", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-24.11", - "repo": "home-manager", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1751274312, @@ -55,7 +34,6 @@ "root": { "inputs": { "hardware": "hardware", - "home-manager": "home-manager", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 5f5c238..3006b89 100644 --- a/flake.nix +++ b/flake.nix @@ -2,10 +2,6 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; hardware.url = "github:nixos/nixos-hardware"; - home-manager = { - url = "github:nix-community/home-manager/release-24.11"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = { self, ... }@inputs: import ./lib/flake.nix inputs ./.;