summaryrefslogtreecommitdiff
path: root/modules/nixos/common/ark.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos/common/ark.nix')
-rw-r--r--modules/nixos/common/ark.nix50
1 files changed, 29 insertions, 21 deletions
diff --git a/modules/nixos/common/ark.nix b/modules/nixos/common/ark.nix
index 3a12050..6c7148f 100644
--- a/modules/nixos/common/ark.nix
+++ b/modules/nixos/common/ark.nix
@@ -4,34 +4,42 @@
lib,
...
}:
-with lib; let
+with lib;
+let
cfg = config.nixfiles.modules.ark;
-in {
+in
+{
imports = [
- (mkAliasOptionModule ["ark"] ["nixfiles" "modules" "ark"])
+ (mkAliasOptionModule [ "ark" ] [
+ "nixfiles"
+ "modules"
+ "ark"
+ ])
inputs.impermanence.nixosModules.impermanence
];
- options.nixfiles.modules.ark = let
- mkListOfAnythingOption = mkOption {
- type = with types; listOf anything; # Assumed to be matching with the upstream type.
- default = [];
- };
- in {
- enable = mkEnableOption "persistent storage support via impermanence";
+ options.nixfiles.modules.ark =
+ let
+ mkListOfAnythingOption = mkOption {
+ type = with types; listOf anything; # Assumed to be matching with the upstream type.
+ default = [ ];
+ };
+ in
+ {
+ enable = mkEnableOption "persistent storage support via impermanence";
- path = mkOption {
- type = types.str;
- default = "/ark";
- };
+ path = mkOption {
+ type = types.str;
+ default = "/ark";
+ };
- directories = mkListOfAnythingOption;
- files = mkListOfAnythingOption;
- # hm = {
- # directories = mkListOfAnythingOption;
- # files = mkListOfAnythingOption;
- # };
- };
+ directories = mkListOfAnythingOption;
+ files = mkListOfAnythingOption;
+ # hm = {
+ # directories = mkListOfAnythingOption;
+ # files = mkListOfAnythingOption;
+ # };
+ };
config = mkIf cfg.enable {
environment.persistence.${cfg.path} = {