Compare commits
2 Commits
6e7dd508d0
...
8d6f91ea6f
Author | SHA1 | Date |
---|---|---|
Ciapa | 8d6f91ea6f | |
Ciapa | b5f1441bb2 |
|
@ -6,23 +6,21 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# ZFS remote unlocking
|
# ZFS remote unlocking
|
||||||
boot.initrd.systemd.enable = true;
|
|
||||||
boot.initrd.availableKernelModules = [ "igb" ];
|
boot.initrd.availableKernelModules = [ "igb" ];
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
"ip=192.168.0.42::192.168.0.1:255.255.252.0:phoenix-initrd:eno2:off:192.168.0.1"
|
"ip=192.168.0.42::192.168.0.1:255.255.252.0:phoenix-initrd:eno2:off:192.168.0.1"
|
||||||
];
|
];
|
||||||
boot.initrd.network = {
|
boot.initrd.systemd.services.zfsunlock = {
|
||||||
enable = true;
|
description = "Unlock ZFS pools";
|
||||||
ssh = {
|
wantedBy = [
|
||||||
enable = true;
|
"initrd.target"
|
||||||
port = 2222;
|
];
|
||||||
hostKeys = [
|
before = [
|
||||||
/boot-1/initrd-ssh-key
|
"zfs-import-zroot.service"
|
||||||
/boot-2/initrd-ssh-key
|
];
|
||||||
];
|
unitConfig.DefaultDependencies = "no";
|
||||||
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
|
serviceConfig.Type = "oneshot";
|
||||||
};
|
script = ''
|
||||||
postCommands = ''
|
|
||||||
cat <<EOF > /root/.profile
|
cat <<EOF > /root/.profile
|
||||||
if pgrep -x "zfs" > /dev/null
|
if pgrep -x "zfs" > /dev/null
|
||||||
then
|
then
|
||||||
|
@ -38,6 +36,18 @@ in
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
boot.initrd.network = {
|
||||||
|
enable = true;
|
||||||
|
ssh = {
|
||||||
|
enable = true;
|
||||||
|
port = 2222;
|
||||||
|
hostKeys = [
|
||||||
|
/boot-1/initrd-ssh-key
|
||||||
|
/boot-2/initrd-ssh-key
|
||||||
|
];
|
||||||
|
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# ZFS options from https://nixos.wiki/wiki/NixOS_on_ZFS
|
# ZFS options from https://nixos.wiki/wiki/NixOS_on_ZFS
|
||||||
networking.hostId = "42069420";
|
networking.hostId = "42069420";
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
vim
|
vim
|
||||||
git
|
git
|
||||||
curl
|
curl
|
||||||
htop
|
btop
|
||||||
rclone
|
rclone
|
||||||
|
screen
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue