parent
c59f0eac51
commit
7efca2ca18
|
@ -4,7 +4,7 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.home.file;
|
cfg = filterAttrs (n: f: f.enable) config.home.file;
|
||||||
|
|
||||||
homeDirectory = config.home.homeDirectory;
|
homeDirectory = config.home.homeDirectory;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,14 @@ in
|
||||||
fileType = basePathDesc: basePath: types.attrsOf (types.submodule (
|
fileType = basePathDesc: basePath: types.attrsOf (types.submodule (
|
||||||
{ name, config, ... }: {
|
{ name, config, ... }: {
|
||||||
options = {
|
options = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether this file should be generated. This option allows specific
|
||||||
|
files to be disabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
target = mkOption {
|
target = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
apply = p:
|
apply = p:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
files-disabled = ./disabled.nix;
|
||||||
files-executable = ./executable.nix;
|
files-executable = ./executable.nix;
|
||||||
files-hidden-source = ./hidden-source.nix;
|
files-hidden-source = ./hidden-source.nix;
|
||||||
files-out-of-store-symlink = ./out-of-store-symlink.nix;
|
files-out-of-store-symlink = ./out-of-store-symlink.nix;
|
||||||
|
|
14
tests/modules/files/disabled.nix
Normal file
14
tests/modules/files/disabled.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
home.file."disabled" = {
|
||||||
|
enable = false;
|
||||||
|
text = ''
|
||||||
|
This file should not exist
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertPathNotExists home-files/disabled
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue