Compare commits
13
Commits
677a50ed68
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4a3a0344d
|
||
|
|
18982a6247
|
||
|
|
2f7ae14883
|
||
|
|
1cfc810e69
|
||
|
|
0d6602004f
|
||
|
|
161f375258
|
||
|
|
92a37a127d
|
||
|
|
fef3a464ef
|
||
|
|
24d0ce1550
|
||
|
|
943e0f682c
|
||
|
|
daa7052958
|
||
|
|
e6b2edcc42
|
||
|
|
aaaf95429b
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
mkSymlinkActivationScript = {target, source}: ''
|
mkSymlinkActivationScript = {target, source}: ''
|
||||||
if [ -e ${source} ]; then
|
if [ -e ${source} ]; then
|
||||||
if [ -e ${target} ]; then
|
if [ -L ${target} ] || [ -e ${target} ]; then
|
||||||
rm -rf ${target}
|
rm -rf ${target}
|
||||||
fi
|
fi
|
||||||
ln -s ${source} ${target}
|
ln -s ${source} ${target}
|
||||||
@@ -51,11 +51,32 @@
|
|||||||
flake.homeModules.${moduleName} = func;
|
flake.homeModules.${moduleName} = func;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkStandardFeature = {
|
||||||
|
flakeModule = moduleName: optionName: optionString: (mkMirroredModulesFlakeModule "${moduleName}Options" ({ lib, ... }: {
|
||||||
|
options = setAttrByStrPath optionName (lib.mkEnableOption optionString);
|
||||||
|
}));
|
||||||
|
|
||||||
|
nixosModule = { config, optionName }: systemConfig: {
|
||||||
|
config = lib.mkIf (attrByStrPath optionName config) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||||
|
home-manager.users.${config.info.userName} = setAttrByStrPath optionName (lib.mkDefault true);
|
||||||
|
} systemConfig);
|
||||||
|
};
|
||||||
|
|
||||||
|
homeModule = { config, optionName }: homeConfig: {
|
||||||
|
config = lib.mkIf (attrByStrPath optionName config) homeConfig;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
mkRedundantOptionDescription = name: value: "The functionality of this option completely depends on `${name}` being `${value}`, and will not be evaluated otherwise.";
|
mkRedundantOptionDescription = name: value: "The functionality of this option completely depends on `${name}` being `${value}`, and will not be evaluated otherwise.";
|
||||||
|
|
||||||
mkRedundantOption = name: value: attrs: lib.mkOption {
|
mkRedundantOption = name: value: attrs: lib.mkOption {
|
||||||
inherit (attrs) type default;
|
inherit (attrs) type default;
|
||||||
description = "${attrs.description}\n\n<div class=admonition-warning><p class=admonition-title>::before\nRedundant</p><p>${mkRedundantOptionDescription name value}</p></div>";
|
description = ''
|
||||||
|
${attrs.description}
|
||||||
|
|
||||||
|
|
||||||
|
${mkRedundantOptionDescription name value}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user