Skip to content

Commit

Permalink
feat: add hm integration to nixos
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Jan 29, 2023
1 parent d185c33 commit 1189ab7
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion pasteurize.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,24 @@
if failedAsserts != []
then throw "\nFailed assertions:\n${l.concatStringsSep "\n" (map (x: "- ${x}") failedAsserts)}"
else checked;

recursiveMerge = with l;
attrList: let
f = attrPath:
zipAttrsWith (
n: values:
if tail values == []
then head values
else if all isList values
then unique (concatLists values)
else if all isAttrs values
then f [n] values
else last values
);
in
f [] attrList;
in
locatedConfig // (out asserted);
recursiveMerge [locatedConfig (out asserted)];

/*
Expand Down Expand Up @@ -124,6 +140,16 @@
inherit (asserted.bee) system pkgs;
inherit (asserted.bee.pkgs) config; # nixos modules don't load this
};
# seemlessly integrate hm if desired
imports =
[]
++ l.optionals (asserted.bee ? home) [
asserted.bee.home.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
];
}
)))
(l.filterAttrs (_: config: config.nixpkgs.system == system))
Expand Down

0 comments on commit 1189ab7

Please sign in to comment.