add mutability test thing

This commit is contained in:
NullBite 2024-02-09 17:49:53 +01:00
parent 6763726f3f
commit 2860b842e3
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
3 changed files with 29 additions and 0 deletions

View File

@ -10,6 +10,7 @@ in
./profile
./programs
./sessions
./testing
];
config = {};
options.nixfiles = {

View File

@ -0,0 +1,6 @@
{...}:
{
imports = [
./mutability.nix
];
}

View File

@ -0,0 +1,22 @@
{ lib, pkgs, config, ... }:
let
cfg = config.nixfiles.testing.mutability;
file = pkgs.writeTextFile {
name = "test";
text = ''
meow!
'';
};
in
{
options.nixfiles.testing.mutability = {
enable = lib.mkEnableOption "mutability test";
};
config = lib.mkIf cfg.enable {
environment.etc.mutability-test = {
mode = "0644";
source = file;
};
};
}