mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
feat: files force,,,
This commit is contained in:
parent
8ea560f504
commit
1d5c0a1d15
5 changed files with 49 additions and 16 deletions
27
modules/home/files-force.nix
Normal file
27
modules/home/files-force.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
config,
|
||||
options,
|
||||
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);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue