From 6772fa0ce45c4b8408c6a1ae62ab7deaaefc2c5b Mon Sep 17 00:00:00 2001 From: Silas Schöffel Date: Sun, 2 Jun 2024 14:57:04 +0200 Subject: impermanence: init module --- modules/nixos/sils/default.nix | 1 + modules/nixos/sils/impermanence.nix | 31 +++++++++++++++++++++++++++++++ modules/nixos/sils/roles.nix | 1 + sys/default.nix | 1 - sys/impermanence/default.nix | 22 ---------------------- 5 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 modules/nixos/sils/impermanence.nix delete mode 100644 sys/impermanence/default.nix diff --git a/modules/nixos/sils/default.nix b/modules/nixos/sils/default.nix index 7135ff9..a0fe1ac 100644 --- a/modules/nixos/sils/default.nix +++ b/modules/nixos/sils/default.nix @@ -5,6 +5,7 @@ ./environment.nix ./font.nix ./hyprland.nix + ./impermanence.nix ./meta.nix ./networking.nix ./nix.nix diff --git a/modules/nixos/sils/impermanence.nix b/modules/nixos/sils/impermanence.nix new file mode 100644 index 0000000..55651e0 --- /dev/null +++ b/modules/nixos/sils/impermanence.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + ... +}: let + cfg = config.sils.impermanence; +in { + options.sils.impermanence.enable = lib.mkEnableOption "impermanence to persist directories"; + config = lib.mkIf cfg.enable { + environment.persistence."/srv".directories = [ + { + directory = "/var/lib/bluetooth"; + user = "root"; + group = "root"; + mode = "0700"; + } + { + directory = "/root"; + user = "root"; + group = "root"; + mode = "0700"; + } + { + directory = "/var/lib/waydroid"; + user = "root"; + group = "root"; + mode = "0700"; + } + ]; + }; +} diff --git a/modules/nixos/sils/roles.nix b/modules/nixos/sils/roles.nix index e973759..94511b9 100644 --- a/modules/nixos/sils/roles.nix +++ b/modules/nixos/sils/roles.nix @@ -9,6 +9,7 @@ in { environment.enable = true; font.enable = true; hyprland.enable = true; + impermanence.enable = true; networking.enable = true; nix-config.enable = true; plymouth.enable = true; diff --git a/sys/default.nix b/sys/default.nix index 3955d12..c88c018 100644 --- a/sys/default.nix +++ b/sys/default.nix @@ -1,6 +1,5 @@ {...}: { imports = [ - ./impermanence ./keyboard ./opengl ./packages diff --git a/sys/impermanence/default.nix b/sys/impermanence/default.nix deleted file mode 100644 index 82765db..0000000 --- a/sys/impermanence/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{...}: { - environment.persistence."/srv".directories = [ - { - directory = "/var/lib/bluetooth"; - user = "root"; - group = "root"; - mode = "0700"; - } - { - directory = "/root"; - user = "root"; - group = "root"; - mode = "0700"; - } - { - directory = "/var/lib/waydroid"; - user = "root"; - group = "root"; - mode = "0700"; - } - ]; -} -- cgit 1.4.1