Compare commits
1 commit
d19b0499b1
...
497384d486
Author | SHA1 | Date | |
---|---|---|---|
497384d486 |
4 changed files with 23 additions and 51 deletions
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
{pkgs, ...}: {
|
||||||
imports = [
|
imports = [
|
||||||
../../overlays
|
../../overlays
|
||||||
../../modules/base
|
../../modules/base
|
||||||
|
@ -10,6 +10,23 @@
|
||||||
./sway.nix
|
./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";
|
networking.hostName = "omega";
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
nixos-hardware.nixosModules.common-pc-ssd
|
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.initrd.kernelModules = ["dm-snapshot"];
|
||||||
boot.kernelModules = ["kvm-amd"];
|
boot.kernelModules = ["kvm-amd"];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [];
|
||||||
|
|
|
@ -3,23 +3,6 @@
|
||||||
secrets,
|
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 = {
|
systemd.network = {
|
||||||
config = {
|
config = {
|
||||||
routeTables = {
|
routeTables = {
|
||||||
|
@ -67,7 +50,6 @@
|
||||||
address = ["49.13.33.75/32"];
|
address = ["49.13.33.75/32"];
|
||||||
routingPolicyRules = [
|
routingPolicyRules = [
|
||||||
{
|
{
|
||||||
# See the AllowedIPs comment above for why this is necessary
|
|
||||||
routingPolicyRuleConfig = {
|
routingPolicyRuleConfig = {
|
||||||
From = "49.13.33.75/32";
|
From = "49.13.33.75/32";
|
||||||
Table = "wg-sigma-public";
|
Table = "wg-sigma-public";
|
||||||
|
@ -111,40 +93,10 @@
|
||||||
Table = "wg-sigma-p2p";
|
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 = {
|
age.secrets.wireguard-preshared-key-file = {
|
||||||
file = "${secrets}/secrets/wireguard-preshared-key-file.age";
|
file = "${secrets}/secrets/wireguard-preshared-key-file.age";
|
||||||
mode = "640";
|
mode = "640";
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
# https://nixos.wiki/wiki/Lutris
|
# https://nixos.wiki/wiki/Lutris
|
||||||
# https://nixos.wiki/wiki/Steam
|
# https://nixos.wiki/wiki/Steam
|
||||||
programs.steam.enable = true;
|
programs.steam.enable = true;
|
||||||
|
|
Loading…
Reference in a new issue