Compare commits

...

2 Commits

Author SHA1 Message Date
Ciapa 8d6f91ea6f Move postCommands to systemd service
ci / test (push) Failing after 5m42s Details
ci / deploy (push) Has been skipped Details
2024-02-04 02:06:03 +01:00
Ciapa b5f1441bb2 Install additional packages 2024-02-04 01:51:04 +01:00
2 changed files with 25 additions and 14 deletions

View File

@ -6,23 +6,21 @@ let
in
{
# ZFS remote unlocking
boot.initrd.systemd.enable = true;
boot.initrd.availableKernelModules = [ "igb" ];
boot.kernelParams = [
"ip=192.168.0.42::192.168.0.1:255.255.252.0:phoenix-initrd:eno2:off:192.168.0.1"
];
boot.initrd.network = {
enable = true;
ssh = {
enable = true;
port = 2222;
hostKeys = [
/boot-1/initrd-ssh-key
/boot-2/initrd-ssh-key
boot.initrd.systemd.services.zfsunlock = {
description = "Unlock ZFS pools";
wantedBy = [
"initrd.target"
];
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
};
postCommands = ''
before = [
"zfs-import-zroot.service"
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
cat <<EOF > /root/.profile
if pgrep -x "zfs" > /dev/null
then
@ -38,6 +36,18 @@ in
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
networking.hostId = "42069420";

View File

@ -4,7 +4,8 @@
vim
git
curl
htop
btop
rclone
screen
];
}