Skip to content

Commit

Permalink
Home manager version stable/unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
grmrgecko committed May 16, 2024
1 parent d781b5f commit 023dc8a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 11 deletions.
40 changes: 31 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
};

home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};

home-manager-unstable = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
Expand All @@ -36,6 +41,13 @@
inputs.nixpkgs-unstable
);

# Based on loaded settings, set the home-manager version.
home-manager = (if (settings.packages == "stable")
then
inputs.home-manager
else
inputs.home-manager-unstable
);
# Setup an overlay for unstable packages to include on stable environments.
overlay-unstable = final: prev: {
unstable = import inputs.nixpkgs-unstable {
Expand Down Expand Up @@ -65,12 +77,12 @@
modules = [
config
inputs.disko.nixosModules.disko
inputs.home-manager.nixosModules.default
home-manager.nixosModules.default
];
};

# Function to configure home-manager for a user.
mkHome = config: inputs.home-manager.lib.homeManagerConfiguration {
mkHome = config: home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs;
Expand Down

0 comments on commit 023dc8a

Please sign in to comment.