about summary refs log tree commit diff
path: root/modules/persistence.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-01-24 19:18:11 +0900
committersefidel <contact@sefidel.net>2024-01-24 19:18:11 +0900
commit497c3cd7864fdbcc546408d6d86ebfad37aa9b78 (patch)
tree6cd5bf30b9953156d71192fa96e34a863dda5926 /modules/persistence.nix
parenta1dc1ff8c07155f697a30145168820612b28b6cd (diff)
downloadinfra-modules.tar.gz
infra-modules.zip
wip: try to use infra-modules infra-modules
Diffstat (limited to 'modules/persistence.nix')
-rw-r--r--modules/persistence.nix47
1 files changed, 0 insertions, 47 deletions
diff --git a/modules/persistence.nix b/modules/persistence.nix
deleted file mode 100644
index e7a8e90..0000000
--- a/modules/persistence.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ config, inputs, lib, ... }:
-
-
-with lib;
-let
-  cfg = config.modules.persistence;
-in
-{
-  imports = [
-    inputs.impermanence.nixosModules.impermanence
-  ];
-
-  options.modules.persistence = {
-    enable = mkEnableOption "impermanence persistence";
-
-    storagePath = lib.mkOption {
-      type = types.path;
-      description = ''
-        The path to persistent storage where the real
-        files and directories should be stored.
-      '';
-    };
-
-    directories = mkOption {
-      type = types.listOf types.str;
-      default = [ ];
-    };
-  };
-
-  config = mkIf cfg.enable {
-    fileSystems.${cfg.storagePath}.neededForBoot = true;
-
-    environment.persistence.${cfg.storagePath}.directories = cfg.directories;
-
-    services.openssh.hostKeys = [
-      {
-        path = "${cfg.storagePath}/ssh/ssh_host_ed25519_key";
-        type = "ed25519";
-      }
-      {
-        path = "${cfg.storagePath}/ssh/ssh_host_rsa_key";
-        type = "rsa";
-        bits = 4096;
-      }
-    ];
-  };
-}