Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions modules/aspects/provides/home-manager/hm-dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ let
includes = [
(owned den.default)
(statics den.default)
(owned HM-OS-USER.HM)
(statics HM-OS-USER.HM)
(parametric.fixedTo HM-OS-USER HM-OS-USER.OS)
(parametric.fixedTo HM-OS-USER HM-OS-USER.HM)
];
};

Expand Down
18 changes: 12 additions & 6 deletions templates/ci/modules/host-user-conditional-hm.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
{ lib, ... }:
let
# Example: configuration that depends on both host and user. provides only to HM.
host-to-user-conditional =
program-conditional =
program:
{
user,
host,
...
}:
if user.userName == "alice" && !lib.hasSuffix "darwin" host.system then
{
homeManager.programs.git.enable = true;
homeManager.programs.${program}.enable = true;
}
else
{ };
in
{

den.aspects.rockhopper.includes = [
# Example: host provides parametric user configuration.
host-to-user-conditional
];
# Example: host parametric includes. conditional user configuration.
den.aspects.rockhopper.includes = [ (program-conditional "git") ];

# Example: user parametric includes
den.aspects.alice.includes = [ (program-conditional "mpv") ];

perSystem =
{
Expand All @@ -37,6 +39,10 @@ in
!alice-at-honeycrisp.programs.git.enable
);

checks.alice-hm-mpv-enabled-rockhopper = checkCond "home-managed mpv for alice at rockhopper" (
alice-at-rockhopper.programs.mpv.enable
);

};

}