Skip to content

Commit

Permalink
Update home-manager to 22.11
Browse files Browse the repository at this point in the history
This commit updates the home-manager flake input to the 22.11 release
and creates additional support for the new homeManagerConfiguration
setup that is introduced there: Some arguments that were previously
in use, now need to be used inside the new modules argument (check
[here][hm-22.11-highlights] for more details).

Finally, the examples of using home-manager now declare explicitly the
stateVersion, since the 22.11 release makes this mandatory.

[hm-22.11-highlights]: https://nix-community.github.io/home-manager/release-notes.html#sec-release-22.11-highlights
  • Loading branch information
jokogr authored and blaggacao committed Jan 6, 2023
1 parent 504459e commit bca4b89
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 38 deletions.
26 changes: 21 additions & 5 deletions examples/devos/flake.lock

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

14 changes: 11 additions & 3 deletions examples/devos/flake.nix
Expand Up @@ -36,7 +36,7 @@
digga.inputs.home-manager.follows = "home";
digga.inputs.deploy.follows = "deploy";

home.url = "github:nix-community/home-manager/release-22.05";
home.url = "github:nix-community/home-manager/release-22.11";
home.inputs.nixpkgs.follows = "nixos";

darwin.url = "github:LnL7/nix-darwin";
Expand Down Expand Up @@ -196,8 +196,16 @@
# it could just be left to the developer to determine what's
# appropriate. after all, configuring these hm users is one of the
# first steps in customizing the template.
nixos = {suites, ...}: {imports = suites.base;};
darwin = {suites, ...}: {imports = suites.base;};
nixos = {suites, ...}: {
imports = suites.base;

home.stateVersion = "22.11";
};
darwin = {suites, ...}: {
imports = suites.base;

home.stateVersion = "22.11";
};
}; # digga.lib.importers.rakeLeaves ./users/hm;
};

Expand Down
26 changes: 21 additions & 5 deletions examples/groupByConfig/flake.lock

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

2 changes: 1 addition & 1 deletion examples/groupByConfig/flake.nix
Expand Up @@ -19,7 +19,7 @@
darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs-darwin-stable";

home.url = "github:nix-community/home-manager/release-22.05";
home.url = "github:nix-community/home-manager/release-22.11";
home.inputs.nixpkgs.follows = "nixos";
};

Expand Down
26 changes: 21 additions & 5 deletions examples/hmOnly/flake.lock

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

2 changes: 1 addition & 1 deletion examples/hmOnly/flake.nix
Expand Up @@ -6,7 +6,7 @@
digga.url = "github:divnix/digga";
digga.inputs.nixpkgs.follows = "nixos";
digga.inputs.home-manager.follows = "home";
home.url = "github:nix-community/home-manager/release-22.05";
home.url = "github:nix-community/home-manager/release-22.11";
home.inputs.nixpkgs.follows = "nixos";
};

Expand Down
5 changes: 4 additions & 1 deletion examples/hmOnly/home/users/testuser.nix
Expand Up @@ -8,7 +8,10 @@
in {
imports = suites.shell;

home.packages = [pkgs.hello];
home = {
packages = [pkgs.hello];
stateVersion = "22.11";
};

programs.browserpass.enable = true;
programs.starship.enable = true;
Expand Down
11 changes: 7 additions & 4 deletions flake.lock

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

3 changes: 2 additions & 1 deletion flake.nix
Expand Up @@ -15,8 +15,9 @@
deploy.url = "github:serokell/deploy-rs";
deploy.inputs.nixpkgs.follows = "nixpkgs";

home-manager.url = "github:nix-community/home-manager/release-22.05";
home-manager.url = "github:nix-community/home-manager/release-22.11";
home-manager.inputs.nixpkgs.follows = "nixlib";
home-manager.inputs.utils.follows = "flake-utils";

darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
Expand Down
31 changes: 19 additions & 12 deletions src/mkFlake/outputs-builder.nix
Expand Up @@ -27,20 +27,27 @@
homeDirectory = "${homeDirectoryPrefix}/${username}";
in
home-manager.lib.homeManagerConfiguration {
inherit username homeDirectory pkgs system;
inherit pkgs;

extraModules = config.home.modules ++ config.home.exportedModules;
extraSpecialArgs = config.home.importables // {inherit self inputs;};
modules =
config.home.modules
++ config.home.exportedModules
++ [
({
imports = [configuration];

home = {
inherit username homeDirectory;
};
}
// (
if (pkgs.stdenv.hostPlatform.isLinux && !pkgs.stdenv.buildPlatform.isDarwin)
then {targets.genericLinux.enable = true;}
else {}
))
];

configuration =
{
imports = [configuration];
}
// (
if (pkgs.stdenv.hostPlatform.isLinux && !pkgs.stdenv.buildPlatform.isDarwin)
then {targets.genericLinux.enable = true;}
else {}
);
extraSpecialArgs = config.home.importables // {inherit self inputs;};
};

homeConfigurationsPortable =
Expand Down

0 comments on commit bca4b89

Please sign in to comment.