Author SHA1 Message Date
CaZzzer 0cbc516fb0 WIP: router: tailscale 2026-10-11 12:08:01 -07:00
CaZzzer 7351194fee router: services: add secret for grafana key 2026-10-11 11:39:40 -07:00
CaZzzer 6aa799c05d router: firewall: rule updates 2026-10-11 11:28:34 -07:00
CaZzzer ddb6d43b0c router: dns: udpate default upstreams 2026-10-11 11:26:13 -07:00
CaZzzer 8af0ecbf39 router: update hardware config 2026-10-11 11:24:58 -07:00
CaZzzer ce60b83151 updates: nixpkgs, home-manager 2026-10-11 11:11:24 -07:00
CaZzzer 23609e180e home: fix ls eza aliases 2026-09-30 10:53:29 -07:00
CaZzzer 0a566d99b1 updates: nixpkgs, home-manager 2026-09-29 22:11:37 -07:00
CaZzzer ff3e201261 pc: add lmstudio 2026-09-29 22:11:37 -07:00
CaZzzer 87c5a25123 desktop: get rid of flatpak fonts workaround
a
2026-09-29 22:11:37 -07:00
CaZzzer fd4bc1eaee updates: nixpkgs, home-manager 2026-09-12 19:20:14 -07:00
CaZzzer 378ba963b4 updates: linux 7.2 , nixpkgs, home-manager, secrix 2026-08-24 05:02:36 -07:00
CaZzzer 0e8d8122ef updates: nixpkgs, home-manager, plasma-manager, secrix 2026-08-04 16:06:46 -07:00
CaZzzer ee9efb8054 updates: nixpkgs, home-manager, plasma-manager, lanzaboote 2026-07-11 15:01:25 -07:00
CaZzzer 37769c788a updates: nixpkgs, home-manager, secrix 2026-06-21 13:41:03 -07:00
CaZzzer ff1c55e812 updates: nixpkgs, home-manager 2026-05-03 01:50:31 -07:00
CaZzzer b6830e1a45 updates: nixpkgs, home-manager, plasma-manager 2026-04-18 21:44:23 -07:00
CaZzzer 71cb76700f updates: nixpkgs, home-manager, plasma-manager 2026-04-09 20:46:54 -07:00
CaZzzer 7aa16dd35e updates: nixpkgs, home-manager, plasma-manager 2026-03-02 12:36:58 -08:00
CaZzzer 08290f9b43 updates: nixpkgs, home-manager, plasma-manager 2026-02-14 16:13:54 -08:00
CaZzzer 4b012f259f desktop: add jj 2026-02-13 16:16:33 -08:00
CaZzzer 7da9b008b4 desktop: add antigravity 2026-02-07 23:42:13 -08:00
CaZzzer 97b667f27c updates: nixpkgs, nixos-generators, home-manager, plasma-manager 2026-02-07 23:42:13 -08:00
CaZzzer 4d61ec4617 desktop: add zram config 2026-02-07 23:42:13 -08:00
CaZzzer 5697648ab1 desktop: enable nix-ld 2026-02-07 23:42:13 -08:00
CaZzzer 7a69f68683 updates: nixpkgs, home-manager, plasma-manager 2026-02-07 23:42:10 -08:00
18 changed files with 207 additions and 142 deletions
Generated
+37 -63
View File
@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"crane": { "crane": {
"locked": { "locked": {
"lastModified": 1754269165, "lastModified": 1781825982,
"narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=", "narHash": "sha256-SlXKwIRIhrOSAcTjCB3ftPLzJWZStQIPS7J1FlZPnKk=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "444e81206df3f7d92780680e45858e31d2f07a08", "rev": "469fd08d0bcf6926321fa973c6777fbc87785dd7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -18,45 +18,24 @@
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1747046372, "lastModified": 1767039857,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra", "owner": "NixOS",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "edolstra", "owner": "NixOS",
"repo": "flake-compat", "repo": "flake-compat",
"type": "github" "type": "github"
} }
}, },
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"lanzaboote",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754091436,
"narHash": "sha256-XKqDMN1/Qj1DKivQvscI4vmHfDfvYR2pfuFOJiCeewM=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "67df8c627c2c39c41dbec76a1f201929929ab0bd",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"lanzaboote", "lanzaboote",
"pre-commit-hooks-nix", "pre-commit",
"nixpkgs" "nixpkgs"
] ]
}, },
@@ -81,11 +60,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765480374, "lastModified": 1791642191,
"narHash": "sha256-HlbvQAqLx7WqZFFQZ8nu5UUJAVlXiV/kqKbyueA8srw=", "narHash": "sha256-0bK0A59rVUn1SRZzo4cNi4VSqAe7vR1gL2/MZl53Frw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "39cb677ed9e908e90478aa9fe5f3383dfc1a63f3", "rev": "c58f54c733a7894d84fa2fdff26cc12088c4b78c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -97,25 +76,23 @@
"lanzaboote": { "lanzaboote": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"pre-commit-hooks-nix": "pre-commit-hooks-nix", "pre-commit": "pre-commit",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1762205063, "lastModified": 1782141370,
"narHash": "sha256-If6vQ+KvtKs3ARBO9G3l+4wFSCYtRBrwX1z+I+B61wQ=", "narHash": "sha256-hqijVSEETttmo8Okql9/LG0Ua34hdciKW1a5zzlj8mU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "lanzaboote", "repo": "lanzaboote",
"rev": "88b8a563ff5704f4e8d8e5118fb911fa2110ca05", "rev": "7c9a54a7f87b4539ddbd8bda09a8a5f5f9361aa9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "v0.4.3", "ref": "v1.1.0",
"repo": "lanzaboote", "repo": "lanzaboote",
"type": "github" "type": "github"
} }
@@ -143,11 +120,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1764234087, "lastModified": 1769813415,
"narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=", "narHash": "sha256-nnVmNNKBi1YiBNPhKclNYDORoHkuKipoz7EtVnXO50A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "032a1878682fafe829edfcf5fdfad635a2efe748", "rev": "8946737ff703382fda7623b9fab071d037e897d5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -158,11 +135,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1765186076, "lastModified": 1791594108,
"narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=", "narHash": "sha256-XK4KceonkwD8LuMAt/vNrz982mXJM5jeHAxMwsUXXAQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8", "rev": "6510408d147d8c5e6d76043e899e9251756f6a75",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -182,11 +159,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763909441, "lastModified": 1785762349,
"narHash": "sha256-56LwV51TX/FhgX+5LCG6akQ5KrOWuKgcJa+eUsRMxsc=", "narHash": "sha256-jZhZkzAwc7f3exzcTDJWP2WCAchCv0iNC3UF/QsahdQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "plasma-manager", "repo": "plasma-manager",
"rev": "b24ed4b272256dfc1cc2291f89a9821d5f9e14b4", "rev": "a19a2a029fa180911bd89c554dca1616e10f4c1d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -195,12 +172,9 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks-nix": { "pre-commit": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": "flake-compat",
"lanzaboote",
"flake-compat"
],
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"lanzaboote", "lanzaboote",
@@ -208,11 +182,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1750779888, "lastModified": 1781733627,
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", "narHash": "sha256-U3yTuGBnmXvXoQI3qkpfEDsn9RovQPAjN7ndRco+3u0=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", "rev": "3bbec39bc90eadfa031e6f3b77272f3f60803e39",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -239,11 +213,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1761791894, "lastModified": 1782012058,
"narHash": "sha256-myRIDh+PxaREz+z9LzbqBJF+SnTFJwkthKDX9zMyddY=", "narHash": "sha256-9mWUnReOUXfKjZuJAL/bAFH3LUyECTRtXgSNVjRw3UY=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "59c45eb69d9222a4362673141e00ff77842cd219", "rev": "8534567325bd8a8d2928e6afd81e0a87d19efd3c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -259,11 +233,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763929380, "lastModified": 1787124737,
"narHash": "sha256-Yc7gZME/lcHoJH6bMPCG7CyjKWhOLJPqLI8MXtyKPHo=", "narHash": "sha256-EnQcFCdcQs1agb8U/h3kn7+A3c3uorANCPP2WakZjAk=",
"owner": "Platonic-Systems", "owner": "Platonic-Systems",
"repo": "secrix", "repo": "secrix",
"rev": "c6e3ca7af47c329dcf442a3d017ae171eee5612f", "rev": "9c0a7db4e355c28fe67643656821b06161b4df61",
"type": "github" "type": "github"
}, },
"original": { "original": {
+1 -1
View File
@@ -23,7 +23,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
lanzaboote = { lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.3"; url = "github:nix-community/lanzaboote/v1.1.0";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
+5 -5
View File
@@ -5,11 +5,11 @@
enable = true; enable = true;
shellInit = "set fish_greeting"; shellInit = "set fish_greeting";
shellAliases = { shellAliases = {
# Replace ls with exa # Replace ls with eza
ls = "exa -al --color=always --group-directories-first --icons"; # preferred listing ls = "eza -al --color=always --group-directories-first --icons=always"; # preferred listing
la = "exa -a --color=always --group-directories-first --icons"; # all files and dirs la = "eza -a --color=always --group-directories-first --icons=always"; # all files and dirs
ll = "exa -l --color=always --group-directories-first --icons"; # long format ll = "eza -l --color=always --group-directories-first --icons=always"; # long format
lt = "exa -aT --color=always --group-directories-first --icons"; # tree listing lt = "eza -aT --color=always --group-directories-first --icons=always"; # tree listing
"l." = "exa -a | rg '^\.'"; # show only dotfiles "l." = "exa -a | rg '^\.'"; # show only dotfiles
# Replace cat with bat # Replace cat with bat
+4
View File
@@ -31,6 +31,10 @@
intel-media-driver # LIBVA_DRIVER_NAME=iHD intel-media-driver # LIBVA_DRIVER_NAME=iHD
]; ];
environment.systemPackages = with pkgs; [
lmstudio
];
networking.hostName = "Yura-PC"; # Define your hostname. networking.hostName = "Yura-PC"; # Define your hostname.
networking.hostId = "110a2814"; # Required for ZFS. networking.hostId = "110a2814"; # Required for ZFS.
+41 -11
View File
@@ -7,12 +7,20 @@
"sysrq_always_enabled=1" "sysrq_always_enabled=1"
]; ];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_17; boot.kernelPackages = pkgs.linuxKernel.packages.linux_7_2;
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
timeout = 3; timeout = 3;
systemd-boot.enable = lib.mkDefault true; systemd-boot.enable = lib.mkDefault true;
}; };
boot.kernel.sysctl = {
# https://wiki.archlinux.org/title/Zram#Optimizing_swap_on_zram
"vm.swappiness" = 180;
"vm.watermark_boost_factor" = 0;
"vm.watermark_scale_factor" = 125;
"vm.page-cluster" = 0;
};
zramSwap.enable = true;
# https://nixos.wiki/wiki/Accelerated_Video_Playback # https://nixos.wiki/wiki/Accelerated_Video_Playback
hardware.graphics.enable = true; hardware.graphics.enable = true;
@@ -30,8 +38,7 @@
services.xserver.enable = false; services.xserver.enable = false;
# Enable the KDE Plasma Desktop Environment. # Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm.enable = true; services.displayManager.plasma-login-manager.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true; services.desktopManager.plasma6.enable = true;
# Enable CUPS to print documents. # Enable CUPS to print documents.
@@ -65,16 +72,16 @@
programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default
programs.bat.enable = true; programs.bat.enable = true;
programs.htop.enable = true; programs.htop.enable = true;
programs.nix-ld.enable = true;
# programs.steam.enable = true;
# https://nixos.wiki/wiki/Docker # https://nixos.wiki/wiki/Docker
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
virtualisation.docker.enableOnBoot = false; virtualisation.docker.enableOnBoot = false;
virtualisation.docker.package = pkgs.docker_28;
# https://github.com/flatpak/flatpak/issues/2861 # https://github.com/flatpak/flatpak/issues/2861
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
workarounds.flatpak.enable = true;
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
fantasque-sans-mono fantasque-sans-mono
nerd-fonts.fantasque-sans-mono nerd-fonts.fantasque-sans-mono
@@ -110,10 +117,10 @@
powertop powertop
rbw rbw
restic restic
resticprofile
rclone rclone
ripgrep-all ripgrep-all
rustscan rustscan
unrar
whois whois
wireguard-tools wireguard-tools
yt-dlp yt-dlp
@@ -133,22 +140,31 @@
]; ];
}) })
nextcloud-client nextcloud-client
# lutris
lxqt.pavucontrol-qt lxqt.pavucontrol-qt
pinentry-all pinentry-all
tela-circle-icon-theme tela-circle-icon-theme
typst
virt-viewer virt-viewer
waypipe waypipe
] ++ [ ] ++ [
# jetbrains.rust-rover # jetbrains.rust-rover
# jetbrains.goland # jetbrains.goland
jetbrains.clion jetbrains.clion
jetbrains.idea-ultimate # jetbrains.idea
jetbrains.pycharm-professional jetbrains.pycharm
jetbrains.webstorm jetbrains.webstorm
android-studio android-studio
rustup rustup
zed-editor zed-editor
package-version-server # for zed package-version-server # for zed
antigravity-cli
antigravity-ide-fhs
codex
# codex-acp
# github-copilot-cli
# opencode
# opencode-desktop
] ++ [ ] ++ [
# C # C
gcc gcc
@@ -159,27 +175,41 @@
poetry poetry
# Haskell # Haskell
cabal-install
haskell-language-server
# haskellPackages.hls-cabal-plugin
haskellPackages.ghc haskellPackages.ghc
haskellPackages.stack haskellPackages.stack
# Node # Node
nodejs_22 nodejs_24
pnpm pnpm
bun bun
# Nix # Nix
nil nil
nixd nixd
nixfmt-rfc-style nixfmt
# Gleam # Gleam
gleam gleam
beamMinimal26Packages.erlang beamMinimal28Packages.erlang
# Racket # Racket
racket racket
# Ruby # Ruby
ruby ruby
# Java
zulu
# spacetimedb
] ++ [
jujutsu
lazyjj
jjui
# jj-fzf
gg-jj
]; ];
} }
+2 -2
View File
@@ -14,12 +14,12 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f"; { device = "/dev/disk/by-uuid/0dec41bf-aba0-4b7b-9f61-bbb572e5bd1e";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/12CE-A600"; { device = "/dev/disk/by-uuid/9F5E-672F";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };
-1
View File
@@ -70,7 +70,6 @@
# https://github.com/flatpak/flatpak/issues/2861 # https://github.com/flatpak/flatpak/issues/2861
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
# workarounds.flatpak.enable = true;
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
noto-fonts-cjk-sans noto-fonts-cjk-sans
noto-fonts-cjk-serif noto-fonts-cjk-serif
-1
View File
@@ -1,6 +1,5 @@
{ ... }: { { ... }: {
imports = [ imports = [
./opts ./opts
./workarounds
]; ];
} }
+2 -1
View File
@@ -9,6 +9,7 @@ in
./opts.nix ./opts.nix
./ifconfig.nix ./ifconfig.nix
./wireguard.nix ./wireguard.nix
./tailscale.nix
./firewall.nix ./firewall.nix
./dns.nix ./dns.nix
./kea.nix ./kea.nix
@@ -27,7 +28,7 @@ in
boot.loader.timeout = 2; boot.loader.timeout = 2;
boot.loader.systemd-boot.configurationLimit = 5; boot.loader.systemd-boot.configurationLimit = 5;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12; boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_18;
boot.growPartition = true; boot.growPartition = true;
# Enable the X11 windowing system. # Enable the X11 windowing system.
+5 -5
View File
@@ -54,17 +54,17 @@ in
enable_dnssec = true; enable_dnssec = true;
bootstrap_dns = [ "1.1.1.1" "9.9.9.9" ]; bootstrap_dns = [ "1.1.1.1" "9.9.9.9" ];
upstream_dns = [ upstream_dns = [
# Default upstreams
"quic://p0.freedns.controld.com"
"tls://one.one.one.one"
"tls://dns.quad9.net"
# Adguard uses upstream and not rewrite rules to resolve cname rewrites, # Adguard uses upstream and not rewrite rules to resolve cname rewrites,
# and obviously my sysdomain entries don't exist in cloudflare. # and obviously my sysdomain entries don't exist in cloudflare.
"[/${sysdomain}/][::1]" # Sys domains to self (for cname rewrites) "[/${sysdomain}/][::1]" # Sys domains to self (for cname rewrites)
"[/${ldomain}/][::1]:1053" # Local domains to Knot (ddns) "[/${ldomain}/][::1]:1053" # Local domains to Knot (ddns)
"[/home/][${ifs.lan.ulaPrefix}::250]" # .home domains to opnsense (temporary) "[/home/][${ifs.lan.ulaPrefix}::250]" # .home domains to opnsense (temporary)
# Default upstreams
"quic://p0.freedns.controld.com"
"tls://one.one.one.one"
"tls://dns.quad9.net"
]; ];
}; };
# https://adguard-dns.io/kb/general/dns-filtering-syntax/ # https://adguard-dns.io/kb/general/dns-filtering-syntax/
+46 -1
View File
@@ -15,6 +15,11 @@ let
${ifs.lan50.name}, ${ifs.lan50.name},
${ifs.wg0.name}, ${ifs.wg0.name},
} }
# Tailscale is its own zone, since tailnet traffic is already filtered by tailscale ACLs
# and needs some special handling (exit node NAT with CGNAT/ULA addrs)
define ZONE_TAILSCALE_IFS = { ${ifs.ts0.name} }
define TAILSCALE_NET4 = ${ifs.ts0.net4}
define TAILSCALE_NET6 = ${ifs.ts0.net6}
define OPNSENSE_NET6 = ${vars.extra.opnsense.net6} define OPNSENSE_NET6 = ${vars.extra.opnsense.net6}
define ZONE_LAN_EXTRA_NET6 = { define ZONE_LAN_EXTRA_NET6 = {
# TODO: reevaluate this statement # TODO: reevaluate this statement
@@ -58,6 +63,7 @@ in
udp . 48425 : ${vars.extra.opnsense.addr4} . 48425, udp . 48425 : ${vars.extra.opnsense.addr4} . 48425,
# Amnezia VPN server # Amnezia VPN server
udp . 37138 : ${vars.extra.amnezia.addr4} . 37138, udp . 37138 : ${vars.extra.amnezia.addr4} . 37138,
tcp . 38247 : ${vars.extra.amnezia.addr4} . 22,
# Minecruft server # Minecruft server
tcp . 25565 : ${vars.extra.minecruft.addr4} . 25565, tcp . 25565 : ${vars.extra.minecruft.addr4} . 25565,
udp . 25565 : ${vars.extra.minecruft.addr4} . 25565, udp . 25565 : ${vars.extra.minecruft.addr4} . 25565,
@@ -79,6 +85,8 @@ in
# Masquerade LAN addrs # Masquerade LAN addrs
oifname $ZONE_WAN_IFS ip saddr $RFC1918 masquerade oifname $ZONE_WAN_IFS ip saddr $RFC1918 masquerade
# Masquerade tailnet addrs (tailscale exit node)
oifname $ZONE_WAN_IFS ip saddr $TAILSCALE_NET4 masquerade
} }
''; '';
}; };
@@ -96,12 +104,28 @@ in
''; '';
}; };
# IPv6 masquerading for tailnet addrs only (tailscale exit node)
# Tailscale only assigns ULAs from $TAILSCALE_NET6, so NAT is unavoidable here
networking.nftables.tables.nat6_tailscale = {
family = "ip6";
content = ''
${nftIdentifiers}
chain postrouting {
type nat hook postrouting priority srcnat; policy accept;
oifname $ZONE_WAN_IFS ip6 saddr $TAILSCALE_NET6 masquerade
}
'';
};
networking.nftables.tables.firewall = { networking.nftables.tables.firewall = {
family = "inet"; family = "inet";
content = '' content = ''
${nftIdentifiers} ${nftIdentifiers}
define ALLOWED_TCP_PORTS = { ssh } define ALLOWED_TCP_PORTS = { ssh }
define ALLOWED_UDP_PORTS = { ${toString vars.ifs.wg0.listenPort} } define ALLOWED_UDP_PORTS = {
${toString vars.ifs.wg0.listenPort},
${toString vars.ifs.ts0.listenPort}, # tailscale direct connections
}
define ALLOWED_TCP_LAN_PORTS = { ssh, https } define ALLOWED_TCP_LAN_PORTS = { ssh, https }
define ALLOWED_UDP_LAN_PORTS = { bootps, dhcpv6-server, domain, https } define ALLOWED_UDP_LAN_PORTS = { bootps, dhcpv6-server, domain, https }
set port_forward_v6 { set port_forward_v6 {
@@ -160,6 +184,8 @@ in
# iifname $ZONE_LAN_IFS accept # iifname $ZONE_LAN_IFS accept
iifname $ZONE_LAN_IFS jump zone_lan_input iifname $ZONE_LAN_IFS jump zone_lan_input
ip6 saddr $ZONE_LAN_EXTRA_NET6 jump zone_lan_input ip6 saddr $ZONE_LAN_EXTRA_NET6 jump zone_lan_input
# Tailscale zone input rules
iifname $ZONE_TAILSCALE_IFS jump zone_tailscale_input
# log # log
} }
@@ -175,6 +201,8 @@ in
# LAN zone forward rules # LAN zone forward rules
iifname $ZONE_LAN_IFS jump zone_lan_forward iifname $ZONE_LAN_IFS jump zone_lan_forward
ip6 saddr $ZONE_LAN_EXTRA_NET6 jump zone_lan_forward ip6 saddr $ZONE_LAN_EXTRA_NET6 jump zone_lan_forward
# Tailscale zone forward rules
iifname $ZONE_TAILSCALE_IFS jump zone_tailscale_forward
} }
chain zone_wan_input { chain zone_wan_input {
@@ -214,6 +242,23 @@ in
# Allow traffic between LANs # Allow traffic between LANs
oifname $ZONE_LAN_IFS accept oifname $ZONE_LAN_IFS accept
# Allow LAN to reach tailnet (no SNAT, tailnet peers see real LAN addrs)
oifname $ZONE_TAILSCALE_IFS accept
}
chain zone_tailscale_input {
# Tailnet access is restricted by tailscale ACLs, treat like LAN
jump zone_lan_input
}
chain zone_tailscale_forward {
# Subnet router: allow tailnet to LANs (advertised routes)
oifname $ZONE_LAN_IFS accept
# Exit node: allow tailnet to WAN (masqueraded in nat4 / nat6_tailscale)
oifname $ZONE_WAN_IFS ip saddr $TAILSCALE_NET4 accept
oifname $ZONE_WAN_IFS ip6 saddr $TAILSCALE_NET6 accept
} }
chain output { chain output {
+3
View File
@@ -52,6 +52,9 @@ in
# since my WAN and LAN20 are technically bridged. # since my WAN and LAN20 are technically bridged.
# https://networkengineering.stackexchange.com/questions/83071/why-linux-answers-arp-requests-for-ips-that-belong-to-different-network-interfac # https://networkengineering.stackexchange.com/questions/83071/why-linux-answers-arp-requests-for-ips-that-belong-to-different-network-interfac
boot.kernel.sysctl."net.ipv4.conf.default.arp_filter" = 1; boot.kernel.sysctl."net.ipv4.conf.default.arp_filter" = 1;
# Later I discovered that rp_filter might also be good to set
# Strict mode (1) drops packets if the src ip isn't a local route on the interface
boot.kernel.sysctl."net.ipv4.conf.default.rp_filter" = 1;
# It is impossible to do multiple prefix requests with networkd, # It is impossible to do multiple prefix requests with networkd,
# so I use dhcpcd for this # so I use dhcpcd for this
@@ -0,0 +1,5 @@
age-encryption.org/v1
-> ssh-ed25519 D2MY/A txjDSEsRr2CJtC9rDIiY9H8aX0us53vhnqJStt+XvlA
vjmrx5ByEhbHE/hBEQq3gRqY8b5/mjHLs+He3D/27LM
--- rp66vDf9qnM7f9S5YD/X/99YsufPWmvz+V8z8htB2Ow
9‡Ài¨*¡-oš·}Ć(Š5[¬[ÕyKr)¾-­cùäóŽù¼R0?Ë8`Èô×{
+4 -2
View File
@@ -29,10 +29,12 @@ in
}; };
# https://wiki.nixos.org/wiki/Grafana#Declarative_configuration # https://wiki.nixos.org/wiki/Grafana#Declarative_configuration
secrix.services.grafana.secrets.security-key.encrypted.file = ./secrets/grafana-secret-key.age;
services.grafana = { services.grafana = {
enable = true; enable = true;
settings = { settings = {
security.allow_embedding = true; security.allow_embedding = true;
security.secret_key = "$__file{${config.secrix.services.grafana.secrets.security-key.decrypted.path}}";
server = { server = {
http_port = 3001; http_port = 3001;
domain = "grouter.${domain}"; domain = "grouter.${domain}";
@@ -57,8 +59,8 @@ in
services.caddy = { services.caddy = {
enable = true; enable = true;
package = pkgs.caddy.withPlugins { package = pkgs.caddy.withPlugins {
plugins = [ "github.com/caddy-dns/cloudflare@v0.2.1" ]; plugins = [ "github.com/caddy-dns/cloudflare@v0.2.4" ];
hash = "sha256-Dvifm7rRwFfgXfcYvXcPDNlMaoxKd5h4mHEK6kJ+T4A="; hash = "sha256-xRJ5evsAJ2akg47j3Bt6YDXJOgX88B/rKNP50KSVyNY=";
}; };
virtualHosts."*.${domain}".extraConfig = '' virtualHosts."*.${domain}".extraConfig = ''
encode encode
+44
View File
@@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
let
vars = import ./vars.nix config;
ifs = vars.ifs;
ts0 = ifs.ts0;
# Subnets advertised to the tailnet (still need to be approved in the admin console)
advertisedRoutes = [
"${vars.p4}.0.0/16" # all LAN v4 subnets
"${vars.ulaPrefix}::/48" # all LAN ULA subnets
];
in
{
# One-time setup after deploying: `sudo tailscale up`
# (state is persisted in /var/lib/tailscale)
services.tailscale = {
enable = true;
port = ts0.listenPort;
interfaceName = ts0.name;
# Enables ip forwarding (already enabled globally by networkd anyway).
# Not using "both", since that sets rp_filter to loose on all interfaces.
useRoutingFeatures = "server";
# Firewall is managed manually in firewall.nix (networking.firewall is disabled)
openFirewall = false;
# Applied with `tailscale set` on every start, so these stay declarative
extraSetFlags = [
# Don't let tailscale touch nftables/iptables, all rules live in firewall.nix
"--netfilter-mode=off"
# Don't SNAT tailnet -> LAN traffic, LAN hosts route back via the router anyway
# (preserves real source addrs for logging/ACLs on LAN hosts)
"--snat-subnet-routes=false"
# The router is its own DNS server, don't let tailscale mess with resolv.conf
"--accept-dns=false"
"--advertise-routes=${lib.strings.concatStringsSep "," advertisedRoutes}"
"--advertise-exit-node"
];
};
# networkd removes "foreign" ip rules when it (re)starts, which would wipe tailscale's
# policy routing rules (table 52). This is extra important since networkd is
# restarted every minute (see ifconfig.nix).
# The nixpkgs tailscale module already marks tailscale0 as unmanaged in networkd.
systemd.network.config.networkConfig.ManageForeignRoutingPolicyRules = false;
}
+8
View File
@@ -111,6 +111,14 @@ rec {
} // { } // {
listenPort = 51944; listenPort = 51944;
}; };
# Tailscale addresses are assigned by the coordination server,
# these are the fixed ranges tailscale allocates node addrs from.
ts0 = {
name = "tailscale0";
listenPort = 41641;
net4 = "100.64.0.0/10";
net6 = "fd7a:115c:a1e0::/48";
};
}; };
extra = { extra = {
-5
View File
@@ -1,5 +0,0 @@
{
imports = [
./flatpak.nix
];
}
-44
View File
@@ -1,44 +0,0 @@
# https://github.com/knightpp/nixos-cfg/blob/main/modules/workarounds/flatpak.nix
{
pkgs,
config,
lib,
...
}: let
cfg = config.workarounds.flatpak;
in {
options = {
workarounds.flatpak = {
enable = lib.mkEnableOption "flatpak workaround";
};
};
config = lib.mkIf cfg.enable {
system.fsPackages = [pkgs.bindfs];
fileSystems = let
mkRoSymBind = path: {
device = path;
fsType = "fuse.bindfs";
options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
};
aggregated = pkgs.buildEnv {
name = "system-fonts-and-icons";
paths = builtins.attrValues {
inherit (pkgs.kdePackages) breeze;
inherit
(pkgs)
noto-fonts
noto-fonts-color-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
;
};
pathsToLink = ["/share/fonts" "/share/icons"];
};
in {
# Create an FHS mount to support flatpak host icons/fonts
"/usr/share/icons" = mkRoSymBind "${aggregated}/share/icons";
"/usr/share/fonts" = mkRoSymBind "${aggregated}/share/fonts";
};
};
}