Fix mounts
This commit is contained in:
parent
7b6b15ab00
commit
d77d56a51a
2 changed files with 15 additions and 11 deletions
20
flake.nix
20
flake.nix
|
@ -118,7 +118,7 @@
|
|||
(subvolumesModule {
|
||||
inherit device subvolumes;
|
||||
}) else { })
|
||||
({ config, pkgs, ... }:
|
||||
({ config, lib, pkgs, ... }:
|
||||
let
|
||||
keyFilePath = config.sops.secrets.k3sKeyFile.path;
|
||||
prepareNvme = ''
|
||||
|
@ -242,7 +242,7 @@
|
|||
};
|
||||
in
|
||||
if unlockMounts && mountVolumes then
|
||||
fileSystemConfig
|
||||
lib.mkForce fileSystemConfig
|
||||
else
|
||||
{ };
|
||||
|
||||
|
@ -291,13 +291,13 @@
|
|||
(subvolumesModule {
|
||||
inherit device subvolumes;
|
||||
})
|
||||
{
|
||||
fileSystems."${mountDir}" = {
|
||||
({ lib, ... }: {
|
||||
fileSystems."${mountDir}" = lib.mkForce {
|
||||
inherit device;
|
||||
fsType = "btrfs";
|
||||
options = [ "defaults" "compress=zstd" "rw" "loop" ];
|
||||
};
|
||||
}
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -338,7 +338,7 @@
|
|||
device = "/dev/disk/by-label/DATA";
|
||||
subvolumes = [ "@garage-cluster-data" ];
|
||||
}) else { })
|
||||
({ config, pkgs, ... }:
|
||||
({ config, pkgs, lib, ... }:
|
||||
let
|
||||
keyFile = "nextcloudKeyFile";
|
||||
keyFilePath = config.sops.secrets."${keyFile}".path;
|
||||
|
@ -418,7 +418,7 @@
|
|||
};
|
||||
};
|
||||
in
|
||||
if unlockMounts && mountVolumes then fileSystemConfig else { };
|
||||
if unlockMounts && mountVolumes then lib.mkForce fileSystemConfig else { };
|
||||
|
||||
networking.firewall.enable = false;
|
||||
})
|
||||
|
@ -449,7 +449,7 @@
|
|||
(subvolumesModule {
|
||||
inherit device subvolumes;
|
||||
}) else { })
|
||||
({ config, ... }:
|
||||
({ config, lib, ... }:
|
||||
let
|
||||
keyFilePath = config.sops.secrets."${keyFile}".path;
|
||||
in
|
||||
|
@ -466,7 +466,7 @@
|
|||
'';
|
||||
};
|
||||
|
||||
fileSystems."${mountDir}" = {
|
||||
fileSystems."${mountDir}" = lib.mkForce {
|
||||
inherit device;
|
||||
fsType = "btrfs";
|
||||
options = [ "defaults" "compress=zstd" "rw" ];
|
||||
|
@ -480,6 +480,8 @@
|
|||
garage1 = makeGarageConfig {
|
||||
hostname = "garage1";
|
||||
selfIp = "192.168.20.40";
|
||||
unlockMounts = true;
|
||||
mountVolumes = true;
|
||||
};
|
||||
|
||||
garage2 = makeGarageConfig {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{ device, subvolumes ? [ ] }:
|
||||
|
||||
{ lib, ... }:
|
||||
|
||||
{
|
||||
fileSystems = builtins.foldl'
|
||||
fileSystems = lib.mkForce (builtins.foldl'
|
||||
(acc: subvol:
|
||||
let
|
||||
length = builtins.stringLength subvol;
|
||||
|
@ -15,5 +17,5 @@
|
|||
};
|
||||
})
|
||||
{ }
|
||||
subvolumes;
|
||||
subvolumes);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue