Skip to content

Commit

Permalink
Merge #120
Browse files Browse the repository at this point in the history
120: Ensure home-manager portable user configurations are called with expected module args r=Pacman99 a=tomeon

Type-check `home-manager` portable user configurations 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.).

Also update `./examples/hmOnly` so that the `testuser` configuration references the `pkgs` module arg, thus testing that the switch to `moduleType` works as intended.

Closes #119

Co-authored-by: Matt Schreiber <schreibah@gmail.com>
  • Loading branch information
bors[bot] and tomeon authored Jan 7, 2022
2 parents feeddc0 + 49fcbf4 commit fca1df3
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 = "test@example.com";
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 fca1df3

Please sign in to comment.