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 + 3 files changed, 33 insertions(+) create mode 100644 modules/nixos/sils/impermanence.nix (limited to 'modules') 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; -- cgit 1.4.1