mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
25 lines
564 B
Nix
25 lines
564 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.types) attrsOf submodule;
|
|
inherit (lib.options) mkOption mkEnableOption;
|
|
inherit (lib.modules) mkDefault;
|
|
inherit (lib.attrsets) genAttrs;
|
|
fileOption = mkOption {
|
|
type = attrsOf (submodule (
|
|
_: {
|
|
config.force = mkDefault config.home.clobberAllFiles;
|
|
}
|
|
));
|
|
};
|
|
in {
|
|
options = {
|
|
home = {
|
|
clobberAllFiles = mkEnableOption "clobbering all files";
|
|
file = fileOption;
|
|
};
|
|
xdg = genAttrs ["configFile" "cacheFile" "stateFile" "dataFile"] (_: fileOption);
|
|
};
|
|
}
|