Compare commits
6 Commits
script
...
4d4e9d980b
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d4e9d980b | |||
| beb3839a6b | |||
| 0df32bf47c | |||
| f6bbbdec3e | |||
| 2a5539c204 | |||
| 9588103e67 |
@@ -86,6 +86,7 @@ in
|
||||
enable = true;
|
||||
authorizedKeys = sshKeys.admins;
|
||||
ethernetDrivers = ["r8169"];
|
||||
zfsExtraPools = [ "storage" ];
|
||||
};
|
||||
|
||||
boot.initrd = {
|
||||
|
||||
@@ -22,6 +22,11 @@ in
|
||||
description = "Ethernet drivers to load: run `lspci -k | grep -iA4 ethernet`";
|
||||
example = "r8169";
|
||||
};
|
||||
zfsExtraPools = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Name or GUID of extra ZFS pools that you wish to import during boot.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.enable && config.malobeo.disks.encryption) {
|
||||
@@ -32,11 +37,12 @@ in
|
||||
zfs = {
|
||||
forceImportAll = true;
|
||||
requestEncryptionCredentials = true;
|
||||
|
||||
extraPools = cfg.zfsExtraPools;
|
||||
};
|
||||
initrd = {
|
||||
availableKernelModules = cfg.ethernetDrivers;
|
||||
systemd = {
|
||||
initrdBin = [ pkgs.busybox pkgs.wireguard-tools pkgs.iproute2 ];
|
||||
enable = true;
|
||||
network.enable = true;
|
||||
};
|
||||
@@ -56,6 +62,7 @@ in
|
||||
path = with pkgs; [ zfs ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
zpool import storage
|
||||
echo "zfs load-key -a; killall zfs; systemctl default" >> /var/empty/.profile
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user