Compare commits

...
15 Commits
Author SHA1 Message Date
greyweather e4a3a0344d mkStandardFeature: fix method of overriding home-manager option 2026-09-06 22:22:57 +01:00
greyweather 18982a6247 mkSymlinkActivationScript: fix check to not miss broken symlinks 2026-09-06 01:05:02 +01:00
greyweather 2f7ae14883 mkStandardFeature: option must be mkEnableOption declaration 2026-09-05 14:25:52 +01:00
greyweather 1cfc810e69 mkStandardFeatureFlakeModule -> mkStandardFeature 2026-09-02 04:23:40 +01:00
greyweather 0d6602004f mkStandardFeatureFlake: fix accessing option value in config 2026-09-02 02:37:09 +01:00
greyweather 161f375258 mkStandardFeatureFlakeModule: try different way of declaring option 2026-09-02 02:23:17 +01:00
greyweather 92a37a127d mkStandardFeatureFlakeModule 2026-09-02 01:58:38 +01:00
greyweather fef3a464ef mkRedundantOption: give up on using admonitions 2026-09-02 00:02:36 +01:00
greyweather 24d0ce1550 mkRedundantOption: try double backslashes 2026-09-01 23:57:34 +01:00
greyweather 943e0f682c mkRedundantOption: test if this changes anything 2026-09-01 23:54:36 +01:00
greyweather daa7052958 mkRedundantOption: use multi-line string with html 2026-09-01 23:49:59 +01:00
greyweather e6b2edcc42 mkRedundantOption: try escaping html tags instead 2026-09-01 23:46:21 +01:00
greyweather aaaf95429b mkRedundantOption: try to remove random backslashes 2026-09-01 23:41:46 +01:00
greyweather 677a50ed68 mkRedundantOption: remove quotations from html class names 2026-09-01 23:33:59 +01:00
greyweather 500145237d Revert "emkRedundantOption: escape backslashes, leave escaping newlines until MD generation"
This reverts commit 6f0af993ba.
2026-09-01 23:32:34 +01:00
+23 -2
View File
@@ -15,7 +15,7 @@
mkSymlinkActivationScript = {target, source}: ''
if [ -e ${source} ]; then
if [ -e ${target} ]; then
if [ -L ${target} ] || [ -e ${target} ]; then
rm -rf ${target}
fi
ln -s ${source} ${target}
@@ -51,11 +51,32 @@
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.";
mkRedundantOption = name: value: attrs: lib.mkOption {
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}
'';
};
};
}