Move postCommands to systemd service
ci / test (push) Successful in 55s Details
ci / deploy (push) Failing after 3m46s Details

This commit is contained in:
Ciapa 2024-02-04 02:06:03 +01:00
parent b5f1441bb2
commit 597c2f9ff3
1 changed files with 23 additions and 12 deletions

View File

@ -11,18 +11,17 @@ in
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 = [
/boot-1/initrd-ssh-key
/boot-2/initrd-ssh-key
]; ];
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys; before = [
}; "zfs-import-zroot.service"
postCommands = '' ];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
cat <<EOF > /root/.profile cat <<EOF > /root/.profile
if pgrep -x "zfs" > /dev/null if pgrep -x "zfs" > /dev/null
then then
@ -38,6 +37,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";