fix server networkd initrd #123
|
@ -33,6 +33,7 @@ in
|
||||||
config = {
|
config = {
|
||||||
# Hack so that network is considered up by boot.initrd.network and postCommands gets executed.
|
# Hack so that network is considered up by boot.initrd.network and postCommands gets executed.
|
||||||
boot.kernelParams = [ "ip=127.0.0.1:::::lo:none" ];
|
boot.kernelParams = [ "ip=127.0.0.1:::::lo:none" ];
|
||||||
|
boot.initrd.systemd.enable = false;
|
||||||
|
|
||||||
boot.initrd.network = {
|
boot.initrd.network = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -47,14 +48,15 @@ in
|
||||||
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
|
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
|
||||||
};
|
};
|
||||||
postCommands = ''
|
postCommands = ''
|
||||||
ip link set dev eth0 up
|
ip addr
|
||||||
|
ip link set dev enp6s0 up
|
||||||
|
|
||||||
ip addr add ${cfg.ipv4.address}/${cfg.ipv4.cidr} dev eth0
|
ip addr add ${cfg.ipv4.address}/${cfg.ipv4.cidr} dev enp6s0
|
||||||
ip route add ${cfg.ipv4.gateway} dev eth0
|
ip route add ${cfg.ipv4.gateway} dev enp6s0
|
||||||
ip route add default via ${cfg.ipv4.gateway} dev eth0
|
ip route add default via ${cfg.ipv4.gateway} dev enp6s0
|
||||||
|
|
||||||
ip -6 addr add ${cfg.ipv6.address}/${cfg.ipv6.cidr} dev eth0
|
ip -6 addr add ${cfg.ipv6.address}/${cfg.ipv6.cidr} dev enp6s0
|
||||||
ip -6 route add default via fe80::1 dev eth0
|
ip -6 route add default via fe80::1 dev enp6s0
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -205,7 +205,7 @@ lib.mkMerge [{
|
||||||
settings = {
|
settings = {
|
||||||
container.options = "-e NIX_BUILD_SHELL=/bin/bash -e PAGER=cat -e PATH=/bin -e SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt --device /dev/kvm -v /nix:/nix -v ${storeDeps}/bin:/bin -v ${storeDeps}/etc/ssl:/etc/ssl --user nixuser --device=/dev/kvm";
|
container.options = "-e NIX_BUILD_SHELL=/bin/bash -e PAGER=cat -e PATH=/bin -e SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt --device /dev/kvm -v /nix:/nix -v ${storeDeps}/bin:/bin -v ${storeDeps}/etc/ssl:/etc/ssl --user nixuser --device=/dev/kvm";
|
||||||
# the default network that also respects our dns server settings
|
# the default network that also respects our dns server settings
|
||||||
container.network = "podman";
|
container.network = "host";
|
||||||
container.valid_volumes = [
|
container.valid_volumes = [
|
||||||
"/nix"
|
"/nix"
|
||||||
"${storeDeps}/bin"
|
"${storeDeps}/bin"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user