2024-09-13 14:10:54 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports =
|
|
|
|
[
|
|
|
|
../../base.nix
|
2024-09-13 14:10:29 +02:00
|
|
|
./hardware-configuration.nix
|
2024-09-13 14:10:54 +02:00
|
|
|
./desktop
|
|
|
|
];
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
interfaces.eno1 = {
|
|
|
|
useDHCP = true;
|
|
|
|
ipv6.addresses = [
|
|
|
|
{ address = "2001:700:300:22::15"; prefixLength = 64; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-09-13 14:10:29 +02:00
|
|
|
tempAddresses = "disabled";
|
2024-09-13 14:10:54 +02:00
|
|
|
hostName = "felixalbpc";
|
|
|
|
nameservers = [ "129.241.0.200" "129.241.0.201" "2001:700:300::200" "2001:700:300::201" ];
|
|
|
|
domain = "it.ntnu.no";
|
|
|
|
hostId = "f458d6aa";
|
2024-11-05 13:20:59 +01:00
|
|
|
|
2024-12-11 10:37:52 +01:00
|
|
|
search = [
|
|
|
|
"it.ntnu.no"
|
|
|
|
"ntnu.no"
|
|
|
|
];
|
|
|
|
|
2024-11-05 13:20:59 +01:00
|
|
|
# Allow SSH from IT and SSH gateways
|
|
|
|
firewall.extraCommands = ''
|
|
|
|
# IT VPN
|
|
|
|
iptables -I nixos-fw -p tcp -m tcp --dport 22 --source 129.241.117.0/24 -j nixos-fw-accept
|
|
|
|
ip6tables -I nixos-fw -p tcp -m tcp --dport 22 --source 2001:700:301:12::/63 -j nixos-fw-accept
|
|
|
|
|
|
|
|
# SSHGW
|
|
|
|
iptables -I nixos-fw -p tcp -m tcp --dport 22 --source 129.241.160.72/32 -j nixos-fw-accept
|
|
|
|
ip6tables -I nixos-fw -p tcp -m tcp --dport 22 --source 2001:700:300:6::72/128 -j nixos-fw-accept
|
|
|
|
|
|
|
|
# SSHGW
|
|
|
|
iptables -I nixos-fw -p tcp -m tcp --dport 22 --source 129.241.210.217/32 -j nixos-fw-accept
|
|
|
|
ip6tables -I nixos-fw -p tcp -m tcp --dport 22 --source 2001:700:300:1900::1:217/128 -j nixos-fw-accept
|
|
|
|
'';
|
|
|
|
|
|
|
|
firewall.extraStopCommands = ''
|
|
|
|
iptables -F nixos-fw
|
|
|
|
ip6tables -F nixos-fw
|
|
|
|
'';
|
2024-09-13 14:10:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
console.keyMap = "no";
|
|
|
|
|
2024-09-23 14:23:22 +02:00
|
|
|
nixpkgs.config = {
|
|
|
|
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
|
|
|
"copilot.vim"
|
2024-11-05 13:20:59 +01:00
|
|
|
"keymapp"
|
2024-12-01 12:41:41 +01:00
|
|
|
"tlclient"
|
2024-09-23 14:23:22 +02:00
|
|
|
];
|
|
|
|
};
|
2024-09-13 14:10:29 +02:00
|
|
|
|
2024-11-05 13:20:59 +01:00
|
|
|
services.openssh.openFirewall = false;
|
|
|
|
|
2024-09-13 14:10:54 +02:00
|
|
|
users.users.felixalb = {
|
|
|
|
uid = 1328256;
|
|
|
|
openssh.authorizedKeys.keys = [ ];
|
|
|
|
};
|
|
|
|
|
2024-11-05 13:20:59 +01:00
|
|
|
hardware.keyboard.zsa.enable = true;
|
|
|
|
|
2024-09-13 14:10:54 +02:00
|
|
|
system.stateVersion = "24.05";
|
|
|
|
}
|
|
|
|
|