2023-10-24 13:54:04 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
2024-03-25 18:12:45 +00:00
|
|
|
flake,
|
2023-10-24 13:54:04 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
psCfg = config.pub-solar;
|
|
|
|
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
|
|
|
|
in {
|
|
|
|
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
|
|
boot.kernelParams = [
|
|
|
|
"boot.shell_on_fail=1"
|
2024-02-04 00:05:28 +00:00
|
|
|
# Hack so that network is considered up by boot.initrd.network and postCommands gets executed.
|
|
|
|
"ip=127.0.0.1:::::lo:none"
|
2023-10-24 13:54:04 +00:00
|
|
|
];
|
|
|
|
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_net" ];
|
|
|
|
boot.initrd.network = {
|
|
|
|
enable = true;
|
|
|
|
ssh = {
|
2024-02-04 00:05:28 +00:00
|
|
|
enable = true;
|
|
|
|
port = 2222;
|
|
|
|
hostKeys = [ /boot/initrd-ssh-key ];
|
2024-03-25 18:12:45 +00:00
|
|
|
authorizedKeys = flake.self.publicKeys;
|
2024-02-04 00:05:28 +00:00
|
|
|
shell = "/bin/cryptsetup-askpass";
|
2023-10-24 13:54:04 +00:00
|
|
|
};
|
2024-02-04 00:05:28 +00:00
|
|
|
postCommands = ''
|
|
|
|
ip link set dev enp1s0 up
|
|
|
|
|
|
|
|
ip addr add 128.140.109.213/32 dev enp1s0
|
|
|
|
ip route add 172.31.1.1 dev enp1s0
|
|
|
|
ip route add default via 172.31.1.1 dev enp1s0
|
|
|
|
|
|
|
|
ip -6 addr add 128.140.109.213/128 dev enp1s0
|
|
|
|
ip -6 addr add 2a01:4f8:c2c:b60::/64 dev enp1s0
|
|
|
|
ip -6 route add fe80::1 dev enp1s0
|
|
|
|
ip -6 route add default via fe80::1 dev enp1s0
|
|
|
|
'';
|
2023-10-24 13:54:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
boot.supportedFilesystems = [ "zfs" ];
|
2024-02-03 14:57:00 +00:00
|
|
|
boot.kernelPackages = pkgs.linuxPackages_6_1;
|
2023-10-24 13:54:04 +00:00
|
|
|
|
|
|
|
# Copy the NixOS configuration file and link it from the resulting system
|
|
|
|
# (/run/current-system/configuration.nix). This is useful in case you
|
|
|
|
# accidentally delete configuration.nix.
|
|
|
|
# system.copySystemConfiguration = true;
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
# on your system were taken. It's perfectly fine and recommended to leave
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
system.stateVersion = "23.05"; # Did you read the comment?
|
|
|
|
}
|