From 2860b842e379c3eecbe1a4f978aaa786c080757d Mon Sep 17 00:00:00 2001 From: NullBite Date: Fri, 9 Feb 2024 17:49:53 +0100 Subject: [PATCH] add mutability test thing --- system/default.nix | 1 + system/testing/default.nix | 6 ++++++ system/testing/mutability.nix | 22 ++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 system/testing/default.nix create mode 100644 system/testing/mutability.nix diff --git a/system/default.nix b/system/default.nix index d3ce6be..5cd5b92 100644 --- a/system/default.nix +++ b/system/default.nix @@ -10,6 +10,7 @@ in ./profile ./programs ./sessions + ./testing ]; config = {}; options.nixfiles = { diff --git a/system/testing/default.nix b/system/testing/default.nix new file mode 100644 index 0000000..91ee7be --- /dev/null +++ b/system/testing/default.nix @@ -0,0 +1,6 @@ +{...}: +{ + imports = [ + ./mutability.nix + ]; +} diff --git a/system/testing/mutability.nix b/system/testing/mutability.nix new file mode 100644 index 0000000..865c865 --- /dev/null +++ b/system/testing/mutability.nix @@ -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; + }; + }; +}