Add volumes

volumes
Inex Code 2022-07-26 15:39:59 +03:00
parent c1ed3a522c
commit 417a9393a6
4 changed files with 29 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }:
let
url-overlay = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo/archive/master.tar.gz";
url-overlay = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo/archive/graphql.tar.gz";
nix-overlay = (import (builtins.fetchTarball url-overlay));
in
{

View File

@ -163,5 +163,15 @@ in
type = types.nullOr (types.listOf (types.attrsOf types.anything));
default = [ ];
};
##############
# Volumes #
##############
volumes = mkOption {
description = ''
Volumes that will be created on the server
'';
type = types.nullOr (types.listOf (types.attrsOf types.anything));
default = [ ];
};
};
}

View File

@ -45,5 +45,6 @@ in
passwordAuthentication = lib.attrsets.attrByPath [ "ssh" "passwordAuthentication" ] true jsonData;
};
users = lib.attrsets.attrByPath [ "users" ] [ ] jsonData;
volumes = lib.attrsets.attrByPath [ "volumes" ] [ ] jsonData;
};
}

17
volumes.nix Normal file
View File

@ -0,0 +1,17 @@
{ pkgs, config, ... }:
let
cfg = config.services.userdata;
in
{
fileSystems = {
builtins.listToAttrs (builtins.map
(volume: {
name: "${volume.mountPoint}";
value: {
device = "${volume.device}";
fsType = "${volume.fsType}";
};
})
cfg.volumes);
}
}