Compare commits
68
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48f5ad11fd
|
||
|
|
108a116478
|
||
|
|
07aaad56f7
|
||
|
|
5bcc513ece
|
||
|
|
04fd303ce6
|
||
|
|
35b77caf6d
|
||
|
|
c73345ef0c
|
||
|
|
ff7e80c6ca
|
||
|
|
27a08f9942
|
||
|
|
3af9b024ef
|
||
|
|
55a4591bf7
|
||
|
|
7351194fee
|
||
|
|
6aa799c05d
|
||
|
|
ddb6d43b0c
|
||
|
|
8af0ecbf39
|
||
|
|
ce60b83151
|
||
|
|
23609e180e
|
||
|
|
0a566d99b1
|
||
|
|
ff3e201261
|
||
|
|
87c5a25123
|
||
|
|
fd4bc1eaee
|
||
|
|
378ba963b4
|
||
|
|
0e8d8122ef
|
||
|
|
ee9efb8054
|
||
|
|
37769c788a
|
||
|
|
ff1c55e812
|
||
|
|
b6830e1a45
|
||
|
|
71cb76700f | ||
|
|
7aa16dd35e
|
||
|
|
08290f9b43
|
||
|
|
4b012f259f
|
||
|
|
7da9b008b4
|
||
|
|
97b667f27c
|
||
|
|
4d61ec4617
|
||
|
|
5697648ab1
|
||
|
|
7a69f68683
|
||
|
|
a278a69f05
|
||
|
|
2de612bc4f
|
||
|
|
8593abc8a5
|
||
|
|
91727dd2df
|
||
|
|
4e08c64ce5
|
||
|
|
d61c23f8e7
|
||
|
|
07d3706a14
|
||
|
|
1f647856ab
|
||
|
|
05a20f830f
|
||
|
|
35bb5e411e
|
||
|
|
5353ad048c
|
||
|
|
9bb5b596b7
|
||
|
|
ce9bcb785a
|
||
|
|
178626a193
|
||
|
|
3074b81b45
|
||
|
|
e7ebaf371b
|
||
|
|
bd44812337
|
||
|
|
d7ee1f6434
|
||
|
|
8880ac8158
|
||
|
|
57d47def99
|
||
|
|
8762c5b555
|
||
|
|
eee8fd5ece
|
||
|
|
e09bca0feb
|
||
|
|
f9b152cd52
|
||
|
|
2de9229027
|
||
|
|
00bc6f8de3
|
||
|
|
21a058f5ea
|
||
|
|
574ba8a951
|
||
|
|
15dc8dd7c4
|
||
|
|
2bd88d7a93
|
||
|
|
5ec716919d
|
||
|
|
47c9cff8f5
|
No files matched your search
@@ -0,0 +1,19 @@
|
||||
when:
|
||||
- event: [push, manual]
|
||||
|
||||
labels:
|
||||
backend: local
|
||||
nix-builder: true
|
||||
|
||||
clone:
|
||||
- name: clone
|
||||
image: woodpecker-plugin-git
|
||||
|
||||
steps:
|
||||
- name: build-and-cache
|
||||
image: bash
|
||||
environment:
|
||||
TRANSCRYPT_PASSWORD:
|
||||
from_secret: transcrypt_password
|
||||
commands:
|
||||
- bash ci/build.sh
|
||||
@@ -0,0 +1,70 @@
|
||||
# NixOS builds and LAN cache
|
||||
|
||||
`builder` is the headless configuration for the VM at `10.17.1.100`.
|
||||
Woodpecker builds every `nixosConfigurations` toplevel on pushes and manual
|
||||
runs. Builds run sequentially with one Nix job and four cores on this 8 GiB VM.
|
||||
Secrix runtime secrets do not need decryption in CI.
|
||||
|
||||
## Finish Woodpecker registration
|
||||
|
||||
1. Create an agent in Woodpecker and restrict its server-side filters to
|
||||
`repo=CaZzzer/nix-conf` (use the repository's exact spelling as displayed
|
||||
by Woodpecker).
|
||||
Allow only trusted users to push or change pipelines. The local backend
|
||||
executes repository commands as the `woodpecker` user on the VM.
|
||||
2. On the VM, use `sudo install -m 0600 /dev/null /var/lib/woodpecker/agent.env`
|
||||
once, then `sudoedit /var/lib/woodpecker/agent.env` and enter:
|
||||
|
||||
```ini
|
||||
WOODPECKER_AGENT_SECRET=<agent token>
|
||||
WOODPECKER_SERVER=<reachable gRPC host:port>
|
||||
WOODPECKER_GRPC_SECURE=true
|
||||
WOODPECKER_GRPC_SKIP_VERIFY=false
|
||||
```
|
||||
|
||||
Use `WOODPECKER_GRPC_SECURE=false` for a private plaintext gRPC listener.
|
||||
The public web UI address does not necessarily expose gRPC. The default
|
||||
in the module is `woodpecker.cazzzer.com:9000`; override it here as needed.
|
||||
3. Run `sudo systemctl start woodpecker-agent-nix`.
|
||||
4. Enable this repository in Woodpecker. Add a repository secret named
|
||||
`transcrypt_password` containing the existing transcrypt password. Limit
|
||||
it to push/manual events; do not enable it for pull requests. Commit and
|
||||
push these changes, then confirm the agent picks up the workflow.
|
||||
|
||||
The pipeline explicitly uses the native `woodpecker-plugin-git` clone binary.
|
||||
It initializes transcrypt with `aes-256-cbc`, suppressing its credential output.
|
||||
No secret values belong in Nix expressions or the repository.
|
||||
|
||||
## Cache
|
||||
|
||||
`nix-serve-ng` serves the VM's persistent store at `http://10.17.1.100:5000`
|
||||
through the NixOS `nix-serve` service.
|
||||
It signs responses using `/var/lib/nix-cache/cache-key.sec` (root-only).
|
||||
Back up this key securely; its public key is configured in `hosts/common.nix`.
|
||||
Rebuilding each client once installs cache trust. Clients need LAN/VPN access
|
||||
to this address; the official NixOS cache remains configured.
|
||||
|
||||
Successful builds leave indirect GC roots at `/var/lib/nix-ci/<host>`, retaining
|
||||
the latest successful closure per host. Weekly GC removes unrooted paths older
|
||||
than 14 days. Monitor disk space: 100 GiB may become tight for desktop closures
|
||||
and intermediate builds. Remove roots for retired hosts deliberately.
|
||||
|
||||
The cache is intended for a trusted LAN. Transcrypt plaintext can occur in Nix
|
||||
store sources and generated configuration, so readers of the cache may recover
|
||||
that information. Runtime secrix secrets remain encrypted. Do not expose this
|
||||
endpoint publicly without adding access control.
|
||||
|
||||
## Updating the builder
|
||||
|
||||
Build `.#nixosConfigurations.builder.config.system.build.toplevel`, copy its
|
||||
closure to the VM and activate it, or use `nixos-rebuild` targeting `builder`.
|
||||
New repository files must be added to Git before a Git-flake build sees them;
|
||||
`path:.` can be used when validating an uncommitted working tree.
|
||||
|
||||
Check services with:
|
||||
|
||||
```sh
|
||||
systemctl status woodpecker-agent-nix nix-serve
|
||||
journalctl -u woodpecker-agent-nix -f
|
||||
curl http://10.17.1.100:5000/nix-cache-info
|
||||
```
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
# Woodpecker traces commands; keep the password out of its logs.
|
||||
set +x
|
||||
: "${TRANSCRYPT_PASSWORD:?Set the transcrypt_password Woodpecker secret}"
|
||||
transcrypt --yes --cipher=aes-256-cbc --password="$TRANSCRYPT_PASSWORD" >/dev/null
|
||||
unset TRANSCRYPT_PASSWORD
|
||||
|
||||
# Discover every host so newly added configurations are automatically checked.
|
||||
mapfile -t hosts < <(nix eval --json .#nixosConfigurations --apply builtins.attrNames | python3 -c 'import json,sys; print("\n".join(json.load(sys.stdin)))')
|
||||
test "${#hosts[@]}" -gt 0
|
||||
root_dir=/var/lib/nix-ci
|
||||
for host in "${hosts[@]}"; do
|
||||
echo "Building $host"
|
||||
# A stable symlink per host retains its last successful closure across GC.
|
||||
# Nix registers these out-links as indirect GC roots.
|
||||
nix build --no-update-lock-file --print-build-logs \
|
||||
--out-link "$root_dir/$host" \
|
||||
".#nixosConfigurations.\"$host\".config.system.build.toplevel"
|
||||
done
|
||||
Generated
+137
-15
@@ -1,5 +1,58 @@
|
||||
{
|
||||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -7,11 +60,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1749178927,
|
||||
"narHash": "sha256-bXcEx1aZUNm5hMLVJeuofcOrZyOiapzvQ7K36HYK3YQ=",
|
||||
"lastModified": 1795366757,
|
||||
"narHash": "sha256-Tp4Kh4R7ID1f2mMCDlb2PiFQ/DZZsnXB2u2juWN+TT4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "91287a0e9d42570754487b7e38c6697e15a9aab2",
|
||||
"rev": "3b8140d21fa0a70b1b38c2ed29853dfe686234a6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -20,6 +73,30 @@
|
||||
"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": {
|
||||
"locked": {
|
||||
"lastModified": 1736643958,
|
||||
@@ -43,11 +120,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747663185,
|
||||
"narHash": "sha256-Obh50J+O9jhUM/FgXtI3he/QRNiV9+J53+l+RlKSaAk=",
|
||||
"lastModified": 1769813415,
|
||||
"narHash": "sha256-nnVmNNKBi1YiBNPhKclNYDORoHkuKipoz7EtVnXO50A=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "ee07ba0d36c38e9915c55d2ac5a8fb0f05f2afcc",
|
||||
"rev": "8946737ff703382fda7623b9fab071d037e897d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -58,11 +135,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1748929857,
|
||||
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
|
||||
"lastModified": 1795234589,
|
||||
"narHash": "sha256-f/VVvxf5RsQgWVhUtefoca5ktVg0DA2bnkMOcmSnozo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4",
|
||||
"rev": "2786a2a72088ecf32aea5b3ec52099e6a7cff78f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -82,11 +159,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1748196248,
|
||||
"narHash": "sha256-1iHjsH6/5UOerJEoZKE+Gx1BgAoge/YcnUsOA4wQ/BU=",
|
||||
"lastModified": 1785762349,
|
||||
"narHash": "sha256-jZhZkzAwc7f3exzcTDJWP2WCAchCv0iNC3UF/QsahdQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "plasma-manager",
|
||||
"rev": "b7697abe89967839b273a863a3805345ea54ab56",
|
||||
"rev": "a19a2a029fa180911bd89c554dca1616e10f4c1d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -95,15 +172,60 @@
|
||||
"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": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"lanzaboote": "lanzaboote",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"plasma-manager": "plasma-manager",
|
||||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -111,11 +233,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1746643487,
|
||||
"narHash": "sha256-dcB/DArJObCvqE/ZEdQSDW2BZMeDyF83Se5KPfJvz60=",
|
||||
"lastModified": 1787124737,
|
||||
"narHash": "sha256-EnQcFCdcQs1agb8U/h3kn7+A3c3uorANCPP2WakZjAk=",
|
||||
"owner": "Platonic-Systems",
|
||||
"repo": "secrix",
|
||||
"rev": "4c64203fa5b377953b1fb6d5388187df8b60c6d5",
|
||||
"rev": "9c0a7db4e355c28fe67643656821b06161b4df61",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -22,26 +22,53 @@
|
||||
url = "github:Platonic-Systems/secrix";
|
||||
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
|
||||
hmModule = file: {
|
||||
imports = [ home-manager.nixosModules.home-manager ];
|
||||
|
||||
home-manager.useGlobalPkgs = 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;
|
||||
# Optionally, use home-manager.extraSpecialArgs to pass
|
||||
# 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
|
||||
{
|
||||
apps.x86_64-linux.secrix = secrix.secrix self;
|
||||
|
||||
nixosConfigurations = {
|
||||
builder = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./modules
|
||||
./hosts/common.nix
|
||||
./hosts/hw-vm.nix
|
||||
./hosts/builder
|
||||
./users/cazzzer
|
||||
];
|
||||
};
|
||||
Yura-PC = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
@@ -57,6 +84,7 @@
|
||||
Yura-TPX13 = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
lanzaboote.nixosModules.lanzaboote
|
||||
./modules
|
||||
./hosts/common.nix
|
||||
./hosts/common-desktop.nix
|
||||
@@ -77,17 +105,9 @@
|
||||
(hmModule ./home/cazzzer-pc.nix)
|
||||
];
|
||||
};
|
||||
router = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
secrix.nixosModules.default
|
||||
./modules
|
||||
./hosts/common.nix
|
||||
./hosts/router
|
||||
./users/cazzzer
|
||||
(hmModule ./home/common.nix)
|
||||
];
|
||||
};
|
||||
router = mkRouter ./hosts/router;
|
||||
router-1 = mkRouter ./hosts/router-1;
|
||||
router-2 = mkRouter ./hosts/router-2;
|
||||
};
|
||||
# https://github.com/nix-community/nixos-generators?tab=readme-ov-file#using-in-a-flake
|
||||
packages.x86_64-linux = {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
enable = true;
|
||||
shellInit = "set fish_greeting";
|
||||
shellAliases = {
|
||||
# Replace ls with exa
|
||||
ls = "exa -al --color=always --group-directories-first --icons"; # preferred listing
|
||||
la = "exa -a --color=always --group-directories-first --icons"; # all files and dirs
|
||||
ll = "exa -l --color=always --group-directories-first --icons"; # long format
|
||||
lt = "exa -aT --color=always --group-directories-first --icons"; # tree listing
|
||||
# Replace ls with eza
|
||||
ls = "eza -al --color=always --group-directories-first --icons=always"; # preferred listing
|
||||
la = "eza -a --color=always --group-directories-first --icons=always"; # all files and dirs
|
||||
ll = "eza -l --color=always --group-directories-first --icons=always"; # long format
|
||||
lt = "eza -aT --color=always --group-directories-first --icons=always"; # tree listing
|
||||
"l." = "exa -a | rg '^\.'"; # show only dotfiles
|
||||
|
||||
# Replace cat with bat
|
||||
|
||||
+10
-8
@@ -8,21 +8,23 @@ in
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
userName = name;
|
||||
userEmail = email;
|
||||
|
||||
signing = {
|
||||
key = signingKey;
|
||||
signByDefault = true;
|
||||
format = "ssh";
|
||||
};
|
||||
|
||||
aliases = {
|
||||
co = "checkout";
|
||||
s = "switch";
|
||||
};
|
||||
settings = {
|
||||
user = {
|
||||
name = name;
|
||||
email = email;
|
||||
};
|
||||
|
||||
alias = {
|
||||
co = "checkout";
|
||||
s = "switch";
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
url = {
|
||||
"https://gitea.cazzzer.com/" = {
|
||||
insteadOf = "caztea:";
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
activities-icons."809dc779-bf5b-49e6-8e3f-cbe283cb05b6" = "keyboard";
|
||||
activities-icons."b34a506d-ac4f-4797-8c08-6ef45bc49341" = "preferences-desktop-gaming";
|
||||
};
|
||||
baloofilerc.General."exclude folders".persistent = true;
|
||||
systemsettingsrc.systemsettings_sidebar_mode.HighlightNonDefaultSettings=true;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
];
|
||||
opts.kb-input.enable = true;
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# Bootloader.
|
||||
boot.kernelParams = [
|
||||
"amd_iommu=on"
|
||||
@@ -29,6 +31,19 @@
|
||||
# https://nixos.wiki/wiki/Accelerated_Video_Playback
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
||||
vpl-gpu-rt
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
lmstudio
|
||||
];
|
||||
|
||||
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.
|
||||
|
||||
@@ -14,12 +14,26 @@
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "zroot/ROOT/nixos/default";
|
||||
fsType = "zfs";
|
||||
{ device = "/dev/mapper/luks-42b36c51-a57a-4bdb-b554-5742f1ae815a";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-42b36c51-a57a-4bdb-b554-5742f1ae815a".device = "/dev/disk/by-uuid/42b36c51-a57a-4bdb-b554-5742f1ae815a";
|
||||
|
||||
fileSystems."/home" =
|
||||
{ device = "/dev/mapper/luks-42b36c51-a57a-4bdb-b554-5742f1ae815a";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{ device = "/dev/mapper/luks-42b36c51-a57a-4bdb-b554-5742f1ae815a";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/970C-6A15";
|
||||
{ device = "/dev/disk/by-uuid/A043-E763";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
@@ -6,15 +6,25 @@
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages;
|
||||
|
||||
# Bootloader.
|
||||
boot.kernelParams = [
|
||||
"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.hostId = "8425e349"; # Required for ZFS.
|
||||
|
||||
services.fprintd.enable = true;
|
||||
security.pam.services.login.fprintAuth = false;
|
||||
|
||||
|
||||
# Install firefox.
|
||||
programs.firefox.enable = true;
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
networking.hostName = "nix-builder";
|
||||
networking.networkmanager.enable = true;
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.systemd-boot.configurationLimit = 5;
|
||||
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
|
||||
services.qemuGuest.enable = true;
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Bound memory pressure on the initial 4 vCPU / 8 GiB VM.
|
||||
nix.settings.max-jobs = 1;
|
||||
nix.settings.cores = 4;
|
||||
nix.settings.extra-substituters = lib.mkForce [ ];
|
||||
zramSwap.enable = true;
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d";
|
||||
};
|
||||
nix.optimise.automatic = true;
|
||||
|
||||
# Only serve on the LAN IPv4 address, including on this dual-stack VM.
|
||||
services.nix-serve = {
|
||||
enable = true;
|
||||
package = pkgs.nix-serve-ng;
|
||||
bindAddress = "10.17.1.100";
|
||||
openFirewall = true;
|
||||
secretKeyFile = "/var/lib/nix-cache/cache-key.sec";
|
||||
};
|
||||
|
||||
users.groups.woodpecker = { };
|
||||
users.users.woodpecker = {
|
||||
isSystemUser = true;
|
||||
group = "woodpecker";
|
||||
home = "/var/lib/woodpecker";
|
||||
};
|
||||
services.woodpecker-agents.agents.nix = {
|
||||
enable = true;
|
||||
environment = {
|
||||
WOODPECKER_BACKEND = "local";
|
||||
WOODPECKER_SERVER = "woodpecker.cazzzer.com:9000";
|
||||
WOODPECKER_MAX_WORKFLOWS = "1";
|
||||
WOODPECKER_AGENT_LABELS = "repo=CaZzzer/nix-conf,!nix-builder=true";
|
||||
WOODPECKER_BACKEND_LOCAL_TEMP_DIR = "/var/lib/woodpecker/workspaces";
|
||||
};
|
||||
# Root-owned, mode 0600; may also override server/TLS settings above.
|
||||
environmentFile = [ "/var/lib/woodpecker/agent.env" ];
|
||||
path = with pkgs; [
|
||||
bash coreutils findutils git git-lfs openssh openssl python3 transcrypt
|
||||
woodpecker-plugin-git config.nix.package
|
||||
];
|
||||
};
|
||||
systemd.services.woodpecker-agent-nix.serviceConfig = {
|
||||
DynamicUser = lib.mkForce false;
|
||||
User = "woodpecker";
|
||||
Group = "woodpecker";
|
||||
StateDirectory = "woodpecker";
|
||||
ReadWritePaths = [ "/var/lib/nix-ci" ];
|
||||
};
|
||||
systemd.services.woodpecker-agent-nix.unitConfig.ConditionPathExists =
|
||||
"/var/lib/woodpecker/agent.env";
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /var/lib/woodpecker/workspaces 0700 woodpecker woodpecker -"
|
||||
"d /var/lib/nix-ci 0750 woodpecker woodpecker -"
|
||||
"d /var/lib/nix-cache 0700 root root -"
|
||||
];
|
||||
}
|
||||
+74
-35
@@ -7,15 +7,19 @@
|
||||
"sysrq_always_enabled=1"
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_14;
|
||||
boot.loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 3;
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 5;
|
||||
};
|
||||
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
|
||||
hardware.graphics.enable = true;
|
||||
@@ -24,14 +28,16 @@
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
networking.networkmanager.plugins = [
|
||||
pkgs.networkmanager-openvpn
|
||||
];
|
||||
|
||||
# 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.
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.displayManager.sddm.wayland.enable = true;
|
||||
services.displayManager.plasma-login-manager.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
@@ -54,49 +60,38 @@
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = false;
|
||||
programs.kdeconnect.enable = true;
|
||||
programs.fish.enable = true;
|
||||
programs.git.enable = true;
|
||||
programs.git.lfs.enable = true;
|
||||
# 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.neovim.enable = true;
|
||||
programs.wireshark.enable = true;
|
||||
programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default
|
||||
programs.bat.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
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.enableOnBoot = false;
|
||||
virtualisation.docker.package = pkgs.docker_28;
|
||||
|
||||
# https://github.com/flatpak/flatpak/issues/2861
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
|
||||
workarounds.flatpak.enable = true;
|
||||
fonts.packages = with pkgs; [
|
||||
fantasque-sans-mono
|
||||
nerd-fonts.fantasque-sans-mono
|
||||
noto-fonts
|
||||
noto-fonts-emoji
|
||||
noto-fonts-color-emoji
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
jetbrains-mono
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
dust
|
||||
eza
|
||||
fastfetch
|
||||
fd
|
||||
helix
|
||||
micro
|
||||
openssl
|
||||
ripgrep
|
||||
starship
|
||||
tealdeer
|
||||
transcrypt
|
||||
|
||||
] ++ [
|
||||
efibootmgr
|
||||
ffmpeg
|
||||
@@ -107,12 +102,13 @@
|
||||
jq
|
||||
ldns
|
||||
mediainfo
|
||||
powertop
|
||||
rbw
|
||||
restic
|
||||
resticprofile
|
||||
rclone
|
||||
ripgrep-all
|
||||
rustscan
|
||||
unrar
|
||||
whois
|
||||
wireguard-tools
|
||||
yt-dlp
|
||||
@@ -120,48 +116,91 @@
|
||||
bitwarden-desktop
|
||||
darkman
|
||||
host-spawn # for flatpaks
|
||||
jellyfin-mpv-shim
|
||||
kdePackages.filelight
|
||||
kdePackages.flatpak-kcm
|
||||
kdePackages.kate
|
||||
kdePackages.partitionmanager
|
||||
kdePackages.yakuake
|
||||
mpv
|
||||
mission-center
|
||||
(mpv.override {
|
||||
scripts = with pkgs.mpvScripts; [
|
||||
mpris
|
||||
videoclip
|
||||
];
|
||||
})
|
||||
nextcloud-client
|
||||
# lutris
|
||||
lxqt.pavucontrol-qt
|
||||
pinentry
|
||||
pinentry-all
|
||||
tela-circle-icon-theme
|
||||
typst
|
||||
virt-viewer
|
||||
waypipe
|
||||
] ++ [
|
||||
# jetbrains.rust-rover
|
||||
# jetbrains.goland
|
||||
jetbrains.clion
|
||||
jetbrains.idea-ultimate
|
||||
jetbrains.pycharm-professional
|
||||
# jetbrains.idea
|
||||
jetbrains.pycharm
|
||||
jetbrains.webstorm
|
||||
android-studio
|
||||
rustup
|
||||
zed-editor
|
||||
package-version-server # for zed
|
||||
antigravity-cli
|
||||
antigravity-ide-fhs
|
||||
codex
|
||||
bubblewrap
|
||||
# codex-acp
|
||||
# github-copilot-cli
|
||||
# opencode
|
||||
# opencode-desktop
|
||||
] ++ [
|
||||
# C
|
||||
gcc
|
||||
valgrind
|
||||
|
||||
# Python
|
||||
python3
|
||||
poetry
|
||||
|
||||
# Haskell
|
||||
cabal-install
|
||||
haskell-language-server
|
||||
# haskellPackages.hls-cabal-plugin
|
||||
haskellPackages.ghc
|
||||
haskellPackages.stack
|
||||
|
||||
# Node
|
||||
nodejs_22
|
||||
nodejs_24
|
||||
pnpm
|
||||
bun
|
||||
|
||||
# Nix
|
||||
nil
|
||||
nixd
|
||||
nixfmt-rfc-style
|
||||
nixfmt
|
||||
|
||||
# Gleam
|
||||
gleam
|
||||
beamMinimal26Packages.erlang
|
||||
beamMinimal28Packages.erlang
|
||||
|
||||
# Racket
|
||||
racket
|
||||
|
||||
# Ruby
|
||||
ruby
|
||||
|
||||
# Java
|
||||
zulu
|
||||
|
||||
# spacetimedb
|
||||
] ++ [
|
||||
jujutsu
|
||||
lazyjj
|
||||
jjui
|
||||
# jj-fzf
|
||||
gg-jj
|
||||
];
|
||||
}
|
||||
@@ -20,6 +20,11 @@
|
||||
};
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.extra-substituters = [ "http://10.17.1.100:5000" ];
|
||||
nix.settings.extra-trusted-public-keys = [
|
||||
"nix-builder:PhxOkUyF2KD9ALkSC6saB2zoPp1o6hMOOpgp5/gngKI="
|
||||
];
|
||||
nix.settings.connect-timeout = 5;
|
||||
|
||||
environment.etc."current-system-packages".text =
|
||||
let
|
||||
@@ -32,4 +37,25 @@
|
||||
services.openssh.enable = true;
|
||||
services.openssh.settings.PasswordAuthentication = false;
|
||||
services.openssh.settings.KbdInteractiveAuthentication = false;
|
||||
|
||||
programs.fish.enable = true;
|
||||
programs.git.enable = true;
|
||||
|
||||
programs.bat.enable = true;
|
||||
programs.htop.enable = true;
|
||||
programs.neovim.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
dua
|
||||
dust
|
||||
eza
|
||||
fastfetch
|
||||
fd
|
||||
micro
|
||||
openssl
|
||||
ripgrep
|
||||
starship
|
||||
tealdeer
|
||||
transcrypt
|
||||
];
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
+12
-85
@@ -1,91 +1,18 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
enableDesktop = false;
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.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"
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./private.nix
|
||||
];
|
||||
|
||||
boot.loader.timeout = 2;
|
||||
boot.loader.systemd-boot.configurationLimit = 5;
|
||||
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
|
||||
boot.growPartition = true;
|
||||
router = {
|
||||
enableDesktop = false;
|
||||
enableDhcpClient = 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";
|
||||
|
||||
# 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.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?
|
||||
}
|
||||
@@ -14,12 +14,12 @@
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f";
|
||||
{ device = "/dev/disk/by-uuid/0dec41bf-aba0-4b7b-9f61-bbb572e5bd1e";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/12CE-A600";
|
||||
{ device = "/dev/disk/by-uuid/9F5E-672F";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
U2FsdGVkX1/MGwxIMmhbZuPqJUZzex9v5tTuiOrEvDVldI7xY0edUy9Ii5udFLXt
|
||||
AbxShsH43FH1ucgygKDlKTB/yXZWDoDVhjdgLFjaBtAt0xyAL9Doet844oDVhbbO
|
||||
FqOwXHMd+PE23rgqiCscsA==
|
||||
U2FsdGVkX1+eMFkQxarJDGLkX0zXyMRPukeRNvzd/BJ0XDAUZ2EeZvQnZw8U53Xz
|
||||
W97X4rvT+K/NQ7FVCYfOg1XpQhzlSiC9z1M4WLmPRutUgsDY5n5RFJu2R8K5DAfi
|
||||
sAPcxiQUGVKrmDUva16yNqoR2Dkx2XE9iW1hpkfGFYVUK+QKIBkUEowQQlJJ1Wg1
|
||||
@@ -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— �Œ
|
||||
@@ -56,12 +56,7 @@
|
||||
|
||||
# Install firefox.
|
||||
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;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
@@ -70,7 +65,6 @@
|
||||
# https://github.com/flatpak/flatpak/issues/2861
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
|
||||
# workarounds.flatpak.enable = true;
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
@@ -80,23 +74,13 @@
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
dust
|
||||
eza
|
||||
fastfetch
|
||||
fd
|
||||
host-spawn # for flatpaks
|
||||
kdePackages.flatpak-kcm
|
||||
kdePackages.filelight
|
||||
kdePackages.kate
|
||||
kdePackages.yakuake
|
||||
ldns
|
||||
micro
|
||||
mpv
|
||||
openssl
|
||||
ripgrep
|
||||
starship
|
||||
tealdeer
|
||||
transcrypt
|
||||
waypipe
|
||||
whois
|
||||
zfs
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./opts
|
||||
./workarounds
|
||||
];
|
||||
}
|
||||
@@ -45,7 +45,7 @@ in {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5.waylandFrontend = true;
|
||||
fcitx5.plasma6Support = true;
|
||||
# fcitx5.plasma6Support = true;
|
||||
fcitx5.addons = [ pkgs.fcitx5-mozc ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
{ 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.wireshark.enable = true;
|
||||
programs.wireshark.package = pkgs.wireshark; # wireshark-cli by default
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
kdePackages.kate
|
||||
ldns
|
||||
lsof
|
||||
mpv
|
||||
rustscan
|
||||
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, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./vars.nix config;
|
||||
domain = vars.domain;
|
||||
ldomain = vars.ldomain;
|
||||
sysdomain = vars.sysdomain;
|
||||
@@ -26,8 +26,11 @@ let
|
||||
"|opnsense."
|
||||
"|vpgen."
|
||||
"|woodpecker."
|
||||
"|woodpecker-grpc."
|
||||
"||pgrok."
|
||||
"|sync."
|
||||
"|minecruft."
|
||||
"|n8n."
|
||||
];
|
||||
in
|
||||
{
|
||||
@@ -52,17 +55,17 @@ in
|
||||
enable_dnssec = true;
|
||||
bootstrap_dns = [ "1.1.1.1" "9.9.9.9" ];
|
||||
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,
|
||||
# and obviously my sysdomain entries don't exist in cloudflare.
|
||||
"[/${sysdomain}/][::1]" # Sys domains to self (for cname rewrites)
|
||||
|
||||
"[/${ldomain}/][::1]:1053" # Local domains to Knot (ddns)
|
||||
"[/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/
|
||||
@@ -80,11 +83,14 @@ in
|
||||
"|etappi.${sysdomain}^$dnsrewrite=${ifs.lan.p4}.12"
|
||||
"|etappi.${sysdomain}^$dnsrewrite=${ifs.lan.ulaPrefix}::12:1"
|
||||
|
||||
"|hass.${domain}^$dnsrewrite=${ifs.lan.ulaAddr}"
|
||||
|
||||
# Lab DNS rewrites
|
||||
"||lab.${domain}^$dnsrewrite=etappi.${sysdomain}"
|
||||
|
||||
# Allowed exceptions
|
||||
"@@||googleads.g.doubleclick.net"
|
||||
"@@||stats.grafana.org"
|
||||
]
|
||||
# Alpina DNS rewrites
|
||||
++ map (host: "${host}${domain}^$dnsrewrite=debbi.${sysdomain}") alpinaDomains;
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./vars.nix config;
|
||||
links = vars.links;
|
||||
ifs = vars.ifs;
|
||||
pdFromWan = vars.pdFromWan;
|
||||
@@ -56,6 +56,14 @@ in
|
||||
udp . 45608 : ${vars.extra.opnsense.addr4} . 45608,
|
||||
udp . 35848 : ${vars.extra.opnsense.addr4} . 35848,
|
||||
udp . 48425 : ${vars.extra.opnsense.addr4} . 48425,
|
||||
# Amnezia VPN server
|
||||
udp . 37138 : ${vars.extra.amnezia.addr4} . 37138,
|
||||
udp . 31405 : ${vars.extra.amnezia.addr4} . 31405,
|
||||
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, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./vars.nix config;
|
||||
domain = vars.domain;
|
||||
in
|
||||
{
|
||||
@@ -1,6 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
cfg = config.router;
|
||||
vars = import ./vars.nix config;
|
||||
links = vars.links;
|
||||
ifs = vars.ifs;
|
||||
pdFromWan = vars.pdFromWan;
|
||||
@@ -51,13 +52,16 @@ in
|
||||
# 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
|
||||
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,
|
||||
# so I use dhcpcd for this
|
||||
# https://github.com/systemd/systemd/issues/22571
|
||||
# https://github.com/systemd/systemd/issues/22571#issuecomment-2094905496
|
||||
# https://gist.github.com/csamsel/0f8cca3b2e64d7e4cc47819ec5ba9396
|
||||
networking.dhcpcd.enable = true;
|
||||
networking.dhcpcd.enable = cfg.enableDhcpClient;
|
||||
networking.dhcpcd.allowInterfaces = [ ifs.wan.name ];
|
||||
networking.dhcpcd.extraConfig = ''
|
||||
debug
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./vars.nix config;
|
||||
ldomain = vars.ldomain;
|
||||
ifs = vars.ifs;
|
||||
|
||||
@@ -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`Èô×{
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./vars.nix config;
|
||||
domain = vars.domain;
|
||||
in
|
||||
{
|
||||
@@ -29,10 +29,12 @@ in
|
||||
};
|
||||
|
||||
# https://wiki.nixos.org/wiki/Grafana#Declarative_configuration
|
||||
secrix.services.grafana.secrets.security-key.encrypted.file = ./secrets/grafana-secret-key.age;
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
security.allow_embedding = true;
|
||||
security.secret_key = "$__file{${config.secrix.services.grafana.secrets.security-key.decrypted.path}}";
|
||||
server = {
|
||||
http_port = 3001;
|
||||
domain = "grouter.${domain}";
|
||||
@@ -57,28 +59,37 @@ in
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
package = pkgs.caddy.withPlugins {
|
||||
plugins = [ "github.com/caddy-dns/cloudflare@v0.2.1" ];
|
||||
hash = "sha256-Gsuo+ripJSgKSYOM9/yl6Kt/6BFCA6BuTDvPdteinAI=";
|
||||
plugins = [ "github.com/caddy-dns/cloudflare@v0.2.4" ];
|
||||
hash = "sha256-QSiwKqKvSxhksWBF4/MlBOpyXba5xOQ2sRwA0R7399E=";
|
||||
};
|
||||
virtualHosts."grouter.${domain}".extraConfig = ''
|
||||
virtualHosts."*.${domain}".extraConfig = ''
|
||||
encode
|
||||
tls {
|
||||
dns cloudflare {env.CF_API_KEY}
|
||||
resolvers 1.1.1.1
|
||||
}
|
||||
@grafana path /grafana /grafana/*
|
||||
handle @grafana {
|
||||
reverse_proxy localhost:${toString config.services.grafana.settings.server.http_port}
|
||||
}
|
||||
redir /adghome /adghome/
|
||||
handle_path /adghome/* {
|
||||
reverse_proxy localhost:${toString config.services.adguardhome.port}
|
||||
basic_auth {
|
||||
Bob $2a$14$HsWmmzQTN68K3vwiRAfiUuqIjKoXEXaj9TOLUtG2mO1vFpdovmyBy
|
||||
|
||||
@grouter host grouter.${domain}
|
||||
handle @grouter {
|
||||
@grafana path /grafana /grafana/*
|
||||
handle @grafana {
|
||||
reverse_proxy localhost:${toString config.services.grafana.settings.server.http_port}
|
||||
}
|
||||
redir /adghome /adghome/
|
||||
handle_path /adghome/* {
|
||||
reverse_proxy localhost:${toString config.services.adguardhome.port}
|
||||
basic_auth {
|
||||
Bob $2a$14$HsWmmzQTN68K3vwiRAfiUuqIjKoXEXaj9TOLUtG2mO1vFpdovmyBy
|
||||
}
|
||||
}
|
||||
handle /* {
|
||||
reverse_proxy localhost:${toString config.services.glance.settings.server.port}
|
||||
}
|
||||
}
|
||||
handle /* {
|
||||
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
|
||||
private = import ./private.nix;
|
||||
|
||||
cfg = config.router;
|
||||
mkIfConfig = {
|
||||
name_,
|
||||
domain_,
|
||||
@@ -10,7 +10,7 @@ let
|
||||
p6Size_ ? 64,
|
||||
ulaPrefix_, # /64
|
||||
ulaSize_ ? 64,
|
||||
token? 1,
|
||||
token? cfg.defaultToken,
|
||||
ip6Token_? "::${toString token}",
|
||||
ulaToken_? "::${toString token}",
|
||||
}: rec {
|
||||
@@ -41,21 +41,21 @@ rec {
|
||||
ldomain = "l.${domain}";
|
||||
sysdomain = "sys.${domain}";
|
||||
links = {
|
||||
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";
|
||||
wanMAC = cfg.wanMAC;
|
||||
lanMAC = cfg.lanMAC;
|
||||
wanLL = cfg.wanLL;
|
||||
lanLL = cfg.lanLL;
|
||||
};
|
||||
|
||||
p4 = "10.17"; # .0.0/16
|
||||
pdFromWan = private.pdFromWan; # ::/60
|
||||
pdFromWan = cfg.pdFromWan; # ::/60
|
||||
ulaPrefix = "fdab:07d3:581d"; # ::/48
|
||||
ifs = rec {
|
||||
wan = rec {
|
||||
name = "wan";
|
||||
addr4 = private.wanAddr4;
|
||||
addr4Sized = "${addr4}/23";
|
||||
gw4 = private.wanGw4;
|
||||
addr4 = cfg.wanAddr4;
|
||||
addr4Sized = "${addr4}/24";
|
||||
gw4 = cfg.wanGw4;
|
||||
};
|
||||
lan = mkIfConfig {
|
||||
name_ = "lan";
|
||||
@@ -77,7 +77,7 @@ rec {
|
||||
p4_ = "${p4}.20"; # .0/24
|
||||
p6_ = "${pdFromWan}0"; # ::/64 managed by Att box
|
||||
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 {
|
||||
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, ... }:
|
||||
let
|
||||
vars = import ./vars.nix;
|
||||
vars = import ./vars.nix config;
|
||||
wg0 = vars.ifs.wg0;
|
||||
|
||||
peerIps = ifObj: token: [
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
imports = [
|
||||
./flatpak.nix
|
||||
];
|
||||
}
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
isNormalUser = true;
|
||||
description = "Yura";
|
||||
group = "cazzzer";
|
||||
extraGroups = [ "wheel" ]
|
||||
extraGroups = [ "wheel" "dialout" ]
|
||||
++ lib.optionals config.networking.networkmanager.enable [ "networkmanager" ]
|
||||
++ lib.optionals config.virtualisation.docker.enable [ "docker" ]
|
||||
++ lib.optionals config.programs.wireshark.enable [ "wireshark" ]
|
||||
|
||||
Reference in new issue
Block a user