Skip to content

Commit

Permalink
fix: module args of home-manager portable configs
Browse files Browse the repository at this point in the history
Type-check such configs as modules ("moduleType") rather than as
functions evaluating to attribute sets ("functionTo attrs").  This
ensures that they get invoked with all expected module arguments
("pkgs", "lib", etc.).

Update ./examples/hmOnly so that the testuser config references the pkgs
module arg, thus testing that the switch to moduleType works as
intended.

Closes #119
  • Loading branch information
tomeon committed Jan 6, 2022
1 parent feeddc0 commit 49fcbf4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/hmOnly/home/users/testuser.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{ suites, ... }:
{ pkgs, suites, ... }:
let
name = "Test User";
email = "[email protected]";
in
{
imports = suites.shell;

home.packages = [ pkgs.hello ];

programs.browserpass.enable = true;
programs.starship.enable = true;
programs.git = {
Expand Down
2 changes: 1 addition & 1 deletion src/mkFlake/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let
description = "nix flake";
};

userType = with types; pathToOr (functionTo attrs) // {
userType = with types; pathToOr moduleType // {
description = "HM user config";
};

Expand Down

0 comments on commit 49fcbf4

Please sign in to comment.