aboutsummaryrefslogtreecommitdiff
path: root/snowfall/modules/home/impermanence/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'snowfall/modules/home/impermanence/default.nix')
-rw-r--r--snowfall/modules/home/impermanence/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/snowfall/modules/home/impermanence/default.nix b/snowfall/modules/home/impermanence/default.nix
new file mode 100644
index 0000000..1b92bca
--- /dev/null
+++ b/snowfall/modules/home/impermanence/default.nix
@@ -0,0 +1,50 @@
+{ options, config, lib, namespace, inputs, host, ... }:
+
+with lib; with lib.${namespace}; let
+ cfg = config.${namespace}.impermanence;
+ hosts = [ "c-pc" ];
+in {
+ imports = [
+ inputs.impermanence.nixosModules.home-manager.impermanence
+ ];
+
+ options.${namespace}.impermanence = with types; {
+ skeleton = mkOption {
+ type = bool;
+ default = true;
+ };
+
+ location = mkOption {
+ type = str;
+ default = "/persist/home";
+ };
+
+ secure = {
+ location = mkOption {
+ type = str;
+ default = "/persist/secure/home";
+ };
+ };
+ };
+
+ config = {
+ home.persistence.${cfg.location} = {
+ enable = builtins.elem host hosts;
+ allowOther = true;
+
+ directories = mkIf cfg.skeleton [
+ "Downloads"
+ "Documents"
+ "Pictures"
+ "Videos"
+ "Music"
+ "Games"
+ "Persist"
+ ];
+ };
+
+ home.persistence.${cfg.secure.location} = {
+ enable = builtins.elem host hosts;
+ };
+ };
+}