From a4a9b70a3945b49cb1bf98e27f1b819045b7d6c4 Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Sat, 18 Oct 2025 13:16:19 +0000 Subject: [PATCH] [shared] Home-manager unstable and fix nixpkgs unstable on system --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 22 ++++++++++++++-------- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 917cb72..7ea81f4 100644 --- a/flake.lock +++ b/flake.lock @@ -119,6 +119,26 @@ "type": "github" } }, + "home-manager-unstable": { + "inputs": { + "nixpkgs": [ + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1760662441, + "narHash": "sha256-mlDqR1Ntgs9uYYEAUR1IhamKBO0lxoNS4zGLzEZaY0A=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "722792af097dff5790f1a66d271a47759f477755", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "home-manager_2": { "inputs": { "nixpkgs": [ @@ -256,6 +276,7 @@ "inputs": { "catppuccin": "catppuccin", "home-manager": "home-manager", + "home-manager-unstable": "home-manager-unstable", "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable", diff --git a/flake.nix b/flake.nix index 1bbe47b..948677b 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + home-manager-unstable = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + # # ========= Utilities ========= # @@ -45,6 +50,7 @@ nixpkgs, nixpkgs-unstable, home-manager, + home-manager-unstable, ... }@inputs: let @@ -60,13 +66,6 @@ "aarch64-linux" ]; - # ========== Extend lib with lib.custom ========== - # NOTE: This approach allows lib.custom to propagate into hm - # see: https://github.com/nix-community/home-manager/pull/3454 - customLib = (_self: _super: { custom = import ./lib { inherit (nixpkgs) lib; }; }); - lib = nixpkgs.lib.extend customLib; - libHm = home-manager.lib.extend customLib; - systems = import ./systems.nix { inherit common; }; @@ -92,6 +91,13 @@ let pkgs = if nixos.channel == "stable" then nixpkgs else nixpkgs-unstable; + hm = if nixos.channel == "stable" then home-manager else home-manager-unstable; + # ========== Extend lib with lib.custom ========== + # NOTE: This approach allows lib.custom to propagate into hm + # see: https://github.com/nix-community/home-manager/pull/3454 + customLib = (_self: _super: { custom = import ./lib { inherit (pkgs) lib; }; }); + lib = pkgs.lib.extend customLib; + libHm = hm.lib.extend customLib; in pkgs.lib.nixosSystem { inherit system; @@ -110,7 +116,7 @@ }; modules = [ ./hosts/${hostName} - home-manager.nixosModules.home-manager + hm.nixosModules.home-manager { home-manager = { # Backups conflicting files in case of error