Skip to content

Commit

Permalink
fix: pass asserted config incl options to check isDefined
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Feb 26, 2023
1 parent 1189ab7 commit b3d6aa0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pasteurize.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
imports = [config];
inherit _file;
};
checked = (evalModulesMinimal {modules = [combCheckModule beeOptions locatedConfig];}).config;
checked = evalModulesMinimal {modules = [combCheckModule beeOptions locatedConfig];};
asserted = let
failedAsserts = map (x: x.message) (l.filter (x: !x.assertion) checked._hive_erased);
failedAsserts = map (x: x.message) (l.filter (x: !x.assertion) checked.config._hive_erased);
in
if failedAsserts != []
then throw "\nFailed assertions:\n${l.concatStringsSep "\n" (map (x: "- ${x}") failedAsserts)}"
Expand Down Expand Up @@ -137,14 +137,14 @@
'''
'';
nixpkgs = {
inherit (asserted.bee) system pkgs;
inherit (asserted.bee.pkgs) config; # nixos modules don't load this
inherit (asserted.config.bee) system pkgs;
inherit (asserted.config.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
++ l.optionals asserted.options.bee.home.isDefined [
asserted.config.bee.home.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
Expand Down Expand Up @@ -182,7 +182,7 @@
# does a re-import (and we don't tolerate that interface)
# so we re-use bee to communicate with the shake function
# below
asserted: {bee = {inherit (asserted.bee) system pkgs home;};}
asserted: {bee = {inherit (asserted.config.bee) system pkgs home;};}
)))
(l.filterAttrs (_: config: config.bee.system == system))
(l.mapAttrs (homecfg: l.nameValuePair "${user}-o-${homecfg}"))
Expand Down

0 comments on commit b3d6aa0

Please sign in to comment.