Try to get sea-store working
This commit is contained in:
parent
c9815b4caf
commit
56cea847f4
@ -37,6 +37,21 @@ in {
|
|||||||
# };
|
# };
|
||||||
# };
|
# };
|
||||||
|
|
||||||
|
fudo.hosts.nostromo.encrypted-filesystems.sea-store = {
|
||||||
|
encrypted-device = "/dev/nostromo-store/locked";
|
||||||
|
key-path = "/run/keys/sea-store";
|
||||||
|
filesystem-type = "btrfs";
|
||||||
|
options = [ "noatime" "nodiratime" "compress=zstd" "noexec" ];
|
||||||
|
mountpoints = {
|
||||||
|
"/share/downloads" = {
|
||||||
|
options = [ "subvol=@downloads" ];
|
||||||
|
};
|
||||||
|
"/share/documents" = {
|
||||||
|
options = [ "subvol=@documents" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
fudo.ipfs = {
|
fudo.ipfs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
users = [ "niten" ];
|
users = [ "niten" ];
|
||||||
|
@ -6,15 +6,6 @@ let
|
|||||||
host-filesystems = config.fudo.hosts.${hostname}.encrypted-filesystems;
|
host-filesystems = config.fudo.hosts.${hostname}.encrypted-filesystems;
|
||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
fileSystems = mapAttrs' (filesystem-name: opts:
|
|
||||||
nameValuePair opts.target-path
|
|
||||||
{
|
|
||||||
device = "/dev/mapper/${filesystem-name}";
|
|
||||||
fsType = opts.filesystem-type;
|
|
||||||
options = opts.filesystem-options;
|
|
||||||
})
|
|
||||||
host-filesystems;
|
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
mounts = let
|
mounts = let
|
||||||
filesystems = mapAttrsToList
|
filesystems = mapAttrsToList
|
||||||
@ -45,7 +36,7 @@ in {
|
|||||||
path = with pkgs; [ cryptsetup ];
|
path = with pkgs; [ cryptsetup ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = pkgs.writeShellScript "decrypt-${filesystem-name}.sh" ''
|
ExecStart = pkgs.writeShellScript "decrypt-${filesystem-name}.sh" ''
|
||||||
cryptsetup open --type luks --key-file ${opts.key-path} ${opts.device} ${filesystem-name}
|
cryptsetup open --type luks --key-file ${opts.key-path} ${opts.encrypted-device} ${filesystem-name}
|
||||||
'';
|
'';
|
||||||
ExecStop = pkgs.writeShellScript "close-${filesystem-name}.sh" ''
|
ExecStop = pkgs.writeShellScript "close-${filesystem-name}.sh" ''
|
||||||
cryptsetup close /dev/mapper/${filesystem-name}
|
cryptsetup close /dev/mapper/${filesystem-name}
|
||||||
|
@ -19,7 +19,7 @@ rec {
|
|||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
options = with types; {
|
options = with types; {
|
||||||
device = mkOption {
|
encrypted-device = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = "Path to the encrypted device.";
|
description = "Path to the encrypted device.";
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user