2025-02-21 12:36:07 +02:00
|
|
|
{ pkgs, config, ... }:
|
2024-05-23 13:39:48 +03:00
|
|
|
{
|
2024-06-02 05:53:39 +03:00
|
|
|
networking = {
|
|
|
|
hostName = "helium";
|
2024-06-06 21:12:13 +03:00
|
|
|
|
2024-06-02 05:53:39 +03:00
|
|
|
wg-quick.interfaces = {
|
|
|
|
wg0 = {
|
2024-09-25 13:38:25 +03:00
|
|
|
autostart = true;
|
2025-02-21 12:36:07 +02:00
|
|
|
address = [ "${config.custom.gua_pref}ff::2/64" ];
|
2024-06-02 16:18:19 +03:00
|
|
|
dns = [
|
2025-02-21 12:36:07 +02:00
|
|
|
"${config.custom.gua_pref}ff::1"
|
2024-06-02 16:18:19 +03:00
|
|
|
"vsinerva.fi"
|
|
|
|
];
|
2024-06-02 05:53:39 +03:00
|
|
|
privateKeyFile = "/root/wireguard-keys/privatekey-home";
|
|
|
|
listenPort = 51820;
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2024-06-02 05:53:39 +03:00
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
publicKey = "f9QoYPxyaxylUcOI9cE9fE9DJoEX4c6GUtr4p+rsd34=";
|
2024-10-03 17:46:45 +03:00
|
|
|
presharedKeyFile = "/root/wireguard-keys/psk-home";
|
2025-02-19 03:40:26 +02:00
|
|
|
allowedIPs = [ "::/0" ];
|
2024-09-25 15:18:04 +03:00
|
|
|
endpoint = "wg.vsinerva.fi:51820";
|
2024-06-02 05:53:39 +03:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
wg1 = {
|
|
|
|
autostart = false;
|
|
|
|
address = [ "10.100.0.7/24" ];
|
|
|
|
dns = [ "1.1.1.1" ];
|
|
|
|
privateKeyFile = "/root/wireguard-keys/privatekey-netflix";
|
2024-09-24 20:01:29 +03:00
|
|
|
listenPort = 51820;
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2024-06-02 05:53:39 +03:00
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
publicKey = "XSYHg0utIR1j7kRsWFwuWNo4RPD47KP53cVa6qDPtRE=";
|
2024-06-02 16:18:19 +03:00
|
|
|
allowedIPs = [
|
|
|
|
"0.0.0.0/0"
|
|
|
|
"192.168.0.0/24"
|
|
|
|
];
|
2024-06-02 05:53:39 +03:00
|
|
|
endpoint = "netflix.vsinerva.fi:51821";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-08-01 22:12:02 +03:00
|
|
|
# Dirty hack to fix autostart failing due to DNS lookups
|
2024-09-25 13:38:25 +03:00
|
|
|
systemd.services."wg-quick-wg0".serviceConfig = {
|
2024-08-01 22:12:02 +03:00
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "1s";
|
|
|
|
};
|
2024-09-28 23:31:40 +03:00
|
|
|
services.clatd = {
|
|
|
|
enable = true;
|
2025-02-21 12:36:07 +02:00
|
|
|
settings.clat-v6-addr = "${config.custom.gua_pref}ff::c2";
|
2024-09-28 23:31:40 +03:00
|
|
|
};
|
|
|
|
systemd.services.clatd.wants = [ "wg-quick-wg0.service" ];
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2024-07-31 00:54:56 +03:00
|
|
|
services.openssh.enable = pkgs.lib.mkForce false;
|
|
|
|
services.fail2ban.enable = pkgs.lib.mkForce false;
|
|
|
|
|
2024-06-02 05:53:39 +03:00
|
|
|
imports = [
|
|
|
|
../base.nix
|
2024-06-06 16:53:15 +03:00
|
|
|
../users/vili.nix
|
2024-06-02 05:53:39 +03:00
|
|
|
../desktop.nix
|
|
|
|
../development.nix
|
2024-06-06 21:12:13 +03:00
|
|
|
../services/syncthing.nix
|
|
|
|
../services/redshift.nix
|
2025-01-11 14:27:15 +02:00
|
|
|
../services/moonlight.nix
|
2025-02-20 20:53:22 +02:00
|
|
|
../hardware-specific/onlykey.nix
|
2024-06-06 21:12:13 +03:00
|
|
|
../hardware-specific/keychron-q11.nix
|
|
|
|
../hardware-specific/trackball.nix
|
|
|
|
../hardware-specific/amd-laptop.nix
|
|
|
|
../hardware-specific/usb-automount.nix
|
2024-06-02 05:53:39 +03:00
|
|
|
];
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2024-06-06 21:12:13 +03:00
|
|
|
services.xserver.displayManager.setupCommands = ''
|
2024-12-06 19:25:57 +02:00
|
|
|
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-0 --auto --pos 0x0 --primary --output eDP --auto --pos 3840x360
|
2024-06-06 21:12:13 +03:00
|
|
|
'';
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2024-09-09 15:52:21 +03:00
|
|
|
system.autoUpgrade.allowReboot = pkgs.lib.mkForce false;
|
|
|
|
|
2024-08-28 11:52:00 +03:00
|
|
|
swapDevices = pkgs.lib.mkForce [
|
|
|
|
{
|
|
|
|
device = "/var/lib/swapfile";
|
|
|
|
size = 16 * 1024;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-06-06 21:12:13 +03:00
|
|
|
boot = {
|
2024-10-18 12:40:23 +03:00
|
|
|
loader.timeout = 3;
|
2024-10-16 18:05:15 +03:00
|
|
|
initrd.luks = {
|
|
|
|
fido2Support = true;
|
|
|
|
devices."luks-f6e1979b-0dee-4ee9-8170-10490019854b".fido2 = {
|
|
|
|
passwordLess = true;
|
|
|
|
credential = "df9233221fa09173fea61d8b8516d184f8ede475024a88201b34d838ecf306ee070052dae2262619c1da2be7562ec9dd94888c71a9326fea70dfe16214b5ea8ec014d86afa01";
|
|
|
|
};
|
|
|
|
};
|
2024-06-06 21:12:13 +03:00
|
|
|
resumeDevice = "/dev/mapper/luks-f6e1979b-0dee-4ee9-8170-10490019854b";
|
|
|
|
kernelParams = [ "resume_offset=44537856" ];
|
2024-06-02 16:18:19 +03:00
|
|
|
};
|
2024-05-23 13:39:48 +03:00
|
|
|
}
|