Author SHA1 Message Date
CaZzzer a90801fd69 pre backup random bullshit 2026-11-11 10:24:21 -08:00
CaZzzer 3af9b024ef updates: nixpkgs, home-manager 2026-10-27 00:11:54 -07:00
CaZzzer 55a4591bf7 updates: nixpkgs, home-manager 2026-10-19 01:41:04 -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
CaZzzer a278a69f05 updates: nixpkgs, home-manager 2025-12-12 09:44:02 -08:00
CaZzzer 2de612bc4f updates: nixpkgs, home-manager, nixos-generators 2025-12-07 21:13:04 -08:00
CaZzzer 8593abc8a5 laptop: add lanboote for secure boot 2025-12-07 21:01:57 -08:00
CaZzzer 91727dd2df home: git: fix aliases 2025-12-06 16:46:18 -08:00
CaZzzer 4e08c64ce5 home: plasma: persist baloofile index excludes, highlight changed system settings 2025-12-06 16:46:17 -08:00
CaZzzer d61c23f8e7 laptop: disable fprint for login 2025-12-06 16:46:15 -08:00
CaZzzer 07d3706a14 router: dns: add n8n 2025-11-25 14:52:47 -08:00
CaZzzer 1f647856ab updates: nixpkgs, home-manager, plasma-manager, secrix 2025-11-25 00:50:43 -08:00
CaZzzer 05a20f830f updates: linux 6.17, nixpkgs, home-manager, plasma-manager 2025-11-25 00:49:51 -08:00
CaZzzer 35bb5e411e desktop: add jellyfin-mpv-shim and mpv with plugins 2025-11-20 22:29:34 -08:00
CaZzzer 5353ad048c desktop: add C and Ruby 2025-11-08 17:01:28 -08:00
CaZzzer 9bb5b596b7 router: dns: add minecruft 2025-11-08 17:00:21 -08:00
CaZzzer ce9bcb785a updates: nixpkgs, home-manager, plasma-manager 2025-10-11 16:03:29 -07:00
CaZzzer 178626a193 router: add port forward for minecruft server 2025-10-11 15:09:30 -07:00
CaZzzer 3074b81b45 router: add port forward for amnezia vpn 2025-10-11 15:09:15 -07:00
CaZzzer e7ebaf371b router: update cloudflare api key 2025-09-21 19:57:06 -07:00
CaZzzer bd44812337 updates: nixpkgs, home-manager, plasma-manager 2025-09-18 12:39:52 -07:00
CaZzzer d7ee1f6434 desktop: add zed package version server and racket 2025-09-18 12:39:51 -07:00
CaZzzer 8880ac8158 updates: linux 6.16, nixpkgs, home-manager 2025-09-18 12:39:45 -07:00
CaZzzer 57d47def99 desktop: disable tests in git package 2025-09-18 12:39:44 -07:00
CaZzzer 8762c5b555 updates: nixpkgs, home-manager, plasma-manager 2025-09-11 13:32:49 -07:00
CaZzzer eee8fd5ece updates: nixpkgs, home-manager, secrix 2025-07-30 14:28:21 -07:00
CaZzzer e09bca0feb desktop: add NetworkManager plugin for OpenVPN 2025-07-22 17:44:40 -07:00
CaZzzer f9b152cd52 updates: nixpkgs, home-manager, nixos-generators 2025-07-09 12:14:54 -07:00
CaZzzer 2de9229027 router: add caddy proxy to homeassistant vm 2025-06-25 00:31:44 -07:00
CaZzzer 00bc6f8de3 router: dns: add adguard exception for grafana telemetry domain 2025-06-25 00:30:36 -07:00
CaZzzer 21a058f5ea router: refactor caddy config to use wildcard cert 2025-06-25 00:28:09 -07:00
CaZzzer 574ba8a951 pc: move nix store to separate zfs dataset 2025-06-24 00:00:09 -07:00
CaZzzer 15dc8dd7c4 updates: nixpkgs, home-manager 2025-06-22 22:38:19 -07:00
CaZzzer 2bd88d7a93 users: cazzzer: add dialout group for microcontroller stuff 2025-06-09 19:23:07 -07:00
CaZzzer 5ec716919d router: add host configurations for test routers 2025-06-09 19:20:01 -07:00
CaZzzer 47c9cff8f5 router: move most configuration into modules with options 2025-06-09 19:19:54 -07:00
37 changed files with 753 additions and 233 deletions

No files matched your search

Generated
+137 -15
View File
@@ -1,5 +1,58 @@
{ {
"nodes": { "nodes": {
"crane": {
"locked": {
"lastModified": 1781825982,
"narHash": "sha256-SlXKwIRIhrOSAcTjCB3ftPLzJWZStQIPS7J1FlZPnKk=",
"owner": "ipetkov",
"repo": "crane",
"rev": "469fd08d0bcf6926321fa973c6777fbc87785dd7",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "NixOS",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"lanzaboote",
"pre-commit",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -7,11 +60,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749178927, "lastModified": 1793033486,
"narHash": "sha256-bXcEx1aZUNm5hMLVJeuofcOrZyOiapzvQ7K36HYK3YQ=", "narHash": "sha256-fXVURa0+CSCgaxLt8tmPNJq2U+fGYOwbk5j2YUe7kSc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "91287a0e9d42570754487b7e38c6697e15a9aab2", "rev": "7db163b2aee7e410e396b48aed02f646d742b9b8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -20,6 +73,30 @@
"type": "github" "type": "github"
} }
}, },
"lanzaboote": {
"inputs": {
"crane": "crane",
"nixpkgs": [
"nixpkgs"
],
"pre-commit": "pre-commit",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1782141370,
"narHash": "sha256-hqijVSEETttmo8Okql9/LG0Ua34hdciKW1a5zzlj8mU=",
"owner": "nix-community",
"repo": "lanzaboote",
"rev": "7c9a54a7f87b4539ddbd8bda09a8a5f5f9361aa9",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v1.1.0",
"repo": "lanzaboote",
"type": "github"
}
},
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1736643958, "lastModified": 1736643958,
@@ -43,11 +120,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747663185, "lastModified": 1769813415,
"narHash": "sha256-Obh50J+O9jhUM/FgXtI3he/QRNiV9+J53+l+RlKSaAk=", "narHash": "sha256-nnVmNNKBi1YiBNPhKclNYDORoHkuKipoz7EtVnXO50A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "ee07ba0d36c38e9915c55d2ac5a8fb0f05f2afcc", "rev": "8946737ff703382fda7623b9fab071d037e897d5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -58,11 +135,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1748929857, "lastModified": 1792773339,
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=", "narHash": "sha256-rZLrzrC6i+jnTAlvPZHogKDulY7WWDEv9hJeHieO7Zw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4", "rev": "3ec636362e1816bc2f0888fa0fa2c69f1bc9e504",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -82,11 +159,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748196248, "lastModified": 1785762349,
"narHash": "sha256-1iHjsH6/5UOerJEoZKE+Gx1BgAoge/YcnUsOA4wQ/BU=", "narHash": "sha256-jZhZkzAwc7f3exzcTDJWP2WCAchCv0iNC3UF/QsahdQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "plasma-manager", "repo": "plasma-manager",
"rev": "b7697abe89967839b273a863a3805345ea54ab56", "rev": "a19a2a029fa180911bd89c554dca1616e10f4c1d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -95,15 +172,60 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"lanzaboote",
"nixpkgs"
]
},
"locked": {
"lastModified": 1781733627,
"narHash": "sha256-U3yTuGBnmXvXoQI3qkpfEDsn9RovQPAjN7ndRco+3u0=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "3bbec39bc90eadfa031e6f3b77272f3f60803e39",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"secrix": "secrix" "secrix": "secrix"
} }
}, },
"rust-overlay": {
"inputs": {
"nixpkgs": [
"lanzaboote",
"nixpkgs"
]
},
"locked": {
"lastModified": 1782012058,
"narHash": "sha256-9mWUnReOUXfKjZuJAL/bAFH3LUyECTRtXgSNVjRw3UY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "8534567325bd8a8d2928e6afd81e0a87d19efd3c",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"secrix": { "secrix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -111,11 +233,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1746643487, "lastModified": 1787124737,
"narHash": "sha256-dcB/DArJObCvqE/ZEdQSDW2BZMeDyF83Se5KPfJvz60=", "narHash": "sha256-EnQcFCdcQs1agb8U/h3kn7+A3c3uorANCPP2WakZjAk=",
"owner": "Platonic-Systems", "owner": "Platonic-Systems",
"repo": "secrix", "repo": "secrix",
"rev": "4c64203fa5b377953b1fb6d5388187df8b60c6d5", "rev": "9c0a7db4e355c28fe67643656821b06161b4df61",
"type": "github" "type": "github"
}, },
"original": { "original": {
+23 -13
View File
@@ -22,21 +22,38 @@
url = "github:Platonic-Systems/secrix"; url = "github:Platonic-Systems/secrix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
lanzaboote = {
url = "github:nix-community/lanzaboote/v1.1.0";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, home-manager, plasma-manager, nixos-generators, secrix }: outputs = { self, nixpkgs, home-manager, plasma-manager, nixos-generators, secrix, lanzaboote }:
let let
hmModule = file: { hmModule = file: {
imports = [ home-manager.nixosModules.home-manager ]; imports = [ home-manager.nixosModules.home-manager ];
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; home-manager.sharedModules = [ plasma-manager.homeModules.plasma-manager ];
home-manager.users.cazzzer = import file; home-manager.users.cazzzer = import file;
# Optionally, use home-manager.extraSpecialArgs to pass # Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix # arguments to home.nix
}; };
mkRouter = hostFile: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
secrix.nixosModules.default
./modules
./modules/router
./hosts/common.nix
hostFile
./users/cazzzer
(hmModule ./home/common.nix)
];
};
in in
{ {
apps.x86_64-linux.secrix = secrix.secrix self; apps.x86_64-linux.secrix = secrix.secrix self;
@@ -57,6 +74,7 @@
Yura-TPX13 = nixpkgs.lib.nixosSystem { Yura-TPX13 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
lanzaboote.nixosModules.lanzaboote
./modules ./modules
./hosts/common.nix ./hosts/common.nix
./hosts/common-desktop.nix ./hosts/common-desktop.nix
@@ -77,17 +95,9 @@
(hmModule ./home/cazzzer-pc.nix) (hmModule ./home/cazzzer-pc.nix)
]; ];
}; };
router = nixpkgs.lib.nixosSystem { router = mkRouter ./hosts/router;
system = "x86_64-linux"; router-1 = mkRouter ./hosts/router-1;
modules = [ router-2 = mkRouter ./hosts/router-2;
secrix.nixosModules.default
./modules
./hosts/common.nix
./hosts/router
./users/cazzzer
(hmModule ./home/common.nix)
];
};
}; };
# https://github.com/nix-community/nixos-generators?tab=readme-ov-file#using-in-a-flake # https://github.com/nix-community/nixos-generators?tab=readme-ov-file#using-in-a-flake
packages.x86_64-linux = { packages.x86_64-linux = {
+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
+7 -5
View File
@@ -8,21 +8,23 @@ in
programs.git = { programs.git = {
enable = true; enable = true;
userName = name;
userEmail = email;
signing = { signing = {
key = signingKey; key = signingKey;
signByDefault = true; signByDefault = true;
format = "ssh"; format = "ssh";
}; };
aliases = { settings = {
user = {
name = name;
email = email;
};
alias = {
co = "checkout"; co = "checkout";
s = "switch"; s = "switch";
}; };
extraConfig = {
url = { url = {
"https://gitea.cazzzer.com/" = { "https://gitea.cazzzer.com/" = {
insteadOf = "caztea:"; insteadOf = "caztea:";
+2
View File
@@ -55,6 +55,8 @@
activities-icons."809dc779-bf5b-49e6-8e3f-cbe283cb05b6" = "keyboard"; activities-icons."809dc779-bf5b-49e6-8e3f-cbe283cb05b6" = "keyboard";
activities-icons."b34a506d-ac4f-4797-8c08-6ef45bc49341" = "preferences-desktop-gaming"; activities-icons."b34a506d-ac4f-4797-8c08-6ef45bc49341" = "preferences-desktop-gaming";
}; };
baloofilerc.General."exclude folders".persistent = true;
systemsettingsrc.systemsettings_sidebar_mode.HighlightNonDefaultSettings=true;
}; };
}; };
+14
View File
@@ -29,6 +29,20 @@
# https://nixos.wiki/wiki/Accelerated_Video_Playback # https://nixos.wiki/wiki/Accelerated_Video_Playback
hardware.graphics.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD intel-media-driver # LIBVA_DRIVER_NAME=iHD
vpl-gpu-rt
];
environment.systemPackages = with pkgs; [
lmstudio
unsloth-desktop
];
services.ollama.enable = true;
services.ollama.package = pkgs.ollama-vulkan;
programs.obs-studio.enable = true;
programs.obs-studio.plugins = with pkgs.obs-studio-plugins; [
obs-vaapi
]; ];
networking.hostName = "Yura-PC"; # Define your hostname. networking.hostName = "Yura-PC"; # Define your hostname.
+5
View File
@@ -18,6 +18,11 @@
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/nix" =
{ device = "zroot/data/nix";
fsType = "zfs";
};
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/970C-6A15"; { device = "/dev/disk/by-uuid/970C-6A15";
fsType = "vfat"; fsType = "vfat";
+8
View File
@@ -11,10 +11,18 @@
"sysrq_always_enabled=1" "sysrq_always_enabled=1"
]; ];
boot.loader.systemd-boot.enable = false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/var/lib/sbctl";
};
networking.hostName = "Yura-TPX13"; # Define your hostname. networking.hostName = "Yura-TPX13"; # Define your hostname.
networking.hostId = "8425e349"; # Required for ZFS. networking.hostId = "8425e349"; # Required for ZFS.
services.fprintd.enable = true; services.fprintd.enable = true;
security.pam.services.login.fprintAuth = false;
# Install firefox. # Install firefox.
programs.firefox.enable = true; programs.firefox.enable = true;
+71 -18
View File
@@ -7,15 +7,20 @@
"sysrq_always_enabled=1" "sysrq_always_enabled=1"
]; ];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_14; boot.kernelPackages = pkgs.linuxKernel.packages.linux_7_2;
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
timeout = 3; timeout = 3;
systemd-boot = { systemd-boot.enable = lib.mkDefault true;
enable = true;
configurationLimit = 5;
}; };
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;
@@ -24,14 +29,16 @@
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.networkmanager.plugins = [
pkgs.networkmanager-openvpn
];
# Enable the X11 windowing system. # Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session. # You can disable this if you're only using the Wayland session.
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.
@@ -58,28 +65,32 @@
programs.git.enable = true; programs.git.enable = true;
programs.git.lfs.enable = true; programs.git.lfs.enable = true;
# https://nixos.wiki/wiki/Git # https://nixos.wiki/wiki/Git
programs.git.package = pkgs.git.override { withLibsecret = true; }; programs.git.package = pkgs.git.override { withLibsecret = true; doInstallCheck = false; };
programs.lazygit.enable = true; programs.lazygit.enable = true;
programs.neovim.enable = true; programs.neovim.enable = true;
programs.wireshark.enable = true; programs.wireshark.enable = true;
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.nix-ld.libraries = with pkgs; [
stdenv.cc.cc.lib
# Add other common libraries if needed (e.g., zlib, glib)
];
# 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
noto-fonts noto-fonts
noto-fonts-emoji noto-fonts-color-emoji
noto-fonts-cjk-sans noto-fonts-cjk-sans
noto-fonts-cjk-serif noto-fonts-cjk-serif
jetbrains-mono jetbrains-mono
@@ -107,12 +118,13 @@
jq jq
ldns ldns
mediainfo mediainfo
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
@@ -120,48 +132,89 @@
bitwarden-desktop bitwarden-desktop
darkman darkman
host-spawn # for flatpaks host-spawn # for flatpaks
jellyfin-mpv-shim
kdePackages.filelight kdePackages.filelight
kdePackages.flatpak-kcm kdePackages.flatpak-kcm
kdePackages.kate kdePackages.kate
kdePackages.yakuake kdePackages.yakuake
mpv mission-center
(mpv.override {
scripts = with pkgs.mpvScripts; [
mpris
videoclip
];
})
nextcloud-client nextcloud-client
# lutris
lxqt.pavucontrol-qt lxqt.pavucontrol-qt
pinentry 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
antigravity-cli
antigravity-ide-fhs
codex
# codex-acp
# github-copilot-cli
opencode
# opencode-desktop
] ++ [ ] ++ [
# C
gcc
valgrind
# Python # Python
python3 python3
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
# Ruby
ruby
# Java
zulu
# spacetimedb
] ++ [
jujutsu
lazyjj
jjui
# jj-fzf
gg-jj
]; ];
} }
+24
View File
@@ -0,0 +1,24 @@
{
imports = [
../hw-vm.nix
];
router = {
enableDesktop = false;
enableDhcpClient = false;
wanMAC = "bc:24:11:af:bd:84";
lanMAC = "bc:24:11:38:b1:91";
wanLL = "fe80::be24:11ff:feaf:bd84";
lanLL = "fe80::be24:11ff:fe38:b191";
defaultToken = 251;
pdFromWan = "fd46:fbbe:ca55:100";
wanAddr4 = "192.168.1.63";
wanGw4 = "192.168.1.254";
};
networking.hostName = "grouty";
# override hw-vm.nix default
networking.useDHCP = false;
}
+24
View File
@@ -0,0 +1,24 @@
{
imports = [
../hw-vm.nix
];
router = {
enableDesktop = false;
enableDhcpClient = false;
wanMAC = "bc:24:11:bc:db:c1";
lanMAC = "bc:24:11:19:2a:96";
wanLL = "fe80::be24:11ff:febc:dbc1";
lanLL = "fe80::be24:11ff:fe19:2a96";
defaultToken = 252;
pdFromWan = "fd46:fbbe:ca55:100";
wanAddr4 = "192.168.1.64";
wanGw4 = "192.168.1.254";
};
networking.hostName = "grouta";
# override hw-vm.nix default
networking.useDHCP = false;
}
+11 -86
View File
@@ -1,93 +1,18 @@
{ config, lib, pkgs, ... }:
let
vars = import ./vars.nix;
enableDesktop = true;
in
{ {
imports = imports = [
[ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./ifconfig.nix ./private.nix
./wireguard.nix
./firewall.nix
./dns.nix
./kea.nix
./glance.nix
./services.nix
];
# Secrix for secrets management
secrix.hostPubKey = vars.pubkey;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
boot.kernelParams = [
"sysrq_always_enabled=1"
]; ];
boot.loader.timeout = 2; router = {
boot.loader.systemd-boot.configurationLimit = 5; enableDesktop = false;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12; enableDhcpClient = true;
boot.growPartition = true; wanMAC = "bc:24:11:4f:c9:c4";
lanMAC = "bc:24:11:83:d8:de";
wanLL = "fe80::be24:11ff:fe4f:c9c4";
lanLL = "fe80::be24:11ff:fe83:d8de";
defaultToken = 1;
};
networking.hostName = "grouter"; networking.hostName = "grouter";
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
# Enable the KDE Plasma Desktop Environment.
# Useful for debugging with wireshark.
hardware.graphics.enable = true;
services.xserver.desktopManager.xfce.enable = enableDesktop;
services.xserver.desktopManager.xfce.enableWaylandSession = enableDesktop;
# services.displayManager.sddm.enable = enableDesktop;
# services.displayManager.sddm.wayland.enable = enableDesktop;
# services.desktopManager.plasma6.enable = enableDesktop;
# No need for audio in VM
services.pipewire.enable = false;
# VM services
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
security.sudo.wheelNeedsPassword = false;
programs.firefox.enable = true;
programs.fish.enable = true;
programs.git.enable = true;
programs.neovim.enable = true;
programs.bat.enable = true;
programs.htop.enable = true;
programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default
environment.systemPackages = with pkgs; [
dust
eza
fastfetch
fd
kdePackages.kate
ldns
lsof
micro
mpv
openssl
ripgrep
rustscan
starship
tealdeer
transcrypt
waypipe
whois
wireguard-tools
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
} }
+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" ];
}; };
+3 -3
View File
@@ -1,3 +1,3 @@
U2FsdGVkX1/MGwxIMmhbZuPqJUZzex9v5tTuiOrEvDVldI7xY0edUy9Ii5udFLXt U2FsdGVkX1+eMFkQxarJDGLkX0zXyMRPukeRNvzd/BJ0XDAUZ2EeZvQnZw8U53Xz
AbxShsH43FH1ucgygKDlKTB/yXZWDoDVhjdgLFjaBtAt0xyAL9Doet844oDVhbbO W97X4rvT+K/NQ7FVCYfOg1XpQhzlSiC9z1M4WLmPRutUgsDY5n5RFJu2R8K5DAfi
FqOwXHMd+PE23rgqiCscsA== sAPcxiQUGVKrmDUva16yNqoR2Dkx2XE9iW1hpkfGFYVUK+QKIBkUEowQQlJJ1Wg1
-5
View File
@@ -1,5 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 D2MY/A Kj69kavxx+ATNHP5pX0JtGggU76f9uRwkZp2HbjwiWc
SbU3jIcQzUzaQjRHzVSoW1WKiUj+1ijbkUKqVb406fY
--- vMV0TcchFvxw1xetQQZ0xVi2KwjLFRfZBM1gl7BGbGI
Âä1�£ÃéKò<¯␍–fNGL½ÍÉ­ ¶ Ké5c‰é�uǶ6Ï-�¢,!H'¹Ð¦Î™4Y»‹c ]<%”ßÞ˜Î;B¹ÛÎnŒRb— �Œ
-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
]; ];
} }
+1 -1
View File
@@ -45,7 +45,7 @@ in {
enable = true; enable = true;
type = "fcitx5"; type = "fcitx5";
fcitx5.waylandFrontend = true; fcitx5.waylandFrontend = true;
fcitx5.plasma6Support = true; # fcitx5.plasma6Support = true;
fcitx5.addons = [ pkgs.fcitx5-mozc ]; fcitx5.addons = [ pkgs.fcitx5-mozc ];
}; };
}; };
+92
View File
@@ -0,0 +1,92 @@
{ config, lib, pkgs, ... }:
let
vars = import ./vars.nix config;
enableDesktop = config.router.enableDesktop;
in
{
imports =
[ # Include the results of the hardware scan.
./opts.nix
./ifconfig.nix
./wireguard.nix
./firewall.nix
./dns.nix
./kea.nix
./glance.nix
./services.nix
];
# Secrix for secrets management
secrix.hostPubKey = vars.pubkey;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
boot.kernelParams = [
"sysrq_always_enabled=1"
];
boot.loader.timeout = 2;
boot.loader.systemd-boot.configurationLimit = 5;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_18;
boot.growPartition = true;
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
# Enable the KDE Plasma Desktop Environment.
# Useful for debugging with wireshark.
hardware.graphics.enable = true;
services.xserver.desktopManager.xfce.enable = enableDesktop;
services.xserver.desktopManager.xfce.enableWaylandSession = enableDesktop;
# services.displayManager.sddm.enable = enableDesktop;
# services.displayManager.sddm.wayland.enable = enableDesktop;
# services.desktopManager.plasma6.enable = enableDesktop;
# No need for audio in VM
services.pipewire.enable = false;
# VM services
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
security.sudo.wheelNeedsPassword = false;
programs.firefox.enable = true;
programs.fish.enable = true;
programs.git.enable = true;
programs.neovim.enable = true;
programs.bat.enable = true;
programs.htop.enable = true;
programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default
environment.systemPackages = with pkgs; [
dust
eza
fastfetch
fd
kdePackages.kate
ldns
lsof
micro
mpv
openssl
ripgrep
rustscan
starship
tealdeer
transcrypt
wakeonlan
waypipe
whois
wireguard-tools
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
}
@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
vars = import ./vars.nix; vars = import ./vars.nix config;
domain = vars.domain; domain = vars.domain;
ldomain = vars.ldomain; ldomain = vars.ldomain;
sysdomain = vars.sysdomain; sysdomain = vars.sysdomain;
@@ -28,6 +28,8 @@ let
"|woodpecker." "|woodpecker."
"||pgrok." "||pgrok."
"|sync." "|sync."
"|minecruft."
"|n8n."
]; ];
in in
{ {
@@ -52,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/
@@ -80,11 +82,14 @@ in
"|etappi.${sysdomain}^$dnsrewrite=${ifs.lan.p4}.12" "|etappi.${sysdomain}^$dnsrewrite=${ifs.lan.p4}.12"
"|etappi.${sysdomain}^$dnsrewrite=${ifs.lan.ulaPrefix}::12:1" "|etappi.${sysdomain}^$dnsrewrite=${ifs.lan.ulaPrefix}::12:1"
"|hass.${domain}^$dnsrewrite=${ifs.lan.ulaAddr}"
# Lab DNS rewrites # Lab DNS rewrites
"||lab.${domain}^$dnsrewrite=etappi.${sysdomain}" "||lab.${domain}^$dnsrewrite=etappi.${sysdomain}"
# Allowed exceptions # Allowed exceptions
"@@||googleads.g.doubleclick.net" "@@||googleads.g.doubleclick.net"
"@@||stats.grafana.org"
] ]
# Alpina DNS rewrites # Alpina DNS rewrites
++ map (host: "${host}${domain}^$dnsrewrite=debbi.${sysdomain}") alpinaDomains; ++ map (host: "${host}${domain}^$dnsrewrite=debbi.${sysdomain}") alpinaDomains;
@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
vars = import ./vars.nix; vars = import ./vars.nix config;
links = vars.links; links = vars.links;
ifs = vars.ifs; ifs = vars.ifs;
pdFromWan = vars.pdFromWan; pdFromWan = vars.pdFromWan;
@@ -56,6 +56,13 @@ in
udp . 45608 : ${vars.extra.opnsense.addr4} . 45608, udp . 45608 : ${vars.extra.opnsense.addr4} . 45608,
udp . 35848 : ${vars.extra.opnsense.addr4} . 35848, udp . 35848 : ${vars.extra.opnsense.addr4} . 35848,
udp . 48425 : ${vars.extra.opnsense.addr4} . 48425, udp . 48425 : ${vars.extra.opnsense.addr4} . 48425,
# Amnezia VPN server
udp . 37138 : ${vars.extra.amnezia.addr4} . 37138,
tcp . 38247 : ${vars.extra.amnezia.addr4} . 22,
# Minecruft server
tcp . 25565 : ${vars.extra.minecruft.addr4} . 25565,
udp . 25565 : ${vars.extra.minecruft.addr4} . 25565,
udp . 24454 : ${vars.extra.minecruft.addr4} . 24454,
} }
} }
@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
vars = import ./vars.nix; vars = import ./vars.nix config;
domain = vars.domain; domain = vars.domain;
in in
{ {
@@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
vars = import ./vars.nix; cfg = config.router;
vars = import ./vars.nix config;
links = vars.links; links = vars.links;
ifs = vars.ifs; ifs = vars.ifs;
pdFromWan = vars.pdFromWan; pdFromWan = vars.pdFromWan;
@@ -51,13 +52,16 @@ 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
# https://github.com/systemd/systemd/issues/22571 # https://github.com/systemd/systemd/issues/22571
# https://github.com/systemd/systemd/issues/22571#issuecomment-2094905496 # https://github.com/systemd/systemd/issues/22571#issuecomment-2094905496
# https://gist.github.com/csamsel/0f8cca3b2e64d7e4cc47819ec5ba9396 # https://gist.github.com/csamsel/0f8cca3b2e64d7e4cc47819ec5ba9396
networking.dhcpcd.enable = true; networking.dhcpcd.enable = cfg.enableDhcpClient;
networking.dhcpcd.allowInterfaces = [ ifs.wan.name ]; networking.dhcpcd.allowInterfaces = [ ifs.wan.name ];
networking.dhcpcd.extraConfig = '' networking.dhcpcd.extraConfig = ''
debug debug
@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
vars = import ./vars.nix; vars = import ./vars.nix config;
ldomain = vars.ldomain; ldomain = vars.ldomain;
ifs = vars.ifs; ifs = vars.ifs;
+69
View File
@@ -0,0 +1,69 @@
{ lib, config, ... }:
with lib;
{
options = {
router = {
enableDesktop = mkOption {
type = types.bool;
default = false;
description = "Enable desktop environment for debugging";
};
enableDhcpClient = mkOption {
type = types.bool;
default = false;
description = "Enable DHCP client (should only be set on the main router)";
};
wanMAC = mkOption {
type = types.str;
example = "bc:24:11:4f:c9:c4";
description = "WAN interface MAC address";
};
lanMAC = mkOption {
type = types.str;
example = "bc:24:11:83:d8:de";
description = "LAN interface MAC address";
};
wanLL = mkOption {
type = types.str;
example = "fe80::be24:11ff:fe4f:c9c4";
description = "WAN IPv6 link-local address";
};
lanLL = mkOption {
type = types.str;
example = "fe80::be24:11ff:fe83:d8de";
description = "LAN IPv6 link-local address";
};
defaultToken = mkOption {
type = types.int;
default = 1;
description = "Default token for interface addressing";
};
wanAddr4 = mkOption {
type = types.str;
example = "192.168.1.61";
description = "WAN IPv4 address";
};
wanGw4 = mkOption {
type = types.str;
example = "192.168.1.254";
description = "WAN IPv4 gateway";
};
pdFromWan = mkOption {
type = types.str;
example = "2001:db8:0:000";
description = "IPv6 prefix delegation from ISP (/60)";
};
};
};
}
Binary file not shown.
@@ -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`Èô×{
@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
vars = import ./vars.nix; vars = import ./vars.nix config;
domain = vars.domain; domain = vars.domain;
in in
{ {
@@ -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,15 +59,18 @@ 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-Gsuo+ripJSgKSYOM9/yl6Kt/6BFCA6BuTDvPdteinAI="; hash = "sha256-xRJ5evsAJ2akg47j3Bt6YDXJOgX88B/rKNP50KSVyNY=";
}; };
virtualHosts."grouter.${domain}".extraConfig = '' virtualHosts."*.${domain}".extraConfig = ''
encode encode
tls { tls {
dns cloudflare {env.CF_API_KEY} dns cloudflare {env.CF_API_KEY}
resolvers 1.1.1.1 resolvers 1.1.1.1
} }
@grouter host grouter.${domain}
handle @grouter {
@grafana path /grafana /grafana/* @grafana path /grafana /grafana/*
handle @grafana { handle @grafana {
reverse_proxy localhost:${toString config.services.grafana.settings.server.http_port} reverse_proxy localhost:${toString config.services.grafana.settings.server.http_port}
@@ -80,6 +85,12 @@ in
handle /* { handle /* {
reverse_proxy localhost:${toString config.services.glance.settings.server.port} reverse_proxy localhost:${toString config.services.glance.settings.server.port}
} }
}
@hass host hass.${domain}
handle @hass {
reverse_proxy homeassistant.4.lab.l.cazzzer.com:8123
}
''; '';
}; };
} }
@@ -1,6 +1,6 @@
config:
let let
private = import ./private.nix; cfg = config.router;
mkIfConfig = { mkIfConfig = {
name_, name_,
domain_, domain_,
@@ -10,7 +10,7 @@ let
p6Size_ ? 64, p6Size_ ? 64,
ulaPrefix_, # /64 ulaPrefix_, # /64
ulaSize_ ? 64, ulaSize_ ? 64,
token? 1, token? cfg.defaultToken,
ip6Token_? "::${toString token}", ip6Token_? "::${toString token}",
ulaToken_? "::${toString token}", ulaToken_? "::${toString token}",
}: rec { }: rec {
@@ -41,21 +41,21 @@ rec {
ldomain = "l.${domain}"; ldomain = "l.${domain}";
sysdomain = "sys.${domain}"; sysdomain = "sys.${domain}";
links = { links = {
wanMAC = "bc:24:11:4f:c9:c4"; wanMAC = cfg.wanMAC;
lanMAC = "bc:24:11:83:d8:de"; lanMAC = cfg.lanMAC;
wanLL = "fe80::be24:11ff:fe4f:c9c4"; wanLL = cfg.wanLL;
lanLL = "fe80::be24:11ff:fe83:d8de"; lanLL = cfg.lanLL;
}; };
p4 = "10.17"; # .0.0/16 p4 = "10.17"; # .0.0/16
pdFromWan = private.pdFromWan; # ::/60 pdFromWan = cfg.pdFromWan; # ::/60
ulaPrefix = "fdab:07d3:581d"; # ::/48 ulaPrefix = "fdab:07d3:581d"; # ::/48
ifs = rec { ifs = rec {
wan = rec { wan = rec {
name = "wan"; name = "wan";
addr4 = private.wanAddr4; addr4 = cfg.wanAddr4;
addr4Sized = "${addr4}/23"; addr4Sized = "${addr4}/24";
gw4 = private.wanGw4; gw4 = cfg.wanGw4;
}; };
lan = mkIfConfig { lan = mkIfConfig {
name_ = "lan"; name_ = "lan";
@@ -77,7 +77,7 @@ rec {
p4_ = "${p4}.20"; # .0/24 p4_ = "${p4}.20"; # .0/24
p6_ = "${pdFromWan}0"; # ::/64 managed by Att box p6_ = "${pdFromWan}0"; # ::/64 managed by Att box
ulaPrefix_ = "${ulaPrefix}:0020"; # ::/64 ulaPrefix_ = "${ulaPrefix}:0020"; # ::/64
ip6Token_ = "::1:1"; # override ipv6 for lan20, since the Att box uses ::1 here ip6Token_ = "::1:${toString cfg.defaultToken}"; # override ipv6 for lan20, since the Att box uses ::1 here
}; };
lan30 = mkIfConfig { lan30 = mkIfConfig {
name_ = "${lan.name}.30"; name_ = "${lan.name}.30";
@@ -135,5 +135,7 @@ rec {
} }
]; ];
}; };
amnezia.addr4 = "${ifs.lan10.p4}.31";
minecruft.addr4 = "${ifs.lan.p4}.11";
}; };
} }
@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
vars = import ./vars.nix; vars = import ./vars.nix config;
wg0 = vars.ifs.wg0; wg0 = vars.ifs.wg0;
peerIps = ifObj: token: [ peerIps = ifObj: token: [
-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-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";
};
};
}
+192
View File
@@ -0,0 +1,192 @@
---
name: run-workflow
description: 'How to write and run a dynamic workflow script with the `run_workflow` tool: a Python script that orchestrates many agents with `agent`, `parallel`, `pipeline`, and `phase`. Use when a task splits into many independent or staged pieces of agent work (fan out over files, modules, bugs, or review angles, then aggregate), or when the user asks for a workflow. Don''t use for a single delegated task (use a subagent) or for legacy workflow files (see migrate-workflows).'
metadata:
namespace: system
---
# Dynamic workflows with `run_workflow`
A workflow is a short Python script that the `run_workflow` tool executes. The
script decides which agents to start, in what order, and what to do with their
results. Use it instead of many manual subagent calls when the orchestration
itself is code: loops over a list, fan-out then aggregate, or staged pipelines.
## Steps
1. Pass the script inline as `Script`, or write it to a file (for example in
the conversation scratch directory) and pass its absolute path as
`ScriptPath`. Set exactly one of them; a file is easier to fix and rerun.
2. Call `run_workflow(Script="...", Description="...")` or
`run_workflow(ScriptPath="/abs/path/workflow.py", Description="...")`.
`Description` is a one-line goal shown in the UI.
The workflow runs in the background, and you are notified when it ends.
For a quick script, such as a `call_tool` fan-out, set
`WaitMsBeforeAsync` (up to 10000) to get the result in the same turn if it
finishes in time.
To pass inputs, set `Args` to a JSON object; the script reads it as the
`args` dict. When `ScriptPath` is a saved workflow's entry script, `Args`
is validated against the args schema in its `workflow.json`.
3. Read the tool result: it contains the `log()` output (`Logs:`) and what the
script printed (`Output:`). Each agent is also linked from the workflow
step, so the user can open its conversation.
4. If the tool returns an error, fix the script at the reported line and run
it again.
## Script rules
The script runs in its own `python3` process, which needs Python 3.8 or later
on `PATH`:
- `await` works at the top level, and you can define `async def` helpers.
- Installed library workflows are importable by name (`import <library>` or
`from <library> import <name>`); library modules see the same primitives as
the script.
- What the script prints (`print()`, `stderr`, child-process output, and the
`repr` of a trailing expression) is returned in the tool result's `Output:`
section (and appended to the error when the workflow fails).
- An uncaught exception stops the workflow and reports the script line.
- `CONVERSATION_ID` and `STEP_INDEX` identify the `run_workflow` step.
`WORKSPACES` is a tuple of the workspace directories, primary first (empty
if there are none).
- The working directory is `Cwd` if given, else `WORKSPACES[0]`, so relative
paths resolve against it. Local modules are not importable.
## Primitives
| Primitive | Behavior |
| --- | --- |
| `log(*args)` | Adds a line to the workflow output and the UI. |
| `phase(name)` | Starts a named phase; later logs and agents group under it. |
| `agent(prompt=None, schema=None, role=None, type_name="self", workspace="inherit", model=None)` | Defines an agent; nothing runs yet. `await agent(prompt, schema)` runs it once and returns its result. `a = agent(...)` then `await a(prompt, schema)` runs one turn in a conversation kept across calls. |
| `parallel(items, fn)` | Promise that calls `fn(item)` for each item and awaits all results concurrently; results are in item order. If one fails, the rest are cancelled. |
| `pipeline(items, fn)` | Promise that calls and awaits `fn(item)` one item at a time; results are in item order. |
| `trajectory(last=None, types=None, tools=None, min_index=None, max_index=None)` | `await trajectory()` returns steps before this `run_workflow` call started, oldest first. `min_index` and `max_index` bound `step.index` (inclusive); `types` and `tools` filter by step type or tool name; `last` keeps the last N matching steps. |
Arguments:
- `type_name`: the agent type to run. `"self"` uses the current agent's
configuration; any available custom agent name also works.
- `workspace`: `"inherit"` (the current workspace), `"branch"` (a new isolated
clone, for agents that edit code in parallel), or `"share"` (a new workspace
that shares the underlying repository). Other values are errors.
- `schema` (required): a JSON schema (dict or string) for the agent's result.
The agent returns the result by calling its `finish` tool, which checks it
against the schema, and `await agent(...)` returns the parsed value. An
agent that ends without calling `finish` fails the workflow. Use
`{"type": "string"}` for a free-form answer.
- `role`: an optional short title for the agent's card, such as
`"Security reviewer"`.
- `model`: the agent's model tier: `"inherit"` (default, your model),
`"flash_lite"`, `"flash"`, or `"pro"`. Use a lighter tier for simple,
high-fan-out work.
- `fn`: usually a `lambda` that returns `agent(...)`, or an `async def`
helper that awaits several agents. It must return something awaitable:
an `agent()` or a call on one, a nested `parallel()` / `pipeline()`, or
an `async def` call. Build per-item prompts and roles with f-strings.
Awaiting the same agent twice runs it once and returns the same result. An
`agent()` that is never awaited or called never runs, so always `await` it, or
pass it to `parallel` / `pipeline` and await that.
The workflow step shows one card per agent, in the order agents start, titled
with its `role`, or else the first line of its prompt, so set a role or start
each prompt with a short line that names the job.
## Agents that keep their context
When one agent should do several related turns, such as a reviewer that checks
the fixes for the bugs it found, call it instead of awaiting it. Each
`a(prompt, schema)` is lazy like an awaited `agent()` and returns that turn's
`finish` result; the agent's own `prompt`, if any, is its standing instructions
and leads the first turn. `schema` on a call defaults to the agent's. Turns on
one agent run one at a time, in the order they were started. A failed turn
raises, but the agent stays usable. An agent is either awaited or called, not
both. `del a` ends the agent, unless something else, such as a lambda, still
references it; every agent ends when the workflow ends.
```python
reviewer = agent("You review Go code for correctness.", role="Reviewer")
bugs = await reviewer("List the bugs in foo.go.", {"type": "array", "items": {"type": "string"}})
fixes = await parallel(bugs, lambda b: agent(f"Fix: {b}", {"type": "string"}))
ok = await reviewer(f"Fixes made: {fixes}. Are all your bugs fixed?", {"type": "boolean"})
del reviewer
```
## Calling tools from the script
Where the `run_workflow` tool description lists tools for `call_tool`, the
script can call them directly:
- `call_tool(name, **args)` returns a promise like `agent()` does. Awaiting it
runs the tool with the arguments you would pass to it directly and returns
the tool's output as a `str`.
- It raises `ToolError` (with `.tool` and `.message`) if the tool fails or
the call is denied. `.denied` is `True` when a pre-tool hook or the
permission check rejected the call before the tool ran, so a script can
skip denied calls and still fail on real errors.
- The user cannot be asked anything from a workflow: a call that needs user
approval that has not already been granted is denied.
- Tool outputs are not shown to you unless the script logs or prints them.
## Reading earlier conversation steps
Pass inputs you already have in `Args` (or inline in the script). Use
`await trajectory(...)` when the script needs to inspect steps from earlier in
this conversation—such as mining a failed `run_command` output without
rerunning it—and pass only the relevant slice into child `agent()` prompts.
Each returned `Step` is a `dict` that also supports attribute access (missing
fields return `None` as attributes):
- `index` (`int`): 0-based step index.
- `type` (`str`): step type, e.g. `"USER_INPUT"`, `"PLANNER_RESPONSE"`,
`"SYSTEM_MESSAGE"`, or `"GENERIC"` (tool calls).
- `status` (`str`): e.g. `"DONE"`, `"ERROR"`, or `"CLEARED"`.
- Message steps set `text` (`str`); tool steps set `tool` (`str`), `args`
(parsed `dict`), and `output` (`str`, truncated at 200k characters).
```python
steps = await trajectory(tools=["run_command"], last=20)
errors = [s.output for s in steps if s.status == "ERROR" and s.output]
log(f"Found {len(errors)} failed command(s)")
```
`trajectory()` only returns steps before the `run_workflow` call started (steps
added while the workflow runs in the background are not included). Older tool
steps evicted from memory have `status == "CLEARED"` and `output == None`; read
the conversation's `transcript.jsonl` / `transcript_full.jsonl` when you need
cleared tool outputs or steps added after the workflow started.
## Behavior to know
- Workflow agents are main agents, not subagents. They are hidden from the
conversation list and reachable from the workflow step. An awaited agent
is single-use; a called agent lasts until deleted or the workflow ends.
- `await agent(...)` returns when the agent's run ends, with the result it
passed to `finish`.
- If one agent in `parallel` fails, the whole call fails and the other agents
in it are cancelled. Stopping the parent conversation stops all running
workflow agents.
- Agents do not see the script or each other. Put all the context an agent
needs in its prompt, and ask for a short, well-defined output.
## Example
Fan out over a list that an agent produces:
```python
phase("Discover")
files = await agent(
"List the Go files under pkg/foo that call Bar(). Paths only.",
schema={"type": "array", "items": {"type": "string"}},
)
phase("Review")
reviews = await parallel(files, lambda f: agent(
f"Review {f} for misuse of Bar(). Reply in 3 bullets or 'OK'.",
schema={"type": "string"},
role=f"Review {f}",
))
for r in reviews:
log(r)
```
+1 -1
View File
@@ -5,7 +5,7 @@
isNormalUser = true; isNormalUser = true;
description = "Yura"; description = "Yura";
group = "cazzzer"; group = "cazzzer";
extraGroups = [ "wheel" ] extraGroups = [ "wheel" "dialout" ]
++ lib.optionals config.networking.networkmanager.enable [ "networkmanager" ] ++ lib.optionals config.networking.networkmanager.enable [ "networkmanager" ]
++ lib.optionals config.virtualisation.docker.enable [ "docker" ] ++ lib.optionals config.virtualisation.docker.enable [ "docker" ]
++ lib.optionals config.programs.wireshark.enable [ "wireshark" ] ++ lib.optionals config.programs.wireshark.enable [ "wireshark" ]