127 Commits

Author SHA1 Message Date
Tom Alexander
9e111f5ea9 Update packages. 2026-07-30 01:23:04 -04:00
Tom Alexander
649e4033fd Update nix_builder to record the revisions of the flake inputs. 2026-07-28 10:20:18 -04:00
Tom Alexander
1b38004e03 Add more hosts to /etc/hosts. 2026-07-28 08:22:47 -04:00
Tom Alexander
d8ef4356a0 Enable some more builds in nix_builder. 2026-07-23 20:25:42 -04:00
Tom Alexander
5dd5f2e4e0 Fix docker credential generation. 2026-07-23 20:08:40 -04:00
Tom Alexander
84e8983974 Update nix_builder. 2026-07-18 23:30:39 -04:00
Tom Alexander
24f4a8c2d9 Tweak the containerd garbage collect threshold on kubelets.
Pods were getting evicted due to disk pressure, so this causes garbage collection to trigger sooner.
2026-07-18 13:59:56 -04:00
Tom Alexander
a3cdaa9128 Increase subuid/subgid range to support running buildkit inside podman. 2026-07-18 08:42:02 -04:00
Tom Alexander
51295a23dc Enable the build VM as a substituter.
This should enable me to have local build jobs without rebuilding stuff that already exists on the build VM server.
2026-07-18 08:41:11 -04:00
Tom Alexander
11d8b93551 Add an /etc/hosts entry for google's metadata server.
gcloud was reaching out to this address which was causing delays. Pointing it to localhost to speed the failure up.
2026-07-14 11:53:38 -04:00
Tom Alexander
40b8742a80 Add nix pull-through cache secrets. 2026-07-13 20:35:11 -04:00
Tom Alexander
32080e0e01 Add chown for nix pull through cache database. 2026-07-12 17:25:12 -04:00
Tom Alexander
41668506cd Retire the kubernetes branch now that it is merged into nix. 2026-07-06 18:28:58 -04:00
Tom Alexander
63a988d1da Merge branch 'kubernetes' into nix 2026-07-06 18:23:07 -04:00
Tom Alexander
7c8d278923 Configure kernel preemption. 2026-07-06 18:12:15 -04:00
Tom Alexander
297577471e Update kubernetes packages and update to gateway API 1.5.1. 2026-07-06 18:12:15 -04:00
Tom Alexander
345ecfc7cf Add secret for homepage-staging. 2026-07-06 18:12:14 -04:00
Tom Alexander
889de9dbf6 Add a secret for the harbor webhooks to flux. 2026-07-06 18:12:14 -04:00
Tom Alexander
65c2021473 Update flux and install the image automation controller. 2026-07-06 18:12:14 -04:00
Tom Alexander
b0f025d340 Add IP addresses to worker certs for the metrics server. 2026-07-06 18:12:14 -04:00
Tom Alexander
a00115fb4e Delete images after 24 hours of being unused. 2026-07-06 18:12:14 -04:00
Tom Alexander
058f0cd59b Set up containerd use harbor.fizz.buzz. 2026-07-06 18:12:14 -04:00
Tom Alexander
c8c18bde88 Add secrets for archive-box, webhook-bridge, and tekton. 2026-07-06 18:12:14 -04:00
Tom Alexander
a36016e631 Allow node-to-node communication. 2026-07-06 18:12:13 -04:00
Tom Alexander
deaea6954e Use numbers for folder order. 2026-07-06 18:12:13 -04:00
Tom Alexander
c1ec96044e Add harbor secrets. 2026-07-06 18:12:13 -04:00
Tom Alexander
cdb2994447 Switch to the experimental gateway CRDs for TCPRoute support. 2026-07-06 18:12:13 -04:00
Tom Alexander
7416e412df Add oauth2 proxy secrets. 2026-07-06 18:12:13 -04:00
Tom Alexander
d14d8fe4a4 Add dex secrets. 2026-07-06 18:12:13 -04:00
Tom Alexander
a4b20c1ead Enable the firewall. 2026-07-06 18:12:12 -04:00
Tom Alexander
b593fdc8a7 Add gitea secrets. 2026-07-06 18:12:12 -04:00
Tom Alexander
8f5f59ee87 Add generation for in-repo secrets. 2026-07-06 18:12:12 -04:00
Tom Alexander
fc32a42750 Enforce cilium network policies. 2026-07-06 18:12:12 -04:00
Tom Alexander
1d3d178fc8 Downgrade to gateway 1.4.1.
1.5 came out recently, so no gateway providers support it.
2026-07-06 18:12:12 -04:00
Tom Alexander
e54f272a69 Update packages in kubernetes/keys. 2026-07-06 18:12:12 -04:00
Tom Alexander
e09e659d91 Fix network for updated nix. 2026-07-06 18:12:12 -04:00
Tom Alexander
3cc0fb1d3f Fix proxy auth tls 2026-07-06 18:12:11 -04:00
Tom Alexander
92727aa1f7 Generate certificates for the aggregation layer. 2026-07-06 18:12:11 -04:00
Tom Alexander
2a319deea0 Add a note for the cilium connectivity test. 2026-07-06 18:12:11 -04:00
Tom Alexander
d6f089bdb4 Temporarily disable the firewall for debugging. 2026-07-06 18:12:11 -04:00
Tom Alexander
cce4f98125 Enable gateway support. 2026-07-06 18:12:11 -04:00
Tom Alexander
612158c3e1 Enable hubble. 2026-07-06 18:12:11 -04:00
Tom Alexander
1ed3832730 Temporarily drop flux interval to 1 minute during early development.
This is to reduce waiting time.
2026-07-06 18:12:10 -04:00
Tom Alexander
f3b969642c Install deferred manifests. 2026-07-06 18:12:10 -04:00
Tom Alexander
23d9bbb8a1 Add a custom nftables firewall config. 2026-07-06 18:12:10 -04:00
Tom Alexander
9e729a8cc6 Enable the firewall.
Now that we have networking working, I can enable the firewall and confirm nothing breaks.
2026-07-06 18:12:10 -04:00
Tom Alexander
3169822726 Fix CoreDNS IPv4 connectivity. 2026-07-06 18:12:10 -04:00
Tom Alexander
9b5fbadc44 Increase timeout for coredns cache. 2026-07-06 18:12:10 -04:00
Tom Alexander
ab1b2a70f3 More changes to try to fix coredns. 2026-07-06 18:12:10 -04:00
Tom Alexander
4061d14651 Move the kubelet yaml config into nix. 2026-07-06 18:12:09 -04:00
Tom Alexander
361ec69a8b Implement a generic helm templater package. 2026-07-06 18:12:09 -04:00
Tom Alexander
f545376aec Switch to generating the coredns manifests via nix. 2026-07-06 18:12:09 -04:00
Tom Alexander
dc80c06ee9 Use CoreDNS for in-cluster DNS requests and caching. 2026-07-06 18:12:09 -04:00
Tom Alexander
5d58d550d3 Enable native routing. 2026-07-06 18:12:09 -04:00
Tom Alexander
51e027ba67 Build the cilium manifest automatically in nix. 2026-07-06 18:12:09 -04:00
Tom Alexander
37efcdb367 Allow pods to directly speak to the public internet on their own public IPv6 addresses. 2026-07-06 18:12:08 -04:00
Tom Alexander
01d230bde6 Enable ipv4 and tunnel routing. 2026-07-06 18:12:08 -04:00
Tom Alexander
383acd4fd2 Switch to kubernetes ipam mode. 2026-07-06 18:12:08 -04:00
Tom Alexander
7df824da6a Fix service cluster ip range.
Kubernetes only allows a /112 for service ip range.
2026-07-06 18:12:08 -04:00
Tom Alexander
efbfe865e0 Fix trailing line break in kubernetes encryption config. 2026-07-06 18:12:08 -04:00
Tom Alexander
2314bef2ad Move the yaml functions to their own file. 2026-07-06 18:12:08 -04:00
Tom Alexander
8e9bd9acc1 Introduce functions to generate yaml.
The toYAML function is just an alias to toJSON which is technically fine since YAML is a superset of JSON, but these new functions will generate actual YAML.
2026-07-06 18:12:08 -04:00
Tom Alexander
d924aa3a81 Add missing cidr declarations. 2026-07-06 18:12:07 -04:00
Tom Alexander
2bbf44e528 Fix DNS resolution. 2026-07-06 18:12:07 -04:00
Tom Alexander
c289f46cc5 Apply the git repo to the cluster. 2026-07-06 18:12:07 -04:00
Tom Alexander
88b1c36c0d Trust flux's ssh key in the yaml git repo. 2026-07-06 18:12:07 -04:00
Tom Alexander
dbd82b998d Generic secrets for ssh keys. 2026-07-06 18:12:07 -04:00
Tom Alexander
1700c42926 Generic secrets for pgp keys. 2026-07-06 18:12:07 -04:00
Tom Alexander
3c20fd49f0 Generate kubernetes secrets for ssh keys. 2026-07-06 18:12:06 -04:00
Tom Alexander
903c1c1f41 Install CoreDNS. 2026-07-06 18:12:06 -04:00
Tom Alexander
158c622840 Generate pgp keys for sops. 2026-07-06 18:12:06 -04:00
Tom Alexander
ceb627bb35 Generate ssh keys for flux bootstrap. 2026-07-06 18:12:06 -04:00
Tom Alexander
a3f1dff351 Move the cluster bootstrap into the keys flake.
Bootstrapping the cluster needs access to secrets, so I am moving it into the keys flake.
2026-07-06 18:12:06 -04:00
Tom Alexander
46c8f5e0ce Set up flux. 2026-07-06 18:12:06 -04:00
Tom Alexander
3760bca64b Add a bootstrap role. 2026-07-06 18:12:05 -04:00
Tom Alexander
3396a4f482 Add a bootstrap role to load manifests into the cluster. 2026-07-06 18:12:05 -04:00
Tom Alexander
773db6e567 Fix launching of containers. 2026-07-06 18:12:05 -04:00
Tom Alexander
6010867796 Create a debugging role. 2026-07-06 18:12:05 -04:00
Tom Alexander
e9db45fb61 Some networking fixes. 2026-07-06 18:12:05 -04:00
Tom Alexander
10cb394dde Add cilium bootstrap. 2026-07-06 18:12:05 -04:00
Tom Alexander
14787d6730 Installing the cni plugins. 2026-07-06 18:12:05 -04:00
Tom Alexander
19b2da0d40 Add kube-proxy. 2026-07-06 18:12:04 -04:00
Tom Alexander
95ec23126a Add kubelet. 2026-07-06 18:12:04 -04:00
Tom Alexander
6897915455 Add worker nodes. 2026-07-06 18:12:04 -04:00
Tom Alexander
868b9b9889 Add kube-scheduler. 2026-07-06 18:12:04 -04:00
Tom Alexander
d0439a6d2f Add kube-controller-manager. 2026-07-06 18:12:04 -04:00
Tom Alexander
fd15dc5bef Fix launching kube-apiserver. 2026-07-06 18:12:04 -04:00
Tom Alexander
380ac011f1 Move the encryption config into a package. 2026-07-06 18:12:03 -04:00
Tom Alexander
f4891f345e Switch to generating certs with openssl. 2026-07-06 18:12:03 -04:00
Tom Alexander
f8ad309c0b Add controller proxy certs. 2026-07-06 18:12:03 -04:00
Tom Alexander
6c07157f21 Add requestheader-client-ca. 2026-07-06 18:12:03 -04:00
Tom Alexander
6aa87faecb Add service account. 2026-07-06 18:12:03 -04:00
Tom Alexander
732e2cd296 Install kubernetes. 2026-07-06 18:12:03 -04:00
Tom Alexander
ac07941b8e Add additional controllers. 2026-07-06 18:12:02 -04:00
Tom Alexander
fa59f17df5 Add configs for a new kubernetes cluster on NixOS. 2026-07-06 18:12:00 -04:00
Tom Alexander
c7e7b2b06c Fix ending video recording sessions. 2026-07-05 17:29:53 -04:00
Tom Alexander
c0b3cd0fd3 Switch to flake-based build on nix-builder for nightly rust. 2026-07-05 16:15:33 -04:00
Tom Alexander
ef21e0125e Disable the nixbsd build due to onetbb test bugs.
This can be re-enabled after I have a flake building nixbsd so I can specify overlays.
2026-06-23 15:08:44 -04:00
Tom Alexander
e30a2ddb9e Disable oneTBB tests.
oneTBB tests hang forever on machines with only one CPU core. Since my NixOS builder is a virtual machine with only one core, I am disabling the tests.

ref: https://github.com/uxlfoundation/oneTBB/issues/1557
2026-06-21 22:14:14 -04:00
Tom Alexander
53b3717b6c Fix branch for family disks target in nix_builder. 2026-06-18 17:11:02 -04:00
Tom Alexander
0cf4139392 Fix launching shikane.
This was failing because the latest version of shikane opens the config file as read+write.
2026-06-18 10:38:23 -04:00
Tom Alexander
6094fee196 Enable the thunderbolt service. 2026-06-17 13:08:11 -04:00
Tom Alexander
9e4c079258 Update packages. 2026-06-13 22:05:23 -04:00
Tom Alexander
3ab7a6e460 Update packages. 2026-06-13 22:05:23 -04:00
Tom Alexander
49f75408ae Move kernel config to its own role. 2026-06-13 22:05:23 -04:00
Tom Alexander
0fa170c57e Preserve .vscode-shared.
The latest vscode is storing data in ~/.vscode-shared that contains the "Open Recent" entries and the settings on which folders are trusted.
2026-05-27 13:24:16 -04:00
Tom Alexander
3050cece0c Do not force import the root zfs pool. 2026-05-25 22:20:08 -04:00
Tom Alexander
6d070ddbb4 Update packages. 2026-05-25 22:20:08 -04:00
Tom Alexander
f99fa54d60 Revert "Update only the kernel."
This reverts commit d52b5db39b.
2026-05-21 20:31:54 -04:00
Tom Alexander
d52b5db39b Update only the kernel. 2026-05-21 20:31:27 -04:00
Tom Alexander
003c3cc41a Fix rnnoise after latest update. 2026-05-07 17:00:03 -04:00
Tom Alexander
d83652bb9c Add rsync_clone script. 2026-05-06 10:02:20 -04:00
Tom Alexander
6fd09a712e Add git_fix_author script. 2026-05-06 10:00:02 -04:00
Tom Alexander
d9c4f824d2 Add git_find_merged_branches script. 2026-05-06 09:56:18 -04:00
Tom Alexander
856e4daee6 Add the decode_jwt script. 2026-05-06 09:49:47 -04:00
Tom Alexander
9a9268f8cc Disable shipwright.
The hash is not matching, so the build is broken.
2026-05-05 22:42:17 -04:00
Tom Alexander
8d3ebf7ba2 Update packages. 2026-05-01 20:16:45 -04:00
Tom Alexander
d35cfaacbd Add nix-pin-revision script. 2026-04-26 08:32:17 -04:00
Tom Alexander
8b1212e182 Support hardware accelerated RNG in qemurc. 2026-04-26 08:32:17 -04:00
Tom Alexander
7f0250cb9d Sync to the store before registering paths. 2026-04-26 08:32:17 -04:00
Tom Alexander
bc2636a54c New VPN address for home server. 2026-04-26 08:32:17 -04:00
Tom Alexander
c8147b5e9e Use direct paths for hydra's nix store.
I was getting corrupted builds, so as a test I am using the direct path where the drive is mounted rather than going through bind mounts.
2026-04-26 08:32:17 -04:00
Tom Alexander
4115e95bb6 Add a build of nixbsd to nix_builder. 2026-04-26 08:32:17 -04:00
Tom Alexander
4c1465c8d0 Update packages. 2026-04-26 08:32:17 -04:00
Tom Alexander
791f67eb82 Update nix_builder. 2026-04-02 22:03:45 -04:00
Tom Alexander
bf27504a5a Add repair flag to build scripts. 2026-04-02 14:14:11 -04:00
Tom Alexander
620c12eaa7 Add auto-formatting for d2. 2026-04-02 14:04:04 -04:00
225 changed files with 10454 additions and 263 deletions

View File

@@ -0,0 +1,12 @@
* To-do
** Perhaps use overlay for /etc for speedup
#+begin_src nix
system.etc.overlay.enable = true;
#+end_src
** read https://nixos.org/manual/nixos/stable/
** Performance for mini pc
#+begin_src nix
security.pam.loginLimits = [
{ domain = "@users"; item = "rtprio"; type = "-"; value = 1; }
];
#+end_src

View File

@@ -1,9 +1,16 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: }:
let
alias_nix_pin_revision = pkgs.writeShellScriptBin "nix-pin-revision" ''
# Usage: nix-pin-revision nixpkgs 'github:NixOS/nixpkgs/00c21e4c93d963c50d4c0c89bfa84ed6e0694df2'
exec nix flake lock --override-input "''${@}"
'';
in
{ {
imports = [ imports = [
./roles/2ship2harkinian ./roles/2ship2harkinian
@@ -47,6 +54,7 @@
./roles/iso_mount ./roles/iso_mount
./roles/jujutsu ./roles/jujutsu
./roles/kanshi ./roles/kanshi
./roles/kernel
./roles/kodi ./roles/kodi
./roles/kubernetes ./roles/kubernetes
./roles/latex ./roles/latex
@@ -119,6 +127,9 @@
nix.settings.max-free = 1000000000; nix.settings.max-free = 1000000000;
nix.settings.fallback = true; nix.settings.fallback = true;
nix.settings.warn-dirty = false; nix.settings.warn-dirty = false;
nix.settings.fsync-metadata = true;
# Ensure store paths are durably written to disk before registering the paths so a crash mid-build does not leave us in a corrupted state.
nix.settings.fsync-store-paths = true;
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
@@ -129,7 +140,8 @@
# Automatic garbage collection # Automatic garbage collection
nix.gc = lib.mkIf (!config.me.buildingPortable) { nix.gc = lib.mkIf (!config.me.buildingPortable) {
# Runs nix-collect-garbage --delete-older-than 5d # Runs nix-collect-garbage --delete-older-than 5d
automatic = true; # automatic = true;
automatic = false;
persistent = true; persistent = true;
dates = "monthly"; dates = "monthly";
# randomizedDelaySec = "14m"; # randomizedDelaySec = "14m";
@@ -137,6 +149,10 @@
}; };
nix.settings.auto-optimise-store = !config.me.buildingPortable; nix.settings.auto-optimise-store = !config.me.buildingPortable;
environment.systemPackages = [
alias_nix_pin_revision
];
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) { environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true; hideMounts = true;
directories = [ directories = [
@@ -220,22 +236,18 @@
); );
in in
[ [
(disableTests "coreutils") (disableTests "deno") # Tests use too much disk space
(disableTests "coreutils-full") (disableOptimizations "libtpms")
(disableTests "libuv")
(final: prev: {
inherit (final.unoptimized) libtpms libjxl;
})
(disableOptimizationsPython3 "scipy") (disableOptimizationsPython3 "scipy")
# Works but probably sets python2's scipy to be python3: (disableOptimizations "assimp")
# (disableOptimizations "gsl")
# (final: prev: { (final: prev: {
# pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ rpcs3 = prev.rpcs3.override {
# (python-final: python-prev: { glew = (final.glew.override { enableEGL = false; });
# scipy = final.unoptimized.python3Packages.scipy; };
# }) })
# ]; (disableTests "onetbb") # oneTBB tests hang forever on machines with a single core (like my build virtual machine) https://github.com/uxlfoundation/oneTBB/issues/1557
# }) (disableTests "aws-c-common") # aws-c-common tests time out on my build virtual machine but run fine on my laptop.
]; ];
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,

View File

@@ -22,11 +22,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769524058, "lastModified": 1781152676,
"narHash": "sha256-zygdD6X1PcVNR2PsyK4ptzrVEiAdbMqLos7utrMDEWE=", "narHash": "sha256-RxWs5ND31KzTG7wvMM+PMfUjyNpmIEr999lqNARaM5o=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "71a3fc97d80881e91710fe721f1158d3b96ae14d", "rev": "ff8702b4de27f72b4c78573dfb89ec74e36abdf1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -162,13 +162,34 @@
"type": "github" "type": "github"
} }
}, },
"nix_builder": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1785248363,
"narHash": "sha256-hx9Cn1vIa/h54t+s3ObO6+Z3xHSA1zc3YVRWxTZcigc=",
"ref": "refs/heads/main",
"rev": "0addf91edf82775a0dc5022a81065ef101305e64",
"revCount": 38,
"type": "git",
"url": "https://code.fizz.buzz/talexander/nix_builder.git"
},
"original": {
"type": "git",
"url": "https://code.fizz.buzz/talexander/nix_builder.git"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1770197578, "lastModified": 1785318670,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "narHash": "sha256-dN6Ou5x/+23FZLEpYP3IffO+NyJFzUlGumt1uu3MMaY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "rev": "0954f7ee2f6bb3dc7d4e3d0d8bcb8fd4bde4cfc5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -226,6 +247,7 @@
"disko": "disko", "disko": "disko",
"impermanence": "impermanence", "impermanence": "impermanence",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nix_builder": "nix_builder",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
}, },
@@ -249,6 +271,27 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "type": "github"
} }
},
"rust-overlay_2": {
"inputs": {
"nixpkgs": [
"nix_builder",
"nixpkgs"
]
},
"locked": {
"lastModified": 1779506148,
"narHash": "sha256-OffE5yuMrSW71zIJNLvtl9MCO6WTAHEjlFPUCvkd/QM=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d9973e2ab49747fada06ebbe26cda27eb0220cf1",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@@ -28,6 +28,10 @@
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix_builder = {
url = "git+https://code.fizz.buzz/talexander/nix_builder.git";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
@@ -37,6 +41,7 @@
disko, disko,
impermanence, impermanence,
lanzaboote, lanzaboote,
nix_builder,
... ...
}: }:
let let
@@ -68,7 +73,7 @@
hostname: nodeConfig: format: hostname: nodeConfig: format:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit self; inherit self nix_builder;
this_nixos_config = self.nixosConfigurations."${hostname}"; this_nixos_config = self.nixosConfigurations."${hostname}";

View File

@@ -10,4 +10,4 @@ TARGET=family_disks
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#family_disks" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#family_disks" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -10,4 +10,4 @@ TARGET=family_disks
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#family_disks" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#family_disks" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#family_disks.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#family_disks.iso" --repair --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -9,4 +9,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -14,6 +14,7 @@
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=local?root=/.disk/root";
}; };
}; };
} }

View File

@@ -10,4 +10,4 @@ TARGET=hydra
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -10,4 +10,4 @@ TARGET=hydra
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#hydra.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#hydra.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#hydra.vm_iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#hydra.vm_iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -129,6 +129,8 @@
# systemd.user.extraConfig = "DefaultLimitNOFILE=8192"; # systemd.user.extraConfig = "DefaultLimitNOFILE=8192";
# systemd.services."user@11400".serviceConfig.LimitNOFILE = "8192"; # systemd.services."user@11400".serviceConfig.LimitNOFILE = "8192";
nix.settings.secret-key-files = [ "/persist/manual/nix/nix-cache-key.sec" ];
me.build_in_ram.enable = true; me.build_in_ram.enable = true;
me.dont_use_substituters.enable = true; me.dont_use_substituters.enable = true;
me.hydra.enable = true; me.hydra.enable = true;

View File

@@ -10,4 +10,4 @@ TARGET=i_only_boot_zfs
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#i_only_boot_zfs" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#i_only_boot_zfs" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -10,4 +10,4 @@ TARGET=i_only_boot_zfs
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#i_only_boot_zfs" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#i_only_boot_zfs" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#i_only_boot_zfs.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#i_only_boot_zfs.iso" --repair --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -12,6 +12,6 @@ TARGET=neelix
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#neelix' # rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#neelix'

View File

@@ -12,6 +12,6 @@ TARGET=neelix
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#neelix' # rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#neelix'

View File

@@ -10,4 +10,4 @@ TARGET=odo
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -10,4 +10,4 @@ TARGET=odo
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odo.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odo.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -5,8 +5,7 @@ IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
: "${NOM:="true"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -110,6 +110,7 @@
me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml; me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml;
me.jujutsu.enable = true; me.jujutsu.enable = true;
me.kanshi.enable = false; me.kanshi.enable = false;
me.kernel.enable = true;
me.kubernetes.enable = true; me.kubernetes.enable = true;
me.latex.enable = true; me.latex.enable = true;
me.launch_keyboard.enable = true; me.launch_keyboard.enable = true;
@@ -164,7 +165,7 @@
me.zsh.enable = true; me.zsh.enable = true;
me.sm64ex.enable = true; me.sm64ex.enable = true;
me.shipwright.enable = true; me.shipwright.enable = false;
me.ship2harkinian.enable = true; me.ship2harkinian.enable = true;
}; };
} }

View File

@@ -14,6 +14,7 @@
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=local?root=/.disk/root";
}; };
}; };
} }

View File

@@ -8,4 +8,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TARGET=odowork TARGET=odowork
nixos-rebuild boot --flake "$DIR/../../#odowork" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#odowork" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -8,4 +8,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TARGET=odowork TARGET=odowork
nixos-rebuild switch --flake "$DIR/../../#odowork" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#odowork" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -6,4 +6,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odowork.installer" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odowork.installer" --repair --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -6,4 +6,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odowork.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odowork.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -6,4 +6,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -6,4 +6,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -6,4 +6,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -111,6 +111,7 @@
me.iso_mount.enable = true; me.iso_mount.enable = true;
me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml; me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml;
me.jujutsu.enable = true; me.jujutsu.enable = true;
me.kernel.enable = true;
me.latex.enable = true; me.latex.enable = true;
me.launch_keyboard.enable = true; me.launch_keyboard.enable = true;
me.lvfs.enable = true; me.lvfs.enable = true;

View File

@@ -14,6 +14,7 @@
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=local?root=/.disk/root";
}; };
}; };
} }

View File

@@ -10,4 +10,4 @@ TARGET=quark
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -10,4 +10,4 @@ TARGET=quark
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#quark.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#quark.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -104,6 +104,7 @@
me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml; me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml;
me.jujutsu.enable = true; me.jujutsu.enable = true;
me.kanshi.enable = false; me.kanshi.enable = false;
me.kernel.enable = true;
me.kubernetes.enable = true; me.kubernetes.enable = true;
me.latex.enable = true; me.latex.enable = true;
me.launch_keyboard.enable = true; me.launch_keyboard.enable = true;
@@ -159,7 +160,7 @@
me.zsh.enable = true; me.zsh.enable = true;
me.sm64ex.enable = true; me.sm64ex.enable = true;
me.shipwright.enable = true; me.shipwright.enable = false;
me.ship2harkinian.enable = true; me.ship2harkinian.enable = true;
}; };
} }

View File

@@ -8,6 +8,7 @@
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;
}; };
substituter_url = "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=local?root=/.disk/root";
}; };
}; };
} }

View File

@@ -10,4 +10,4 @@ TARGET=recovery
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#recovery" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --flake "$DIR/../../#recovery" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -10,4 +10,4 @@ TARGET=recovery
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#recovery" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --flake "$DIR/../../#recovery" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#recovery.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#recovery.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#recovery" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#recovery" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#recovery" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#recovery" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -7,4 +7,4 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}" : "${JOBS:="1"}"
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#recovery" --log-format internal-json -v "${@}" |& nom --json nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#recovery" --repair --log-format internal-json -v "${@}" |& nom --json

View File

@@ -14,6 +14,12 @@ let
cleanup_temporary_files = ( cleanup_temporary_files = (
patchScriptBin "cleanup_temporary_files" (builtins.readFile ./files/cleanup_temporary_files.bash) patchScriptBin "cleanup_temporary_files" (builtins.readFile ./files/cleanup_temporary_files.bash)
); );
decode_jwt = (patchScriptBin "decode_jwt" (builtins.readFile ./files/decode_jwt.bash));
git_find_merged_branches = (
patchScriptBin "git_find_merged_branches" (builtins.readFile ./files/git_find_merged_branches.bash)
);
git_fix_author = (patchScriptBin "git_fix_author" (builtins.readFile ./files/git_fix_author.bash));
rsync_clone = (patchScriptBin "rsync_clone" (builtins.readFile ./files/rsync_clone.bash));
alias_rga = pkgs.writeShellScriptBin "rga" '' alias_rga = pkgs.writeShellScriptBin "rga" ''
exec ${pkgs.ripgrep}/bin/rg -uuu "''${@}" exec ${pkgs.ripgrep}/bin/rg -uuu "''${@}"
''; '';
@@ -59,8 +65,12 @@ in
nix-output-monitor # For better view into nixos-rebuild nix-output-monitor # For better view into nixos-rebuild
# nix-serve-ng # Serve nix store over http # nix-serve-ng # Serve nix store over http
cleanup_temporary_files cleanup_temporary_files
decode_jwt
jq jq
inetutils # For whois inetutils # For whois
git_find_merged_branches
git_fix_author
rsync_clone
]; ];
}; };
} }

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Delete temporary files on entire disk # Delete temporary files on entire disk
find / -type f '(' -name '*.orig' -or -name '*~' -or -name '*.core' ')' -delete -print 2>/dev/null set -euo pipefail
IFS=$'\n\t'
exec find / -type f '(' -name '*.orig' -or -name '*~' -or -name '*.core' ')' -delete -print 2>/dev/null

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
# Decode the contents of a JWT
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec jq -R 'split(".") | .[0],.[1] | gsub("-"; "+") | gsub("_"; "/") | gsub("%3D"; "=")| @base64d | fromjson'

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
# Find local branches that have been merged
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: ${MAIN_BRANCH:="main"}
git checkout -q ${MAIN_BRANCH} && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base ${MAIN_BRANCH} $branch) && [[ $(git cherry ${MAIN_BRANCH} $(git commit-tree $(git rev-parse "$branch^{tree}") -p $mergeBase -m _)) == "-"* ]] && echo "$branch"; done

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
git filter-branch --env-filter '
WRONG_EMAIL="old@email.foo"
NEW_NAME="New Name"
NEW_EMAIL="new@email.bar"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_AUTHOR_NAME="$NEW_NAME"
export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
fi
' --tag-name-filter cat --commit-filter 'git commit-tree -S "$@";' -- --branches --tags

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
# Wrapper to set rsync flags for cloning a folder preserving attributes
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec rsync -aHAXS "$@"

View File

@@ -56,28 +56,19 @@ let
# "aarch64-linux" # "aarch64-linux"
]; ];
hostName = lib.mkForce "hydra?remote-store=local?root=/home/nixworker/persist/root"; hostName = lib.mkForce "hydra?remote-store=local?root=/.disk/root";
}; };
}; };
joined_configs = substituters_list = (
lib.genAttrs map (
(builtins.filter (hostname: config.me.distributed_build.machines."${hostname}".enable) (
builtins.attrNames all_nixos_configs
))
(
hostname: hostname:
(lib.mkMerge [ (lib.mkIf (
{ config.me.distributed_build.machines."${hostname}".enable
hostName = hostname; && config.me.distributed_build.machines."${hostname}".substituter_url != null
sshUser = "nixworker"; ) (config.me.distributed_build.machines."${hostname}".substituter_url))
sshKey = "/persist/manual/ssh/root/keys/id_ed25519"; ) (builtins.attrNames all_nixos_configs)
maxJobs = 1;
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features;
}
static_host_configs."${hostname}"
config.me.distributed_build.machines."${hostname}".additional_config
])
); );
has_any_substituters = substituters_list != [ ];
in in
{ {
imports = [ ]; imports = [ ];
@@ -101,7 +92,7 @@ in
# Using an ssh-based substituter slows down the build because querying the remote store for paths takes ages. # Using an ssh-based substituter slows down the build because querying the remote store for paths takes ages.
# #
# nix.settings.substituters = lib.mkForce [ # nix.settings.substituters = lib.mkForce [
# "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=/home/nixworker/persist/root" # "ssh-ng://nixworker@ns1.fizz.buzz:65122?compress=true&ssh-key=/persist/manual/ssh/root/keys/id_ed25519&remote-store=/.disk/root"
# ]; # ];
# nix.settings.substitute = lib.mkForce true; # nix.settings.substitute = lib.mkForce true;
@@ -117,6 +108,7 @@ in
"odo:0S/XKSFjjIrihQ7lbHEIebXk/c/xuoodhm0Gz26YhjA=" "odo:0S/XKSFjjIrihQ7lbHEIebXk/c/xuoodhm0Gz26YhjA="
"odowork:zg3UKBAyLy3xtZkL0hMtbxHjxgn5A2QY8NNAgyRT6Yo=" "odowork:zg3UKBAyLy3xtZkL0hMtbxHjxgn5A2QY8NNAgyRT6Yo="
"quark:Eb6ygkIiVlcUqb5hOjEVIQcfYLpCz40YVYA3/rxrgBc=" "quark:Eb6ygkIiVlcUqb5hOjEVIQcfYLpCz40YVYA3/rxrgBc="
"hydra:1s4Cy9YJLgw4jWx5jdSCfJmIm0hfya7WEy/EwJYI5Ys="
]; ];
} }
{ {
@@ -140,12 +132,10 @@ in
) (builtins.attrNames all_nixos_configs) ) (builtins.attrNames all_nixos_configs)
); );
} }
# { (lib.mkIf has_any_substituters {
# nix.settings.substitute = lib.mkForce true; nix.settings.substitute = lib.mkForce true;
# nix.settings.substituters = lib.mkForce ( nix.settings.substituters = lib.mkForce substituters_list;
# lib.mapAttrsToList (hostname: joined_config: "ssh-ng://${joined_config.hostName}") joined_configs })
# );
# }
] ]
); );
} }

View File

@@ -27,6 +27,29 @@
) )
) )
(defun run-command-on-buffer-require-output (cmd &rest args)
"Run a command using the current buffer as stdin and replacing its contents if the command succeeds with the stdout from the command. This is useful for code formatters. This version only replaces the buffer contents if the command output some text."
(let (
(stdout-buffer (generate-new-buffer "tmp-stdout" t))
(full-cmd (append '(call-process-region nil nil cmd nil stdout-buffer nil) args))
)
(unwind-protect
(let ((exit-status (eval full-cmd)))
(if (eq exit-status 0)
(if (> (buffer-size stdout-buffer) 0)
(save-excursion
(replace-buffer-contents stdout-buffer)
)
(message "No output from command on buffer %s" (append (list cmd) args))
)
(message "FAILED running command on buffer %s" (append (list cmd) args))
)
)
(kill-buffer stdout-buffer)
)
)
)
(defun run-command-in-directory (dir cmd &rest args) (defun run-command-in-directory (dir cmd &rest args)
"Run a command in the specified directory. If the directory is nil, the directory of the file is used. The stdout result is trimmed of whitespace and returned." "Run a command in the specified directory. If the directory is nil, the directory of the file is used. The stdout result is trimmed of whitespace and returned."
(let ( (let (

View File

@@ -1,14 +1,14 @@
(defun d2-format-buffer () (defun d2-format-buffer ()
"Run prettier." "Run prettier."
(interactive) (interactive)
(run-command-on-buffer "d2" "fmt" "-") (run-command-on-buffer-require-output "d2" "fmt" "-")
) )
(use-package d2-mode (use-package d2-mode
:commands (d2-mode) :commands (d2-mode)
:hook ( :hook (
(d2-mode . (lambda () (d2-mode . (lambda ()
;; (add-hook 'before-save-hook 'd2-format-buffer nil 'local) (add-hook 'before-save-hook 'd2-format-buffer nil 'local)
)) ))
) )
) )

View File

@@ -24,7 +24,16 @@
networking.firewall.allowedUDPPorts = [ networking.firewall.allowedUDPPorts = [
5353 # mDNS 5353 # mDNS
]; ];
# networking.firewall.enable = true;
# networking.nftables.enable = true;
# Or disable the firewall altogether. # Or disable the firewall altogether.
# networking.firewall.enable = false; networking.firewall.enable = false;
# Debugging
# networking.firewall.logRefusedConnections = true;
# networking.firewall.logRefusedPackets = true;
# networking.firewall.logReversePathDrops = true;
}; };
} }

View File

@@ -34,7 +34,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
mesa-demos # for glxgears mesa-demos # for glxgears
vulkan-tools # for vkcube vulkan-tools # for vkcube
xorg.xeyes # to test which windows are using x11 xeyes # to test which windows are using x11
]; ];
hardware.graphics.enable = true; hardware.graphics.enable = true;
# hardware.graphics.enable32Bit = true; # hardware.graphics.enable32Bit = true;

View File

@@ -2,56 +2,10 @@
config, config,
lib, lib,
pkgs, pkgs,
nix_builder,
... ...
}: }:
let
# patchScriptBin =
# {
# filename,
# contents,
# path ? [ ],
# }:
# ((pkgs.writeScriptBin filename contents).overrideAttrs (old: {
# buildInputs = [ pkgs.makeWrapper ];
# buildCommand = "${old.buildCommand}\n patchShebangs $out\nwrapProgram $out/bin/${filename} --prefix PATH : ${lib.makeBinPath path}";
# }));
nix_builder = pkgs.rustPlatform.buildRustPackage rec {
pname = "nix_builder";
version = "0.0.0";
src = pkgs.fetchgit {
url = "https://code.fizz.buzz/talexander/nix_builder.git";
# tag = version;
rev = "d0fc2331e7aadc8bdd98836b466172ac37628e7d";
hash = "sha256-V1DU9U4+k96KfGV9BTxKYjxLzV6tWvQPM+a+5NU94G8=";
leaveDotGit = false;
};
cargoLock = {
lockFile = "${src}/Cargo.lock";
};
meta = with lib; {
description = "A builder of nix configs for a build server.";
homepage = "https://code.fizz.buzz/talexander/nix_builder";
license = licenses.bsd0;
maintainers = [ ];
};
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/nix-builder --prefix PATH : ${
lib.makeBinPath [
pkgs.git
pkgs.nix
pkgs.nixos-rebuild
]
}
'';
};
in
{ {
imports = [ ]; imports = [ ];
@@ -66,7 +20,7 @@ in
config = lib.mkIf config.me.hydra.enable { config = lib.mkIf config.me.hydra.enable {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
nix_builder nix_builder.packages.x86_64-linux.default
sqlite # For manually inspecting the database. sqlite # For manually inspecting the database.
]; ];
@@ -85,11 +39,11 @@ in
}; };
# Nix 2.30.0 (2025-07-07) changed the build directory from /tmp to /nix/var/nix/builds which broke a number of builds because my ZFS datasets were utf8only. # Nix 2.30.0 (2025-07-07) changed the build directory from /tmp to /nix/var/nix/builds which broke a number of builds because my ZFS datasets were utf8only.
fileSystems."/home/nixworker/persist/root/nix/var/nix/builds" = { fileSystems."/.disk/root/nix/var/nix/builds" = {
device = "tmpfs"; device = "tmpfs";
fsType = "tmpfs"; fsType = "tmpfs";
options = [ options = [
"size=40G" # adjust for your situation and needs "size=50G" # adjust for your situation and needs
"mode=700" "mode=700"
"uid=11400" "uid=11400"
"gid=11400" "gid=11400"
@@ -104,13 +58,48 @@ in
}; };
}; };
systemd.services."build-cache" = { systemd.services."build-cache" =
let
enabled_targets = [
"odo"
"odo_update"
"odowork"
"odowork_update"
"quark"
"quark_update"
"hydra"
"hydra_update"
"controller0"
"controller0_update"
"controller1"
"controller1_update"
"controller2"
"controller2_update"
"worker0"
"worker0_update"
"worker1"
"worker1_update"
"worker2"
"worker2_update"
"family_disks"
"family_disks_update"
"nixbsd"
"nix_builder_develop"
"organic_develop"
"natter_develop"
];
build_flags = lib.concatMap (target: [
"--target"
(lib.escapeShellArg target)
]) enabled_targets;
in
{
script = '' script = ''
set -euo pipefail set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
DIR="$( cd "$( dirname "''${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "''${BASH_SOURCE[0]}" )" && pwd )"
NIX_REMOTE='local?root=/home/nixworker/persist/root' RUST_BACKTRACE=1 RUST_LOG=nix_builder=DEBUG ${nix_builder}/bin/nix-builder build --config ${./files/nix_builder.toml} --target odo --target odo_update --target odowork --target odowork_update --target quark --target quark_update --target hydra --target hydra_update --target controller0 --target controller0_update --target controller1 --target controller1_update --target controller2 --target controller2_update --target worker0 --target worker0_update --target worker1 --target worker1_update --target worker2 --target worker2_update --target family_disks --target family_disks_update NIX_REMOTE='local?root=/.disk/root' RUST_BACKTRACE=1 RUST_LOG=nix_builder=DEBUG ${nix_builder.packages.x86_64-linux.default}/bin/nix-builder build --config ${./files/nix_builder.toml} ${builtins.concatStringsSep " " build_flags}
''; '';
restartIfChanged = false; restartIfChanged = false;
serviceConfig = { serviceConfig = {
@@ -124,13 +113,13 @@ in
# TODO: This should move into nix-builder so we can only run clean when builds are passing. Otherwise partial builds will lose progress. # TODO: This should move into nix-builder so we can only run clean when builds are passing. Otherwise partial builds will lose progress.
# TODO: In nix-builder maybe include setting to auto delete to make room during builds if we run out of space, just in case builds are failing for a long time and prevent cleanup from running. # TODO: In nix-builder maybe include setting to auto delete to make room during builds if we run out of space, just in case builds are failing for a long time and prevent cleanup from running.
systemd.timers."clean-cache" = { # systemd.timers."clean-cache" = {
wantedBy = [ "timers.target" ]; # wantedBy = [ "timers.target" ];
timerConfig = { # timerConfig = {
OnCalendar = "*-*-01 02:00:00 America/New_York"; # OnCalendar = "*-*-01 02:00:00 America/New_York";
Unit = "clean-cache.service"; # Unit = "clean-cache.service";
}; # };
}; # };
systemd.services."clean-cache" = { systemd.services."clean-cache" = {
script = '' script = ''
@@ -138,7 +127,7 @@ in
IFS=$'\n\t' IFS=$'\n\t'
DIR="$( cd "$( dirname "''${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "''${BASH_SOURCE[0]}" )" && pwd )"
NIX_REMOTE='local?root=/home/nixworker/persist/root' nix-collect-garbage -d NIX_REMOTE='local?root=/.disk/root' nix-collect-garbage -d
''; '';
path = with pkgs; [ path = with pkgs; [
pkgs.nix pkgs.nix

View File

@@ -67,113 +67,141 @@ output_directory = "/home/nixworker/persist/nix_builder"
[[targets]] [[targets]]
name = "controller0" name = "controller0"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "controller0.vm_iso" attr = "controller0.vm_iso"
[[targets]] [[targets]]
name = "controller0_update" name = "controller0_update"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "controller0.vm_iso" attr = "controller0.vm_iso"
update = true update = true
update_branch = "kubernetes_update" update_branch = "nix_update"
[[targets]] [[targets]]
name = "controller1" name = "controller1"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "controller1.vm_iso" attr = "controller1.vm_iso"
[[targets]] [[targets]]
name = "controller1_update" name = "controller1_update"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "controller1.vm_iso" attr = "controller1.vm_iso"
update = true update = true
update_branch = "kubernetes_update" update_branch = "nix_update"
[[targets]] [[targets]]
name = "controller2" name = "controller2"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "controller2.vm_iso" attr = "controller2.vm_iso"
[[targets]] [[targets]]
name = "controller2_update" name = "controller2_update"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "controller2.vm_iso" attr = "controller2.vm_iso"
update = true update = true
update_branch = "kubernetes_update" update_branch = "nix_update"
[[targets]] [[targets]]
name = "worker0" name = "worker0"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "worker0.vm_iso" attr = "worker0.vm_iso"
[[targets]] [[targets]]
name = "worker0_update" name = "worker0_update"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "worker0.vm_iso" attr = "worker0.vm_iso"
update = true update = true
update_branch = "kubernetes_update" update_branch = "nix_update"
[[targets]] [[targets]]
name = "worker1" name = "worker1"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "worker1.vm_iso" attr = "worker1.vm_iso"
[[targets]] [[targets]]
name = "worker1_update" name = "worker1_update"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "worker1.vm_iso" attr = "worker1.vm_iso"
update = true update = true
update_branch = "kubernetes_update" update_branch = "nix_update"
[[targets]] [[targets]]
name = "worker2" name = "worker2"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "worker2.vm_iso" attr = "worker2.vm_iso"
[[targets]] [[targets]]
name = "worker2_update" name = "worker2_update"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "kubernetes" branch = "nix"
path = "nix/kubernetes" path = "nix/kubernetes"
attr = "worker2.vm_iso" attr = "worker2.vm_iso"
update = true update = true
update_branch = "kubernetes_update" update_branch = "nix_update"
# TODO: Add steam deck # TODO: Add steam deck
[[targets]] [[targets]]
name = "family_disks" name = "family_disks"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "family_disks" branch = "nix"
path = "nix/configuration" path = "nix/configuration"
attr = "nixosConfigurations.family_disks.config.system.build.toplevel" attr = "nixosConfigurations.family_disks.config.system.build.toplevel"
[[targets]] [[targets]]
name = "family_disks_update" name = "family_disks_update"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "family_disks" branch = "nix"
path = "nix/configuration" path = "nix/configuration"
attr = "nixosConfigurations.family_disks.config.system.build.toplevel" attr = "nixosConfigurations.family_disks.config.system.build.toplevel"
update = true update = true
update_branch = "nix_update" update_branch = "nix_update"
[[targets]]
name = "nixbsd"
repo = "https://github.com/nixos-bsd/nixbsd.git"
revision = "2b512eda58e6d77378bd20d6027802b158942e24"
path = "."
attr = "base.vmClosureInfo"
[[targets]]
name = "nix_builder_develop"
repo = "https://code.fizz.buzz/talexander/nix_builder.git"
branch = "main"
path = "."
attr = "devShells.x86_64-linux.default"
[[targets]]
name = "organic_develop"
repo = "https://code.fizz.buzz/talexander/organic.git"
branch = "main"
path = "."
attr = "devShells.x86_64-linux.default"
[[targets]]
name = "natter_develop"
repo = "https://code.fizz.buzz/talexander/natter.git"
branch = "main"
path = "."
attr = "devShells.x86_64-linux.default"

View File

@@ -0,0 +1,194 @@
# Check current config:
# nix build '/persist/machine_setup/nix/configuration#nixosConfigurations.hydra.pkgs.linux_me.configfile'
# cat $(nix eval --raw '/persist/machine_setup/nix/configuration#nixosConfigurations.hydra.pkgs.linux_me.configfile') | less
{
config,
lib,
pkgs,
...
}:
let
preemption_type = with lib.kernel; {
full = {
PREEMPT_DYNAMIC = yes;
PREEMPT = yes;
PREEMPT_VOLUNTARY = lib.mkForce no;
PREEMPT_LAZY = lib.mkForce no;
PREEMPT_NONE = no;
};
lazy = {
PREEMPT_DYNAMIC = yes;
PREEMPT = no;
PREEMPT_VOLUNTARY = lib.mkForce no;
PREEMPT_LAZY = yes;
PREEMPT_NONE = no;
};
voluntary = {
PREEMPT_DYNAMIC = no;
PREEMPT = no;
PREEMPT_VOLUNTARY = yes;
PREEMPT_LAZY = lib.mkForce no;
PREEMPT_NONE = no;
};
none = {
PREEMPT_DYNAMIC = no;
PREEMPT = no;
PREEMPT_VOLUNTARY = lib.mkForce no;
PREEMPT_LAZY = lib.mkForce no;
PREEMPT_NONE = yes;
};
};
tick_hz =
with lib.kernel;
{
"1000" = {
HZ_1000 = yes;
HZ = freeform "1000";
};
}
// lib.genAttrs [ "100" "250" "300" "500" "600" "750" ] (hz: {
HZ_1000 = no;
"HZ_${hz}" = yes;
HZ = freeform hz;
});
performance_governor = with lib.kernel; {
default = {
CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = yes;
};
performance = {
CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = no;
CPU_FREQ_DEFAULT_GOV_PERFORMANCE = yes;
};
};
tick_rate = with lib.kernel; {
# Always tick at the hz frequency.
periodic = {
NO_HZ_IDLE = no;
NO_HZ_FULL = no;
NO_HZ = no;
NO_HZ_COMMON = no;
HZ_PERIODIC = yes;
};
# Idle - Do not disturb the CPU when idle. This can save power but increase latency.
idle = {
HZ_PERIODIC = no;
NO_HZ_FULL = no;
NO_HZ_IDLE = yes;
NO_HZ = yes;
NO_HZ_COMMON = yes;
};
# Full dyntick system (tickless) - The kernel tries to shut down the tick whenever possible.
tickless = {
HZ_PERIODIC = no;
NO_HZ_IDLE = no;
NO_HZ_FULL = yes;
NO_HZ = yes;
NO_HZ_COMMON = yes;
CONTEXT_TRACKING = yes;
};
};
huge_page = with lib.kernel; {
always = {
TRANSPARENT_HUGEPAGE_MADVISE = no;
TRANSPARENT_HUGEPAGE_ALWAYS = yes;
};
madvise = {
TRANSPARENT_HUGEPAGE_ALWAYS = no;
TRANSPARENT_HUGEPAGE_MADVISE = yes;
};
};
common_config =
with lib.kernel;
{
# Google's BBRv3 TCP congestion Control
TCP_CONG_BBR = yes;
DEFAULT_BBR = yes;
};
flavors = {
server = lib.mkMerge [
preemption_type.none
tick_hz."300"
performance_governor.default
tick_rate.tickless
huge_page.madvise
];
interactive =
with lib.kernel;
lib.mkMerge [
{
# Enable RCU Lazy - Reduces power consumption when idle or lightly loaded. Useful for battery-powered devices like laptops.
RCU_LAZY = yes;
}
preemption_type.lazy
tick_hz."300"
performance_governor.default
tick_rate.tickless
huge_page.madvise
];
};
in
{
imports = [ ];
options.me = {
kernel.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install kernel.";
};
kernel.version = lib.mkOption {
type = lib.types.str;
default = "linux"; # LTS
example = "linux_6_18";
description = "What version of the kernl should we use.";
};
kernel.flavor = lib.mkOption {
type = lib.types.str;
default = "interactive";
example = "server";
description = "What type of kernel should be built.";
};
};
config = lib.mkIf config.me.kernel.enable (
lib.mkMerge [
{
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
}
(lib.mkIf (!config.me.optimizations.enable) {
nixpkgs.overlays = [
(final: prev: {
linux_me = final."${config.me.kernel.version}";
})
];
})
(lib.mkIf (config.me.optimizations.enable) {
nixpkgs.overlays = [
(
final: prev:
let
addConfig =
additionalConfig: pkg:
pkg.override (oldconfig: {
structuredExtraConfig = lib.mkMerge ([ pkg.structuredExtraConfig ] ++ additionalConfig);
# stdenv = pkgs.llvmPackages_latest.stdenv;
# stdenv = pkgs.clangStdenv;
});
in
{
linux_me = addConfig ([
common_config
flavors."${config.me.kernel.flavor}"
]) final."${config.me.kernel.version}";
}
)
];
})
]
);
}

View File

@@ -25,8 +25,8 @@
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
tex = ( tex = (
pkgs.texlive.combine { pkgs.texliveSmall.withPackages (
inherit (pkgs.texlive) ps: with ps; [
scheme-basic scheme-basic
dvisvgm dvisvgm
dvipng # for preview and export as html in org-mode dvipng # for preview and export as html in org-mode
@@ -44,8 +44,8 @@
upquote # emacs org-mode pdf export upquote # emacs org-mode pdf export
lineno # emacs org-mode pdf export lineno # emacs org-mode pdf export
beamer # emacs org-mode presentation pdf export beamer # emacs org-mode presentation pdf export
; ]
} )
); );
}) })
]; ];

View File

@@ -19,6 +19,7 @@
config = lib.mkIf config.me.minimal_base.enable { config = lib.mkIf config.me.minimal_base.enable {
me.doas.enable = true; me.doas.enable = true;
me.kernel.enable = true;
me.network.enable = true; me.network.enable = true;
me.nvme.enable = true; me.nvme.enable = true;
me.ssh.enable = true; me.ssh.enable = true;

View File

@@ -56,14 +56,27 @@ in
# TODO: The 127.0.0.1 address should probably be moved to a host-specific file. # TODO: The 127.0.0.1 address should probably be moved to a host-specific file.
networking.extraHosts = '' networking.extraHosts = ''
127.0.0.1 ${config.networking.hostName}.home.arpa 127.0.0.1 ${config.networking.hostName}.home.arpa
10.216.1.1 homeserver 127.0.0.3 metadata.google.internal
10.216.1.32 homeserver
fdfd:5e8a:ee2d::1:32 homeserver
10.216.1.6 media 10.216.1.6 media
10.216.1.12 odo 10.216.1.12 odo
fdfd:5e8a:ee2d::1:2 odo
10.216.1.14 neelix 10.216.1.14 neelix
10.216.1.15 quark 10.216.1.15 quark
fdfd:5e8a:ee2d::1:3 quark
10.217.1.1 drmario 10.217.1.1 drmario
10.217.2.1 mrmanager 10.217.2.1 mrmanager
fdfd:5e8a:ee2d::2:2 mrmanager
172.16.16.1 unifi
172.16.16.231 plug1
172.16.16.232 plug2
172.16.16.233 plug3
172.16.16.234 plug4
172.16.16.235 temperature1
172.16.16.236 temperature2
172.16.16.245 turtle 172.16.16.245 turtle
172.16.16.250 sauna
172.16.16.251 stream 172.16.16.251 stream
''; '';

View File

@@ -1,7 +1,6 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: }:
@@ -49,65 +48,13 @@
}; };
config = lib.mkMerge [ config = lib.mkMerge [
(lib.mkIf (!config.me.optimizations.enable) (
lib.mkMerge [
{
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_18;
# boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux;
}
]
))
(lib.mkIf config.me.optimizations.enable ( (lib.mkIf config.me.optimizations.enable (
lib.mkMerge [ lib.mkMerge [
{ {
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
nixpkgs.hostPlatform = { nixpkgs.hostPlatform = {
gcc.arch = config.me.optimizations.arch; gcc.arch = config.me.optimizations.arch;
gcc.tune = config.me.optimizations.arch; gcc.tune = config.me.optimizations.arch;
}; };
nixpkgs.overlays = [
(
final: prev:
let
addConfig =
additionalConfig: pkg:
pkg.override (oldconfig: {
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
});
in
{
linux_me = addConfig {
# Full preemption
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no;
# Google's BBRv3 TCP congestion Control
TCP_CONG_BBR = lib.kernel.yes;
DEFAULT_BBR = lib.kernel.yes;
# Preemptive Full Tickless Kernel at 300Hz
HZ = lib.kernel.freeform "300";
HZ_300 = lib.kernel.yes;
HZ_1000 = lib.kernel.no;
} prev.linux_6_18; # or prev.linux
}
)
(final: prev: {
inherit (final.unoptimized)
assimp
binaryen
gsl
rapidjson
ffmpeg-headless
ffmpeg
pipewire
chromaprint
gtkmm
;
})
];
} }
] ]
)) ))

View File

@@ -50,6 +50,23 @@
DOCKER_HOST = "unix://$XDG_RUNTIME_DIR/podman/podman.sock"; DOCKER_HOST = "unix://$XDG_RUNTIME_DIR/podman/podman.sock";
}; };
# Increase subuid / subgid to support running buildkit-rootless
# ref: https://github.com/moby/buildkit/issues/3297
users.users.talexander = {
subUidRanges = [
{
startUid = 100000;
count = 262144; # default = 65536
}
];
subGidRanges = [
{
startGid = 100000;
count = 262144; # default = 65536
}
];
};
environment.persistence."/state" = lib.mkIf (config.me.mountPersistence) { environment.persistence."/state" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true; hideMounts = true;
directories = [ directories = [

View File

@@ -355,6 +355,7 @@ function start_body {
-smp cores="$CPU_CORES" -smp cores="$CPU_CORES"
-m "$MEMORY" -m "$MEMORY"
-rtc base=localtime -rtc base=localtime
-device virtio-rng-pci
-drive "file=\"@OVMFfd@/FV/OVMF_CODE.fd\",if=pflash,format=raw,readonly=on" -drive "file=\"@OVMFfd@/FV/OVMF_CODE.fd\",if=pflash,format=raw,readonly=on"
-drive "if=pflash,format=raw,file=\"$(readlink -f "${mount_path}/OVMF_VARS.fd")\"" -drive "if=pflash,format=raw,file=\"$(readlink -f "${mount_path}/OVMF_VARS.fd")\""
-drive "if=none,file=/dev/zvol/${zfs_path}/disk0,format=raw,id=hd0" -drive "if=none,file=/dev/zvol/${zfs_path}/disk0,format=raw,id=hd0"

View File

@@ -29,7 +29,7 @@
} }
(lib.mkIf config.me.graphical { (lib.mkIf config.me.graphical {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
ddrescueview #ddrescueview
]; ];
}) })
] ]

View File

@@ -53,6 +53,8 @@ in
rpcs3 rpcs3
]; ];
allowedUnfree = [ "rpcs3" ];
security.pam.loginLimits = [ security.pam.loginLimits = [
{ {
domain = "@wheel"; domain = "@wheel";

View File

@@ -37,6 +37,9 @@ in
me.install.user.talexander.file = { me.install.user.talexander.file = {
".config/shikane/config.toml" = { ".config/shikane/config.toml" = {
source = ./files/config.toml; source = ./files/config.toml;
# Shikane opens with write permissions, so we need a regular file, not a symlink to the nix store.
method = "overwrite";
mode = "0644";
}; };
}; };
}; };

View File

@@ -18,7 +18,10 @@
}; };
config = lib.mkIf (config.me.sm64ex.enable && config.me.graphical) { config = lib.mkIf (config.me.sm64ex.enable && config.me.graphical) {
allowedUnfree = [ "sm64ex" ]; allowedUnfree = [
"sm64ex"
"baserom.us.z64"
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
sm64ex sm64ex

View File

@@ -30,7 +30,7 @@
# If you want to use JACK applications, uncomment this # If you want to use JACK applications, uncomment this
#jack.enable = true; #jack.enable = true;
extraLv2Packages = [ pkgs.rnnoise-plugin ]; extraLadspaPackages = [ pkgs.rnnoise-plugin.ladspa ];
configPackages = [ configPackages = [
(pkgs.writeTextDir "share/pipewire/pipewire.conf.d/99-input-denoising.conf" '' (pkgs.writeTextDir "share/pipewire/pipewire.conf.d/99-input-denoising.conf" ''
context.modules = [ context.modules = [
@@ -43,7 +43,7 @@
{ {
type = ladspa type = ladspa
name = rnnoise name = rnnoise
plugin = "${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so" plugin = "librnnoise_ladspa"
label = noise_suppressor_mono label = noise_suppressor_mono
control = { control = {
"VAD Threshold (%)" = 50.0 "VAD Threshold (%)" = 50.0

View File

@@ -94,6 +94,9 @@ let
output 'Unknown 0x095F 0x00000000' scale 1.5 output 'Unknown 0x095F 0x00000000' scale 1.5
output 'BOE 0x095F Unknown' scale 1.5 output 'BOE 0x095F Unknown' scale 1.5
output 'BOE 0x0BCA Unknown' scale 1.5 output 'BOE 0x0BCA Unknown' scale 1.5
# Breaks screen sharing:
# output 'Dell Inc. DELL U3014 P1V6N35M329L' render_bit_depth 10
''; '';
}; };
window-management = pkgs.writeTextFile { window-management = pkgs.writeTextFile {

View File

@@ -26,7 +26,7 @@ let
# Maybe add --audio flag? can optionally specify specific device name from `@pactl@ list sources | @grep@ Name` # Maybe add --audio flag? can optionally specify specific device name from `@pactl@ list sources | @grep@ Name`
bindsym $mod+Shift+print exec @wl-screenrec@ -g "$(@slurp@)" --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')" bindsym $mod+Shift+print exec @wl-screenrec@ -g "$(@slurp@)" --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')"
bindsym Shift+print exec @wl-screenrec@ --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')" bindsym Shift+print exec @wl-screenrec@ --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')"
bindsym $mod+ctrl+Shift+print exec pkill -SIGINT @wl-screenrec@ bindsym $mod+ctrl+Shift+print exec pkill -SIGINT -f @wl-screenrec@
# Need to make a hotkey to end the recording # Need to make a hotkey to end the recording
''; '';
}; };

View File

@@ -21,5 +21,18 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bolt # For boltctl bolt # For boltctl
]; ];
services.hardware.bolt.enable = true;
# Trust all thunderbolt devices
# services.udev.packages = [
# (pkgs.writeTextFile {
# name = "removable";
# text = ''
# ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
# '';
# destination = "/etc/udev/rules.d/99-removable.rules";
# })
# ];
}; };
} }

View File

@@ -121,6 +121,12 @@ in
group = "talexander"; group = "talexander";
mode = "0755"; mode = "0755";
} }
{
directory = ".vscode-shared";
user = "talexander";
group = "talexander";
mode = "0755";
}
]; ];
}; };
}; };

View File

@@ -20,8 +20,9 @@
config = lib.mkIf (config.me.wine.enable && config.me.graphical) { config = lib.mkIf (config.me.wine.enable && config.me.graphical) {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# wineWowPackages.stable # supports 32 + 64 bit # wineWowPackages.stable # supports 32 + 64 bit
wineWowPackages.waylandFull # Supports 32 + 64 bit with native wayland support. wineWow64Packages.waylandFull # Supports 32 + 64 bit with native wayland support.
# winetricks # winetricks
# lutris
]; ];
}; };
} }

View File

@@ -44,6 +44,9 @@ in
boot.zfs.devNodes = "/dev/disk/by-partuuid"; boot.zfs.devNodes = "/dev/disk/by-partuuid";
# Do not force import your root pool during boot. Force importing would be useful if the pool had been imported by a different machine most recently.
boot.zfs.forceImportRoot = false;
services.zfs = { services.zfs = {
autoScrub = { autoScrub = {
enable = true; enable = true;

1
nix/kubernetes/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
result

132
nix/kubernetes/README.org Normal file
View File

@@ -0,0 +1,132 @@
* To-do
** Perhaps use overlay for /etc for speedup
#+begin_src nix
system.etc.overlay.enable = true;
#+end_src
** read https://nixos.org/manual/nixos/stable/
** Performance for mini pc
#+begin_src nix
security.pam.loginLimits = [
{ domain = "@users"; item = "rtprio"; type = "-"; value = 1; }
];
#+end_src
* IP Ranges
| | IPv4 | IPv6 |
|--------------------------------+-----------------------------+-----------------------------------------|
| Pod | 10.200.0.0/16 | 2620:11f:7001:7:ffff:eeee::/96 |
| Service | 10.197.0.0/16 | fd00:3e42:e349::/112 |
| Node | 10.215.1.0/24 | 2620:11f:7001:7:ffff:ffff:0ad7:0100/120 |
| Load Balancer | 74.80.180.139-74.80.180.142 | 2620:11f:7001:7:ffff:dddd::/96 |
| Load Balancer Private (unused) | 10.198.0.0/16 | fd9c:0bd5:22a4::/112 |
| PowerDNS from inside cluster | 10.215.1.211 | |
* Healthcheck
** Check cilium status
#+begin_src bash
kubectl -n kube-system exec ds/cilium -- cilium-dbg status --verbose
kubectl -n kube-system exec ds/cilium -- cilium-dbg status | grep KubeProxyReplacement
#+end_src
** Check connectivity
#+begin_src bash
cilium connectivity test
#+end_src
** Show dropped packets
#+begin_src bash
kubectl -n kube-system exec ds/cilium -- cilium-dbg monitor --type drop
#+end_src
** Show dropped packets for a specific pod
#+begin_src bash
kubectl -n kube-system exec ds/cilium -- hubble observe --since 30s --pod cnpg-system/cnpg-controller-manager-84d498b97-q5m4n --type drop
#+end_src
** Install flux
#+begin_src bash
nix shell 'nixpkgs#fluxcd'
flux bootstrap git \
--url=ssh://git@<host>/<org>/<repository> \
--branch=main \
--private-key-file=<path/to/private.key> \
--password=<key-passphrase> \
--path=clusters/my-cluster
#+end_src
#+begin_src bash
nix shell 'nixpkgs#kubernetes-helm'
helm template --dry-run=server flux-operator oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator \
--namespace flux-system \
--create-namespace
#+end_src
#+begin_src text
apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
metadata:
name: flux
namespace: flux-system
annotations:
fluxcd.controlplane.io/reconcileEvery: "1h"
fluxcd.controlplane.io/reconcileTimeout: "5m"
spec:
distribution:
version: "2.x"
registry: "ghcr.io/fluxcd"
artifact: "oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests"
components:
- source-controller
- kustomize-controller
- helm-controller
- notification-controller
- image-reflector-controller
- image-automation-controller
cluster:
type: kubernetes
size: medium
multitenant: false
networkPolicy: true
domain: "cluster.local"
kustomize:
patches:
- target:
kind: Deployment
patch: |
- op: replace
path: /spec/template/spec/nodeSelector
value:
kubernetes.io/os: linux
- op: add
path: /spec/template/spec/tolerations
value:
- key: "CriticalAddonsOnly"
operator: "Exists"
sync:
kind: OCIRepository
url: "oci://ghcr.io/my-org/my-fleet-manifests"
ref: "latest"
path: "clusters/my-cluster"
pullSecret: "ghcr-auth"
#+end_src
#+begin_src text
apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
metadata:
name: flux
namespace: flux-system
spec:
distribution:
version: "2.7.x"
registry: "ghcr.io/fluxcd"
sync:
kind: GitRepository
url: "ssh://git@10.215.1.210:22/repos/mrmanager"
ref: "refs/heads/nix"
path: "clusters/my-cluster"
pullSecret: "flux-system"
#+end_src
#+begin_src bash
flux create secret git flux-system \
--url=https://gitlab.com/my-org/my-fleet.git \
--username=git \
--password=$GITLAB_TOKEN
#+end_src

View File

@@ -0,0 +1,149 @@
{
config,
lib,
...
}:
{
imports = [
./roles/boot
./roles/cilium
./roles/containerd
./roles/control_plane
./roles/debugging
./roles/doas
./roles/dont_use_substituters
./roles/etcd
./roles/firewall
./roles/image_based_appliance
./roles/iso
./roles/kernel
./roles/kube_apiserver
./roles/kube_controller_manager
./roles/kube_proxy
./roles/kube_scheduler
./roles/kubelet
./roles/kubernetes
./roles/minimal_base
./roles/network
./roles/nvme
./roles/optimized_build
./roles/ssh
./roles/sshd
./roles/user
./roles/worker_node
./roles/zsh
./util/install_files
./util/unfree_polyfill
];
config = {
nix.settings.experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
# "blake3-hashes"
# "git-hashing"
];
nix.settings.trusted-users = [ "@wheel" ];
hardware.enableRedistributableFirmware = true;
# Keep outputs so we can build offline.
nix.settings.keep-outputs = true;
nix.settings.keep-derivations = true;
# Automatic garbage collection
nix.gc = lib.mkIf (!config.me.buildingPortable) {
# Runs nix-collect-garbage --delete-older-than 5d
automatic = true;
persistent = true;
dates = "monthly";
# randomizedDelaySec = "14m";
options = "--delete-older-than 30d";
};
nix.settings.auto-optimise-store = !config.me.buildingPortable;
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
directories = [
"/var/lib/nixos" # Contains user information (uids/gids)
"/var/lib/systemd" # Systemd state directory for random seed, persistent timers, core dumps, persist hardware state like backlight and rfkill
"/var/log/journal" # Logs, alternatively set `services.journald.storage = "volatile";` to write to /run/log/journal
];
files = [
"/etc/machine-id" # Systemd unique machine id "otherwise, the system journal may fail to list earlier boots, etc"
];
};
# Write a list of the currently installed packages to /etc/current-system-packages
# environment.etc."current-system-packages".text =
# let
# packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
# sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
# formatted = builtins.concatStringsSep "\n" sortedUnique;
# in
# formatted;
# nixpkgs.overlays = [
# (final: prev: {
# foot = throw "foo";
# })
# ];
nixpkgs.overlays =
let
disableTests = (
package_name:
(final: prev: {
"${package_name}" = prev."${package_name}".overrideAttrs (old: {
doCheck = false;
doInstallCheck = false;
});
})
);
in
[
# (final: prev: {
# imagemagick = prev.imagemagick.overrideAttrs (old: rec {
# # 7.1.2-6 seems to no longer exist, so use 7.1.2-7
# version = "7.1.2-7";
# src = final.fetchFromGitHub {
# owner = "ImageMagick";
# repo = "ImageMagick";
# tag = version;
# hash = "sha256-9ARCYftoXiilpJoj+Y+aLCEqLmhHFYSrHfgA5DQHbGo=";
# };
# });
# })
# (final: prev: {
# grub2 = (final.callPackage ./package/grub { });
# })
(final: prev: {
inherit (final.unoptimized)
libtpms
;
})
];
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.11"; # Did you read the comment?
};
}

256
nix/kubernetes/flake.lock generated Normal file
View File

@@ -0,0 +1,256 @@
{
"nodes": {
"crane": {
"locked": {
"lastModified": 1731098351,
"narHash": "sha256-HQkYvKvaLQqNa10KEFGgWHfMAbWBfFp+4cAgkut+NNE=",
"owner": "ipetkov",
"repo": "crane",
"rev": "ef80ead953c1b28316cc3f8613904edc2eb90c28",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1781152676,
"narHash": "sha256-RxWs5ND31KzTG7wvMM+PMfUjyNpmIEr999lqNARaM5o=",
"owner": "nix-community",
"repo": "disko",
"rev": "ff8702b4de27f72b4c78573dfb89ec74e36abdf1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"lanzaboote",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"lanzaboote",
"pre-commit-hooks-nix",
"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": [
"impermanence",
"nixpkgs"
]
},
"locked": {
"lastModified": 1768598210,
"narHash": "sha256-kkgA32s/f4jaa4UG+2f8C225Qvclxnqs76mf8zvTVPg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c47b2cc64a629f8e075de52e4742de688f930dc6",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"impermanence": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1769548169,
"narHash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "7b1d382faf603b6d264f58627330f9faa5cba149",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"lanzaboote": {
"inputs": {
"crane": "crane",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1737639419,
"narHash": "sha256-AEEDktApTEZ5PZXNDkry2YV2k6t0dTgLPEmAZbnigXU=",
"owner": "nix-community",
"repo": "lanzaboote",
"rev": "a65905a09e2c43ff63be8c0e86a93712361f871e",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v0.4.2",
"repo": "lanzaboote",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1784120854,
"narHash": "sha256-KesHgItiZPgGX740axSiQLcIQ8D24MDqNpkKYWIek8k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "753cc8a3a87467296ddd1fa93f0cc3e81120ee46",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1730741070,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": [
"lanzaboote",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"lanzaboote",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1731363552,
"narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
"impermanence": "impermanence",
"lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"lanzaboote",
"nixpkgs"
]
},
"locked": {
"lastModified": 1731897198,
"narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "0be641045af6d8666c11c2c40e45ffc9667839b5",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

183
nix/kubernetes/flake.nix Normal file
View File

@@ -0,0 +1,183 @@
# Get a repl for this flake
# nix repl --expr "builtins.getFlake \"$PWD\""
# TODO maybe use `nix eval --raw .#odo.iso.outPath`
#
# Install on a new machine:
#
# Set
# me.disko.enable = true;
# me.disko.offline.enable = true;
#
# Run
# doas disko --mode destroy,format,mount hosts/recovery/disk-config.nix
# doas nixos-install --substituters "http://10.0.2.2:8080?trusted=1 https://cache.nixos.org/" --flake ".#recovery"
{
description = "My system configuration";
inputs = {
impermanence = {
url = "github:nix-community/impermanence";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
disko,
impermanence,
lanzaboote,
...
}:
let
forAllSystems =
func:
builtins.listToAttrs (
map (system: {
name = system;
value = func system;
}) nixpkgs.lib.systems.flakeExposed
);
nodes = {
controller0 = {
system = "x86_64-linux";
};
controller1 = {
system = "x86_64-linux";
};
controller2 = {
system = "x86_64-linux";
};
worker0 = {
system = "x86_64-linux";
};
worker1 = {
system = "x86_64-linux";
};
worker2 = {
system = "x86_64-linux";
};
};
nixosConfigs = builtins.mapAttrs (
hostname: nodeConfig: format:
nixpkgs.lib.nixosSystem {
specialArgs = {
inherit self;
this_nixos_config = self.nixosConfigurations."${hostname}";
all_nixos_configs = self.nixosConfigurations;
};
modules = [
impermanence.nixosModules.impermanence
lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
./configuration.nix
(./. + "/hosts/${hostname}")
(./. + "/formats/${format}.nix")
{
config = {
nixpkgs.hostPlatform.system = nodeConfig.system;
nixpkgs.overlays = [
(final: prev: {
# stable = nixpkgs-stable.legacyPackages."${prev.stdenv.hostPlatform.system}";
unoptimized = import nixpkgs {
system = prev.stdenv.hostPlatform.system;
hostPlatform.gcc.arch = "default";
hostPlatform.gcc.tune = "default";
};
})
];
};
}
(
{
config,
lib,
pkgs,
...
}:
let
nix-self-repl = pkgs.writeShellScriptBin "nix-self-repl" ''
source /etc/set-environment
nix repl --expr 'builtins.getFlake "${self}"'
'';
# If we wanted the current version of a flake then we'd just launch
# nix repl
# and then run:
# :lf /path/to/flake
in
{
config = {
environment.systemPackages = lib.mkIf config.nix.enable [ nix-self-repl ];
};
}
)
];
}
) nodes;
installerConfig =
hostname: nodeConfig:
nixpkgs.lib.nixosSystem {
specialArgs = {
targetSystem = self.nixosConfigurations."${hostname}";
};
modules = [
./formats/installer.nix
(
{
config,
lib,
pkgs,
...
}:
let
nix-self-repl = pkgs.writeShellScriptBin "nix-self-repl" ''
source /etc/set-environment
nix repl --expr 'builtins.getFlake "${self}"'
'';
# If we wanted the current version of a flake then we'd just launch
# nix repl
# and then run:
# :lf /path/to/flake
in
{
config = {
environment.systemPackages = lib.mkIf config.nix.enable [ nix-self-repl ];
};
}
)
({ nixpkgs.hostPlatform.system = nodeConfig.system; })
];
};
in
{
nixosConfigurations = (builtins.mapAttrs (name: value: value "toplevel") nixosConfigs);
}
// {
packages = (
forAllSystems (
system:
(builtins.mapAttrs (hostname: nodeConfig: {
iso = (nixosConfigs."${hostname}" "iso").config.system.build.isoImage;
vm_iso = (nixosConfigs."${hostname}" "vm_iso").config.system.build.isoImage;
sd = (nixosConfigs."${hostname}" "sd").config.system.build.sdImage;
installer = (installerConfig hostname nodes."${hostname}").config.system.build.isoImage;
}) (nixpkgs.lib.attrsets.filterAttrs (hostname: nodeConfig: nodeConfig.system == system) nodes))
)
);
};
}

View File

@@ -0,0 +1,74 @@
{
config,
pkgs,
lib,
modulesPath,
targetSystem,
...
}:
let
installer = pkgs.writeShellApplication {
name = "installer";
runtimeInputs = with pkgs; [
# clevis
dosfstools
e2fsprogs
gawk
nixos-install-tools
util-linux
config.nix.package
];
text = ''
set -euo pipefail
${targetSystem.config.system.build.diskoScript}
nixos-install --no-channel-copy --no-root-password --option substituters "" --system ${targetSystem.config.system.build.toplevel}
'';
};
installerFailsafe = pkgs.writeShellScript "failsafe" ''
${lib.getExe installer} || echo "ERROR: Installation failure!"
sleep 3600
'';
in
{
imports = [
(modulesPath + "/installer/cd-dvd/iso-image.nix")
(modulesPath + "/profiles/all-hardware.nix")
];
# boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_17;
# boot.zfs.package = pkgs.zfs_unstable;
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux;
boot.kernelParams = [
"quiet"
"systemd.unit=getty.target"
];
boot.supportedFilesystems.zfs = true;
boot.initrd.systemd.enable = true;
networking.hostId = "04581ecf";
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
isoImage.squashfsCompression = "zstd -Xcompression-level 15";
environment.systemPackages = [
installer
];
systemd.services."getty@tty1" = {
overrideStrategy = "asDropin";
serviceConfig = {
ExecStart = [
""
installerFailsafe
];
Restart = "no";
StandardInput = "null";
};
};
# system.stateVersion = lib.mkDefault lib.trivial.release;
system.stateVersion = "24.11";
}

View File

@@ -0,0 +1,36 @@
{
config,
lib,
modulesPath,
pkgs,
...
}:
{
imports = [
(modulesPath + "/installer/cd-dvd/iso-image.nix")
];
config = {
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
networking.dhcpcd.enable = true;
networking.useDHCP = true;
me.buildingPortable = true;
me.disko.enable = true;
me.disko.offline.enable = true;
me.mountPersistence = lib.mkForce false;
# me.optimizations.enable = lib.mkForce false;
# Not doing image_based_appliance because this might be an install ISO, in which case we'd need nix to do the install.
# me.image_based_appliance.enable = true;
# TODO: Should I use this instead of doing a mkIf for the disk config?
# disko.enableConfig = false;
# Faster image generation for testing/development.
isoImage.squashfsCompression = "zstd -Xcompression-level 15";
};
}

View File

@@ -0,0 +1,32 @@
{
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/sd-card/sd-image.nix")
];
config = {
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
# TODO: image based appliance?
# TODO: Maybe this?
# fileSystems = {
# "/" = {
# device = "/dev/disk/by-label/NIXOS_SD";
# fsType = "ext4";
# options = [
# "noatime"
# "norelatime"
# ];
# };
# };
};
}

View File

@@ -0,0 +1 @@
{ }

View File

@@ -0,0 +1,22 @@
{
lib,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/cd-dvd/iso-image.nix")
(modulesPath + "/profiles/qemu-guest.nix") # VirtIO kernel modules
];
config = {
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
networking.dhcpcd.enable = true;
networking.useDHCP = true;
me.image_based_appliance.enable = true;
};
}

View File

@@ -0,0 +1,24 @@
{
pkgs,
...
}:
let
to_yaml_file =
file_name: contents:
let
settingsFormat = pkgs.formats.yaml { };
yaml_file = settingsFormat.generate file_name contents;
in
yaml_file;
to_yaml =
file_name: contents:
let
settingsFormat = pkgs.formats.yaml { };
yaml_file = settingsFormat.generate file_name contents;
yaml_content = builtins.readFile yaml_file;
in
yaml_content;
in
{
inherit to_yaml to_yaml_file;
}

Some files were not shown because too many files have changed in this diff Show More