Compare commits

..
35 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
greyweather 6f0af993ba emkRedundantOption: escape backslashes, leave escaping newlines until MD generation 2026-09-01 23:29:10 +01:00
greyweather 30ce28a0a6 mkRedundantOption: move into just a regular string 2026-09-01 23:25:51 +01:00
greyweather a41a05ac9f mkRedundantOption: try using html formatting to get around indentation requirement 2026-09-01 23:21:43 +01:00
greyweather d2f2f7fad2 mkRedundantOption: try double the number of spaces because who knows 2026-09-01 23:00:04 +01:00
greyweather fbdc2e8420 Revert "mkRedundantOption: use lib.literalMd to hopefully format correctly"
This reverts commit 9846cf8d3b.
2026-09-01 22:51:34 +01:00
greyweather 9846cf8d3b mkRedundantOption: use lib.literalMd to hopefully format correctly 2026-09-01 22:49:56 +01:00
greyweather f1567e6123 mkRedundantOption: remove multi-line string, manually add newlines 2026-09-01 22:37:08 +01:00
greyweather 78defcb9e9 mkRedundantOption: define spaces explicitly with nix string, to avoid multi-line string formatting issues 2026-09-01 22:31:38 +01:00
greyweather 124314796a mkRedundantOption: use four spaces to indent admonition, as per the docs 2026-09-01 22:28:09 +01:00
greyweather fd300f979e mkRedundantOption: another formatting change 2026-09-01 22:23:55 +01:00
greyweather 0677d2c9e6 mkRedundantOption: change formatting to fix rendering as code block 2026-09-01 22:22:44 +01:00
greyweather 57f553a059 mkRedundantOption: change admonition to material for mkdocs format 2026-09-01 22:19:51 +01:00
greyweather bc4136e9b3 mkRedundantOption: try 2 newlines instead 2026-09-01 22:16:02 +01:00
greyweather 8a615b7f2d mkRedundantOption: try 3 newlines to match the markdown that is generated 2026-09-01 22:11:54 +01:00
greyweather f342fc3337 mkRedundantOption: try to fix newlines again 2026-09-01 21:57:42 +01:00
greyweather 3abf233c93 mkRedundantOptions: add spaces to <br> 2026-09-01 21:51:11 +01:00
greyweather 5f5a169c56 mkRedundantOption: use <br> for newline instead 2026-09-01 21:47:06 +01:00
greyweather 00aa016aaa mkRedundantOption: add two spaces for newline 2026-09-01 21:44:58 +01:00
greyweather 2bb337795e Revert "mkRedundantOption: attempt to fix bug with better nesting"
This reverts commit 99d252f412.
2026-09-01 19:06:51 +01:00
greyweather 219a097abf Revert "mkRedundantOption -> mkRedundantOptionAttrs"
This reverts commit fc6eeca5cf.
2026-09-01 19:06:26 +01:00
+20 -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,12 +51,30 @@
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.";
mkRedundantOptionAttrs = name: value: attrs: {
mkRedundantOption = name: value: attrs: lib.mkOption {
inherit (attrs) type default;
description = ''
${attrs.description}
${mkRedundantOptionDescription name value}
'';
};