2023-01-21 11:45:05 +01:00
|
|
|
{ config, pkgs, values, ... }:
|
2022-12-17 21:51:43 +01:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
./hardware-configuration.nix
|
|
|
|
../../base.nix
|
2022-12-19 22:56:42 +01:00
|
|
|
../../misc/metrics-exporters.nix
|
2022-12-20 00:26:29 +01:00
|
|
|
|
2024-04-21 23:36:25 +02:00
|
|
|
./services/monitoring
|
2022-12-20 00:26:29 +01:00
|
|
|
./services/nginx
|
2022-12-17 21:51:43 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
sops.defaultSopsFile = ../../secrets/ildkule/ildkule.yaml;
|
|
|
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
|
|
|
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
|
|
|
sops.age.generateKey = true;
|
|
|
|
|
2024-04-21 23:36:25 +02:00
|
|
|
boot.loader.grub.device = "/dev/vda";
|
|
|
|
boot.tmp.cleanOnBoot = true;
|
|
|
|
zramSwap.enable = true;
|
2022-12-17 21:51:43 +01:00
|
|
|
|
|
|
|
networking.hostName = "ildkule"; # Define your hostname.
|
2024-07-28 19:30:16 +02:00
|
|
|
|
|
|
|
# Main connection for incoming and outgoing connections to the world, using the global ("floating") IP
|
|
|
|
systemd.network.networks."30-ntnu-global" = values.defaultNetworkConfig // {
|
2024-07-28 19:25:52 +02:00
|
|
|
matchConfig.Name = "ens4";
|
2024-04-21 23:36:25 +02:00
|
|
|
DHCP = "yes";
|
2024-07-28 19:30:16 +02:00
|
|
|
gateway = [ ];
|
2024-07-28 19:25:52 +02:00
|
|
|
addresses = [
|
|
|
|
{
|
2024-07-28 19:30:16 +02:00
|
|
|
# Add the global address in addition to the local address learned from DHCP
|
2024-07-28 19:25:52 +02:00
|
|
|
addressConfig.Address = "129.241.153.213/32";
|
|
|
|
}
|
2024-07-28 19:30:16 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Secondary connection only for use within the university network
|
|
|
|
systemd.network.networks."40-ntnu-internal" = values.defaultNetworkConfig // {
|
|
|
|
matchConfig.Name = "ens3";
|
|
|
|
DHCP = "yes";
|
|
|
|
gateway = [ ];
|
|
|
|
routes = [
|
2024-07-28 19:25:52 +02:00
|
|
|
{
|
2024-07-28 19:30:16 +02:00
|
|
|
routeConfig.Destination = "10.0.0.0/8";
|
2024-07-28 19:25:52 +02:00
|
|
|
}
|
|
|
|
];
|
2024-07-28 19:30:16 +02:00
|
|
|
linkConfig.RequiredForOnline = "no";
|
|
|
|
dhcpV4Config = {
|
|
|
|
# Do not use this interface as a default / global route
|
|
|
|
# Note: This does not remove the link-local route 192.168.11.0/24, as it is added by the kernel itself
|
|
|
|
UseRoutes = "no";
|
|
|
|
};
|
2022-12-17 21:51:43 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# List packages installed in system profile
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
];
|
|
|
|
|
2024-04-21 23:36:25 +02:00
|
|
|
system.stateVersion = "23.11"; # Did you read the comment?
|
2022-12-17 21:51:43 +01:00
|
|
|
|
|
|
|
}
|