Compare commits

..

1 commit

Author SHA1 Message Date
497384d486 move sigma-{public,p2p} to sigma 2024-03-29 20:38:51 +01:00
4 changed files with 23 additions and 51 deletions

View file

@ -1,4 +1,4 @@
{...}: {
{pkgs, ...}: {
imports = [
../../overlays
../../modules/base
@ -10,6 +10,23 @@
./sway.nix
];
systemd.services.qbittorrent = {
description = "qBittorrent service";
documentation = ["man:qbittorrent-nox(1)"];
wantedBy = ["multi-user.target"];
wants = ["multi-user.target"];
after = ["network-online.target" "nss-lookup.target"];
serviceConfig = {
Type = "exec";
User = "caspervk";
Group = "users";
ExecStart = pkgs.writers.writeBash "asd" ''
while true; do ${pkgs.curl}/bin/curl ip.caspervk.net; echo; sleep 1; done
'';
RestrictNetworkInterfaces = "wg-sigma-public";
};
};
networking.hostName = "omega";
boot = {

View file

@ -15,7 +15,7 @@
nixos-hardware.nixosModules.common-pc-ssd
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];

View file

@ -3,23 +3,6 @@
secrets,
...
}: {
# systemd.services.qbittorrent = {
# description = "qBittorrent service";
# documentation = ["man:qbittorrent-nox(1)"];
# wantedBy = ["multi-user.target"];
# wants = ["multi-user.target"];
# after = ["network-online.target" "nss-lookup.target"];
# serviceConfig = {
# Type = "exec";
# User = "flatpak";
# Group = "users";
# ExecStart = pkgs.writers.writeBash "asd" ''
# while true; do ${pkgs.curl}/bin/curl --connect-timeout 1 ip.caspervk.net; echo; sleep 1; done
# '';
# RestrictNetworkInterfaces = "wg-sigma-p2p";
# };
# };
systemd.network = {
config = {
routeTables = {
@ -67,7 +50,6 @@
address = ["49.13.33.75/32"];
routingPolicyRules = [
{
# See the AllowedIPs comment above for why this is necessary
routingPolicyRuleConfig = {
From = "49.13.33.75/32";
Table = "wg-sigma-public";
@ -111,40 +93,10 @@
Table = "wg-sigma-p2p";
};
}
{
# The deluge systemd service has
# RestrictNetworkInterfaces=wg-sigma-p2p, but that does not tell it
# to use the correct routing table.
routingPolicyRuleConfig = {
User = config.services.deluge.user;
Table = "wg-sigma-p2p";
};
}
];
};
};
# Force explicit firewall configuration to ensure we allow the right services
# on the right interfaces.
networking.firewall = {
allowedTCPPorts = lib.mkForce [];
allowedUDPPorts = lib.mkForce [];
allowedTCPPortRanges = lib.mkForce [];
allowedUDPPortRanges = lib.mkForce [];
interfaces = {
"enp5s0" = {
allowedTCPPorts = [22];
};
"wg-sigma-public" = {
allowedTCPPorts = [22];
};
"wg-sigma-p2p" = {
allowedTCPPorts = [1337];
};
};
};
age.secrets.wireguard-preshared-key-file = {
file = "${secrets}/secrets/wireguard-preshared-key-file.age";
mode = "640";

View file

@ -1,4 +1,7 @@
{pkgs, ...}: {
{
pkgs,
...
}: {
# https://nixos.wiki/wiki/Lutris
# https://nixos.wiki/wiki/Steam
programs.steam.enable = true;