all application options will adapt to environment
when used either with nixos (no home-manager) or home-manager standalone, `features.applications.<name>.enable` options still perform some functionality, rather than assuming a full nixos + home-manager setup like before
This commit is contained in:
17 files changed
+265
-151
No files matched your search
@@ -28,6 +28,27 @@
|
||||
lib.attrsets.attrByPath (lib.strings.splitString "." strPath) null set;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
homeManagerInheritEnableOptionElse = lib.mkOption {
|
||||
# type = lib.types.functionTo lib.types.attrs;
|
||||
default = optionName: systemAttrs: let
|
||||
mkIfElse = with lib; p: yes: no: mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
|
||||
attrByStrPath = strPath: set:
|
||||
lib.attrsets.attrByPath (lib.strings.splitString "." strPath) null set;
|
||||
|
||||
setAttrByStrPath = strPath: value:
|
||||
lib.attrsets.setAttrByPath (lib.strings.splitString "." strPath) value;
|
||||
in builtins.trace "hi" lib.mkIf (attrByStrPath optionName config) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.sharedModules = [
|
||||
({ lib, ... }: (setAttrByStrPath optionName (lib.mkDefault true)))
|
||||
];
|
||||
} (systemAttrs));
|
||||
readOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user