30 Commits

Author SHA1 Message Date
Tom Alexander
a6667f8424 Support installing pi extensions.. 2026-12-02 12:43:13 -05:00
Tom Alexander
a152cf9935 Enable quark distributed build on work machine. 2026-12-01 17:58:19 -05:00
Tom Alexander
53931b217a Install claude code into the robot VM. 2026-11-24 18:04:52 -05:00
Tom Alexander
e28625ea8a Install python in the robot vm. 2026-11-23 12:40:37 -05:00
Tom Alexander
2c2c044072 Fix building packages on my builder VM. 2026-11-23 12:40:37 -05:00
Tom Alexander
c1e25b0365 Merge branch 'robot' into nix 2026-11-20 13:26:37 -05:00
Tom Alexander
6d35630589 Add a host for a virtual machine for agent coding. 2026-11-19 17:16:43 -05:00
Tom Alexander
fd5b247408 Add a wip_kubernetes build target for nix_builder. 2026-11-12 15:56:03 -05:00
Tom Alexander
bd03c5ec08 Disable firefox's disk cache and limit memory usage. 2026-11-12 15:38:02 -05:00
Tom Alexander
1965d29c43 Apply the same fixes to kubernetes. 2026-11-12 14:19:44 -05:00
Tom Alexander
f3e78d5226 Add a "wip" target in nix_builder for testing updates. 2026-11-12 13:56:38 -05:00
Tom Alexander
9ffa43acbb Eliminate this_nixos_config as a specialArg. 2026-11-12 13:49:48 -05:00
Tom Alexander
d8690ad2df Eliminate all_nixos_configs. 2026-11-12 13:46:00 -05:00
Tom Alexander
9665025e13 Rework flake.nix to use extendModules. 2026-11-12 13:42:37 -05:00
Tom Alexander
e4a4f79509 Update packages. 2026-11-04 13:45:42 -05:00
Tom Alexander
a30aea1cfc Persist freerdp certs. 2026-11-03 13:54:01 -05:00
Tom Alexander
3b6fc4fe79 Fix path for mt7927 bluetooth firmware. 2026-11-01 11:44:34 -05:00
Tom Alexander
b647fc2599 Merge branch 'bubblewrap' into nix 2026-11-01 11:43:35 -05:00
Tom Alexander
128a9be453 Add a role for flatpak. 2026-10-31 18:39:04 -04:00
Tom Alexander
14f2084a06 Disable bubblewrap and lutris. 2026-10-31 16:25:33 -04:00
Tom Alexander
5176f729ca Add a role for lutris. 2026-10-31 09:44:38 -04:00
Tom Alexander
ae9683b8a9 Enable wine on odo. 2026-10-31 09:44:38 -04:00
Tom Alexander
5e949e1013 Add a role for installing bubblewrap. 2026-10-31 09:44:35 -04:00
Tom Alexander
12ff1c2812 Preserve the cached extensions in vscode. 2026-10-30 15:22:22 -04:00
Tom Alexander
00e852e1e5 Merge branch 'instawow' into nix 2026-10-28 19:42:33 -04:00
Tom Alexander
a7b2c0fc63 With the latest updates, we no longer need to patch the versions of instawow and aiohttp-client-cache. 2026-10-28 15:23:48 -04:00
Tom Alexander
b0dbf88de3 Update packages. 2026-10-28 15:20:37 -04:00
Tom Alexander
bb62d01ab7 Update instawow. 2026-10-25 17:31:02 -04:00
Tom Alexander
6bbfc23d3a Update aiohttp-client-cache.
The current version in nixpkgs has not been updated for aiohttp 3.14.

Error: TypeError: ClientResponse.__init__() missing 1 required keyword-only argument: 'stream_writer'
2026-10-25 17:31:01 -04:00
Tom Alexander
140d675f06 Add install of instawow. 2026-10-25 17:29:04 -04:00
44 changed files with 953 additions and 175 deletions

View File

@@ -22,9 +22,11 @@ in
./roles/base ./roles/base
./roles/bluetooth ./roles/bluetooth
./roles/boot ./roles/boot
./roles/bubblewrap
./roles/build_in_ram ./roles/build_in_ram
./roles/chromecast ./roles/chromecast
./roles/chromium ./roles/chromium
./roles/claude
./roles/d2 ./roles/d2
./roles/direnv ./roles/direnv
./roles/disko ./roles/disko
@@ -35,6 +37,7 @@ in
./roles/ecc ./roles/ecc
./roles/emacs ./roles/emacs
./roles/emulate_isa ./roles/emulate_isa
./roles/flatpak
./roles/esim ./roles/esim
./roles/exfat ./roles/exfat
./roles/firefox ./roles/firefox
@@ -51,6 +54,7 @@ in
./roles/graphviz ./roles/graphviz
./roles/hydra ./roles/hydra
./roles/image_based_appliance ./roles/image_based_appliance
./roles/instawow
./roles/iso ./roles/iso
./roles/iso_mount ./roles/iso_mount
./roles/jujutsu ./roles/jujutsu
@@ -60,6 +64,7 @@ in
./roles/kubernetes ./roles/kubernetes
./roles/latex ./roles/latex
./roles/launch_keyboard ./roles/launch_keyboard
./roles/lutris
./roles/lvfs ./roles/lvfs
./roles/media ./roles/media
./roles/memtest86 ./roles/memtest86
@@ -75,6 +80,7 @@ in
./roles/openpgp_card_tools ./roles/openpgp_card_tools
./roles/optimized_build ./roles/optimized_build
./roles/pcsx2 ./roles/pcsx2
./roles/pi_coding_agent
./roles/podman ./roles/podman
./roles/postgresql_client ./roles/postgresql_client
./roles/python ./roles/python
@@ -82,6 +88,7 @@ in
./roles/rdp_client ./roles/rdp_client
./roles/recovery ./roles/recovery
./roles/reset ./roles/reset
./roles/robot
./roles/rpcs3 ./roles/rpcs3
./roles/rust ./roles/rust
./roles/sequoia ./roles/sequoia
@@ -282,6 +289,16 @@ in
(disableOptimizations "zopfli") (disableOptimizations "zopfli")
(disableOptimizations "nototools") # Needs to use the same version of python as the zopfli package (disableOptimizations "nototools") # Needs to use the same version of python as the zopfli package
(disableOptimizations "lib2geom") # Tests failing: ellipse-test, elliptical-arc-test, line-test, polynomial-test (disableOptimizations "lib2geom") # Tests failing: ellipse-test, elliptical-arc-test, line-test, polynomial-test
(disableOptimizations "libjpeg_turbo") # Test failing: djpeg12-shared-3x2-float-prog-cmp
(disableOptimizations "libjxl") # Test failing, but only on my builder VM. I assume related to AVX512: DjxlFuzzerTestInstantiation
(disableOptimizationsScope "kdePackages" "qtbase") # Issue with my bhyve VM: Incompatible processor. This Qt build requires the following features: avx512ifma avx512vbmi avx512vbmi2 gfni avx512bitalg avx512vpopcntdq
(disableOptimizationsScope "libsForQt5" "qtbase") # Issue with my bhyve VM: Incompatible processor. This Qt build requires the following features: avx512ifma avx512vbmi avx512vbmi2 gfni avx512bitalg avx512vpopcntdq
(disableOptimizationsScope "qt6Packages" "qtbase") # Issue with my bhyve VM: Incompatible processor. This Qt build requires the following features: avx512ifma avx512vbmi avx512vbmi2 gfni avx512bitalg avx512vpopcntdq
(disableOptimizations "qt5") # Issue with my bhyve VM: Incompatible processor. This Qt build requires the following features: avx512ifma avx512vbmi avx512vbmi2 gfni avx512bitalg avx512vpopcntdq
(disableOptimizations "qt6") # Issue with my bhyve VM: Incompatible processor. This Qt build requires the following features: avx512ifma avx512vbmi avx512vbmi2 gfni avx512bitalg avx512vpopcntdq
(disableTests "sequoia-sq") # Test failing on my builder vm: sq_key_generate_dev_null
(disableOptimizations "tzdata") # Tests failing on my builder vm
(disableOptimizations "simdutf") # Tests failing on my builder vm
]; ];
hardware.firmware = hardware.firmware =
@@ -293,8 +310,8 @@ in
in in
[ [
(pkgs.runCommand "mediatek-custom-firmware" { } '' (pkgs.runCommand "mediatek-custom-firmware" { } ''
mkdir -p $out/lib/firmware/mediatek mkdir -p $out/lib/firmware/mediatek/mt7927
cp ${mt6639_bt_firmware} $out/lib/firmware/mediatek/BT_RAM_CODE_MT6639_2_1_hdr.bin cp ${mt6639_bt_firmware} $out/lib/firmware/mediatek/mt7927/BT_RAM_CODE_MT6639_2_1_hdr.bin
'') '')
]; ];

View File

@@ -22,11 +22,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1789770686, "lastModified": 1792526520,
"narHash": "sha256-uZkBR7yHdIKUFB5SZdfgh1qkGfI3XmYmI/lTiquxbck=", "narHash": "sha256-3hSJlv8mUVnZPMWK2+CM7a9O+nR6Z4mCh27NfLCmTPc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "725ea35e410ad83be4931d1bff7e090eacaf3563", "rev": "cedd626e11b635470fa6f9fdb8ad79b0075dd7f9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -123,11 +123,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769548169, "lastModified": 1792739756,
"narHash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=", "narHash": "sha256-s0TeXWG5Ci75Y/Hzon0Z7NrN/fG773Rc54/z6oPFszQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "impermanence", "repo": "impermanence",
"rev": "7b1d382faf603b6d264f58627330f9faa5cba149", "rev": "fa627f4c8b8e92f58f58a73d99ee4e1304e64eb2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -185,11 +185,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1791260994, "lastModified": 1793540411,
"narHash": "sha256-Miqqk/ammqnTUxaoCyvtwoPeLbI1ksFyLxi/CazZpWY=", "narHash": "sha256-fiPJ88izTVucjeo2EQ3jk4aWmLg03I1D4vxnX2QjEgE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4", "rev": "0bb2eedc20e4739f29e8045034f2828ad7054f8f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -45,7 +45,14 @@
... ...
}: }:
let let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; forAllSystems =
func:
builtins.listToAttrs (
map (system: {
name = system;
value = func system;
}) nixpkgs.lib.systems.flakeExposed
);
nodes = { nodes = {
odo = { odo = {
system = "x86_64-linux"; system = "x86_64-linux";
@@ -68,42 +75,53 @@
family_disks = { family_disks = {
system = "x86_64-linux"; system = "x86_64-linux";
}; };
robot = {
system = "x86_64-linux";
};
}; };
nixosConfigs = builtins.mapAttrs ( baseConfig = nixpkgs.lib.nixosSystem {
hostname: nodeConfig: format: specialArgs = {
nixpkgs.lib.nixosSystem { inherit self nix_builder;
specialArgs = { };
inherit self nix_builder; modules = [
impermanence.nixosModules.impermanence
this_nixos_config = self.nixosConfigurations."${hostname}"; lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
all_nixos_configs = self.nixosConfigurations; ./configuration.nix
}; {
config = {
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";
};
})
];
};
}
];
};
toplevelConfigs = builtins.mapAttrs (
hostname: nodeConfig:
baseConfig.extendModules {
modules = [ modules = [
impermanence.nixosModules.impermanence
lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
./configuration.nix
(./. + "/hosts/${hostname}") (./. + "/hosts/${hostname}")
(./. + "/formats/${format}.nix")
{ {
config = { config = {
nixpkgs.hostPlatform.system = nodeConfig.system; 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";
};
})
];
}; };
} }
]; ];
} }
) nodes; ) nodes;
specialFormats =
nixosConfig: format:
nixosConfig.extendModules {
modules = [ (./. + "/formats/${format}.nix") ];
};
installerConfig = installerConfig =
hostname: nodeConfig: hostname: nodeConfig:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
@@ -117,18 +135,39 @@
}; };
in in
{ {
nixosConfigurations = (builtins.mapAttrs (name: value: value "toplevel") nixosConfigs); nixosConfigurations = toplevelConfigs;
} }
// { // {
packages = ( packages = (
forAllSystems ( forAllSystems (
system: system:
(builtins.mapAttrs (hostname: nodeConfig: { let
iso = (nixosConfigs."${hostname}" "iso").config.system.build.isoImage; machines = (
vm_iso = (nixosConfigs."${hostname}" "vm_iso").config.system.build.isoImage; builtins.mapAttrs (hostname: nodeConfig: {
sd = (nixosConfigs."${hostname}" "sd").config.system.build.sdImage; iso = (specialFormats self.nixosConfigurations."${hostname}" "iso").config.system.build.isoImage;
installer = (installerConfig hostname nodes."${hostname}").config.system.build.isoImage; vm_iso =
}) (nixpkgs.lib.attrsets.filterAttrs (hostname: nodeConfig: nodeConfig.system == system) nodes)) (specialFormats self.nixosConfigurations."${hostname}" "vm_iso").config.system.build.isoImage;
sd = (specialFormats self.nixosConfigurations."${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)
);
in
(
machines
// {
wip = nixpkgs.legacyPackages."${system}".symlinkJoin {
name = "wip";
paths =
(builtins.map (name: self.nixosConfigurations."${name}".config.system.build.toplevel) [
"odo"
"odowork"
"quark"
"family_disks"
])
++ [ self.packages."${system}".hydra.vm_iso ];
};
}
)
) )
); );
}; };

View File

@@ -45,7 +45,6 @@ in
"systemd.unit=getty.target" "systemd.unit=getty.target"
]; ];
boot.supportedFilesystems.zfs = true; boot.supportedFilesystems.zfs = true;
boot.initrd.systemd.enable = true;
networking.hostId = "04581ecf"; networking.hostId = "04581ecf";

View File

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

View File

@@ -82,6 +82,7 @@
me.ares.enable = true; me.ares.enable = true;
me.base.enable = true; me.base.enable = true;
me.bluetooth.enable = true; me.bluetooth.enable = true;
me.bubblewrap.enable = false;
me.build_in_ram.enable = true; me.build_in_ram.enable = true;
me.chromecast.enable = true; me.chromecast.enable = true;
me.chromium.enable = true; me.chromium.enable = true;
@@ -97,6 +98,7 @@
me.exfat.enable = true; me.exfat.enable = true;
me.firefox.enable = true; me.firefox.enable = true;
me.firewall.enable = true; me.firewall.enable = true;
me.flatpak.enable = true;
me.flux.enable = true; me.flux.enable = true;
me.font.enable = true; me.font.enable = true;
me.gcloud.enable = true; me.gcloud.enable = true;
@@ -107,6 +109,7 @@
me.graphical = true; me.graphical = true;
me.graphics_card_type = "amd"; me.graphics_card_type = "amd";
me.graphviz.enable = true; me.graphviz.enable = true;
me.instawow.enable = true;
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;
@@ -115,6 +118,7 @@
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;
me.lutris.enable = false;
me.lvfs.enable = true; me.lvfs.enable = true;
me.media.enable = true; me.media.enable = true;
me.memtest.enable = true; me.memtest.enable = true;
@@ -133,6 +137,7 @@
me.python.enable = true; me.python.enable = true;
me.qemu.enable = true; me.qemu.enable = true;
me.recovery.enable = true; me.recovery.enable = true;
me.robot.enable = true;
me.rpcs3.enable = true; me.rpcs3.enable = true;
me.rust.enable = true; me.rust.enable = true;
me.sequoia.enable = true; me.sequoia.enable = true;

View File

@@ -128,6 +128,7 @@
me.postgresql_client.enable = true; me.postgresql_client.enable = true;
me.python.enable = true; me.python.enable = true;
me.rdp_client.enable = true; me.rdp_client.enable = true;
me.robot.enable = true;
me.rust.enable = true; me.rust.enable = true;
me.sequoia.enable = true; me.sequoia.enable = true;
me.shikane.enable = true; me.shikane.enable = true;

View File

@@ -4,7 +4,7 @@
config = { config = {
me.distributed_build.enable = true; me.distributed_build.enable = true;
me.distributed_build.machines.quark = { me.distributed_build.machines.quark = {
enable_build = false; enable_build = true;
enable_substituter = false; enable_substituter = false;
additional_config = { additional_config = {
speedFactor = 2; speedFactor = 2;

View File

@@ -76,6 +76,7 @@
me.ares.enable = true; me.ares.enable = true;
me.base.enable = true; me.base.enable = true;
me.bluetooth.enable = true; me.bluetooth.enable = true;
me.bubblewrap.enable = false;
me.build_in_ram.enable = true; me.build_in_ram.enable = true;
me.chromecast.enable = true; me.chromecast.enable = true;
me.chromium.enable = true; me.chromium.enable = true;
@@ -100,6 +101,7 @@
me.graphical = true; me.graphical = true;
me.graphics_card_type = "amd"; me.graphics_card_type = "amd";
me.graphviz.enable = true; me.graphviz.enable = true;
me.instawow.enable = true;
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;
@@ -126,6 +128,7 @@
me.python.enable = true; me.python.enable = true;
me.qemu.enable = true; me.qemu.enable = true;
me.recovery.enable = true; me.recovery.enable = true;
me.robot.enable = true;
me.rpcs3.enable = true; me.rpcs3.enable = true;
me.rust.enable = true; me.rust.enable = true;
me.sequoia.enable = true; me.sequoia.enable = true;

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
TARGET=robot
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild boot --flake "$DIR/../../#robot" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
TARGET=robot
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
nixos-rebuild switch --flake "$DIR/../../#robot" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
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/../..#robot.iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
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/../../#robot" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
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/../../#robot" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
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/../../#robot" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: "${JOBS:="1"}"
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/../..#robot.vm_iso" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json

View File

@@ -0,0 +1,83 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
./vm_disk.nix
];
config = {
networking =
let
interface = "ens3";
in
{
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
hostId = "5223fba9";
hostName = "robot"; # Define your hostname.
# These are both enabled by default, but putting it explicitly here anyway. We will get networking via qemu's slirp.
dhcpcd.enable = true;
useDHCP = true;
};
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8";
me.boot.enable = true;
me.boot.secure = false;
me.mountPersistence = true;
boot.loader.timeout = lib.mkForce 0; # We can always generate a new ISO if we need to access other boot options.
me.optimizations = {
enable = true;
arch = "znver4";
# build_arch = "x86-64-v3";
system_features = [
"gccarch-znver4"
"gccarch-skylake"
"gccarch-kabylake"
# "gccarch-alderlake" missing WAITPKG
"gccarch-x86-64-v3"
"gccarch-x86-64-v4"
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
];
};
# Mount tmpfs at /tmp
boot.tmp.useTmpfs = true;
# Enable TRIM
# services.fstrim.enable = lib.mkDefault true;
# nix.optimise.automatic = true;
# nix.optimise.dates = [ "03:45" ];
# nix.optimise.persistent = true;
# For console-only qemu operation
boot.kernelParams = [
"console=ttyS0,115200n8"
];
environment.systemPackages = with pkgs; [
htop
];
# nix.sshServe.enable = true;
# nix.sshServe.keys = [ "ssh-dss AAAAB3NzaC1k... bob@example.org" ];
me.claude.enable = true;
me.dont_use_substituters.enable = true;
me.minimal_base.enable = true;
me.pi_coding_agent.enable = true;
me.python.enable = true;
};
}

View File

@@ -0,0 +1,31 @@
{
config,
lib,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
config = {
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
# networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
};
}

View File

@@ -0,0 +1,56 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
config = {
# Mount the local disk
fileSystems = lib.mkIf config.me.mountPersistence {
"/persist" = {
fsType = "none";
device = "/robot/.persist";
options = [
"bind"
"rw"
];
depends = [
"/robot/.persist"
];
neededForBoot = true;
};
"/state" = {
fsType = "none";
device = "/robot/.state";
options = [
"bind"
"rw"
];
depends = [
"/robot/.state"
];
neededForBoot = true;
};
"/robot" = lib.mkForce {
device = "host";
fsType = "9p";
options = [
"noatime"
"trans=virtio"
"version=9p2000.L"
"cache=mmap"
"msize=512000"
# "noauto"
# "x-systemd.automount"
];
neededForBoot = true;
};
};
};
}

View File

@@ -76,5 +76,15 @@ in
# Disable installing documentation. # Disable installing documentation.
documentation.doc.enable = false; documentation.doc.enable = false;
documentation.nixos.enable = false; documentation.nixos.enable = false;
# Let users in group wheel increase the priority of their processees without elevating to root.
security.pam.loginLimits = [
{
domain = "@wheel";
type = "-"; # Sets both soft and hard limits
item = "nice";
value = -20; # Range is -20 (highest priority) to 19 (lowest)
}
];
}; };
} }

View File

@@ -71,7 +71,6 @@
boot.loader.systemd-boot.memtest86.enable = true; boot.loader.systemd-boot.memtest86.enable = true;
# Check what will be lost with `zfs diff zroot/linux/root@blank` # Check what will be lost with `zfs diff zroot/linux/root@blank`
boot.initrd.systemd.enable = lib.mkDefault true;
boot.initrd.systemd.services.zfs-rollback = lib.mkIf config.me.rollback.enable { boot.initrd.systemd.services.zfs-rollback = lib.mkIf config.me.rollback.enable {
description = "Rollback ZFS root dataset to blank snapshot"; description = "Rollback ZFS root dataset to blank snapshot";
wantedBy = [ wantedBy = [

View File

@@ -0,0 +1,25 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
bubblewrap.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install bubblewrap.";
};
};
config = lib.mkIf config.me.bubblewrap.enable {
environment.systemPackages = with pkgs; [
bubblewrap
];
};
}

View File

@@ -0,0 +1,41 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
claude.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install claude.";
};
};
config = lib.mkIf config.me.claude.enable {
environment.systemPackages = with pkgs; [
claude-code
];
allowedUnfree = [ "claude-code" ];
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".claude";
user = "talexander";
group = "talexander";
mode = "0700";
}
];
};
};
};
}

View File

@@ -3,7 +3,6 @@
lib, lib,
pkgs, pkgs,
self, self,
this_nixos_config,
... ...
}: }:
@@ -50,6 +49,9 @@
# ++ flakeOutPaths; # ++ flakeOutPaths;
# closureInfo = pkgs.closureInfo { rootPaths = dependencies; }; # closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
# in # in
let
this_nixos_config = self.nixosConfigurations."${config.networking.hostName}";
in
{ {
imports = [ ]; imports = [ ];

View File

@@ -1,8 +1,8 @@
{ {
config, config,
lib, lib,
all_nixos_configs,
pkgs, pkgs,
self,
... ...
}: }:
@@ -76,14 +76,14 @@ let
sshUser = "nixworker"; sshUser = "nixworker";
sshKey = "/persist/manual/ssh/root/keys/id_ed25519"; sshKey = "/persist/manual/ssh/root/keys/id_ed25519";
maxJobs = 1; maxJobs = 1;
supportedFeatures = all_nixos_configs."${hostname}".config.me.optimizations.system_features; supportedFeatures = self.nixosConfigurations."${hostname}".config.me.optimizations.system_features;
protocol = "ssh-ng"; protocol = "ssh-ng";
} }
static_host_configs."${hostname}" static_host_configs."${hostname}"
config.me.distributed_build.machines."${hostname}".additional_config config.me.distributed_build.machines."${hostname}".additional_config
] ]
)) ))
) (builtins.attrNames all_nixos_configs) ) (builtins.attrNames self.nixosConfigurations)
); );
substituters_list = ( substituters_list = (
map ( map (
@@ -92,7 +92,7 @@ let
config.me.distributed_build.machines."${hostname}".enable_substituter config.me.distributed_build.machines."${hostname}".enable_substituter
&& config.me.distributed_build.machines."${hostname}".substituter_url != null && config.me.distributed_build.machines."${hostname}".substituter_url != null
) (config.me.distributed_build.machines."${hostname}".substituter_url)) ) (config.me.distributed_build.machines."${hostname}".substituter_url))
) (builtins.attrNames all_nixos_configs) ) (builtins.attrNames self.nixosConfigurations)
); );
has_any_substituters = substituters_list != [ ]; has_any_substituters = substituters_list != [ ];
in in
@@ -107,7 +107,9 @@ in
description = "Whether we want to use multiple machines to perform a nixos-rebuild."; description = "Whether we want to use multiple machines to perform a nixos-rebuild.";
}; };
distributed_build.machines = lib.mapAttrs (name: value: make_machine_config name) all_nixos_configs; distributed_build.machines = lib.mapAttrs (
name: value: make_machine_config name
) self.nixosConfigurations;
}; };
config = lib.mkIf config.me.distributed_build.enable ( config = lib.mkIf config.me.distributed_build.enable (

View File

@@ -84,6 +84,13 @@
"browser.ml.enable" = false; "browser.ml.enable" = false;
"browser.ml.chat.enabled" = false; "browser.ml.chat.enabled" = false;
"browser.ml.chat.menu" = false; "browser.ml.chat.menu" = false;
# Disable disk-based caching to reduce writes to SSDs. My machines have plenty of RAM.
"browser.cache.disk.enable" = 0;
# Max memory for cache in KiB (set to 1 GiB). This defaults to unbounded (-1).
"browser.cache.memory.capacity" = 1048576;
# Only keep the previous 5 pages in memory for the back button. This defaults to unbounded (-1).
"browser.sessionhistory.max_total_viewers" = 5;
}; };
# Check about:policies#documentation and https://mozilla.github.io/policy-templates/ for options. # Check about:policies#documentation and https://mozilla.github.io/policy-templates/ for options.
policies = { policies = {

View File

@@ -0,0 +1,62 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
flatpak.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install flatpak.";
};
};
config = lib.mkIf config.me.flatpak.enable {
services.flatpak.enable = true;
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
directories = [
{
directory = "/var/lib/flatpak";
user = "root";
group = "root";
mode = "0755";
}
];
users.talexander = {
directories = [
{
# User-specific configuration.
directory = ".local/share/flatpak";
user = "talexander";
group = "talexander";
mode = "0755";
}
{
# App data
directory = ".var/app";
user = "talexander";
group = "talexander";
mode = "0755";
}
{
# Flatpak Lutris installs
directory = "Games";
user = "talexander";
group = "talexander";
mode = "0755";
}
];
};
};
};
}

View File

@@ -80,6 +80,8 @@ in
systemd.services."build-cache" = systemd.services."build-cache" =
let let
enabled_targets = [ enabled_targets = [
"wip"
"wip_kubernetes"
"odo" "odo"
"odo_update" "odo_update"
"odowork" "odowork"

View File

@@ -1,5 +1,19 @@
output_directory = "/home/nixworker/persist/nix_builder" output_directory = "/home/nixworker/persist/nix_builder"
[[targets]]
name = "wip"
repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "wip"
path = "nix/configuration"
attr = "wip"
[[targets]]
name = "wip_kubernetes"
repo = "https://code.fizz.buzz/talexander/machine_setup.git"
branch = "wip"
path = "nix/kubernetes"
attr = "wip"
[[targets]] [[targets]]
name = "odo" name = "odo"
repo = "https://code.fizz.buzz/talexander/machine_setup.git" repo = "https://code.fizz.buzz/talexander/machine_setup.git"

View File

@@ -0,0 +1,53 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
instawow.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install instawow.";
};
};
config = lib.mkIf config.me.instawow.enable {
environment.systemPackages = with pkgs; [
instawow
];
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".config/instawow";
user = "talexander";
group = "talexander";
mode = "0755";
}
];
};
};
environment.persistence."/state" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".cache/instawow";
user = "talexander";
group = "talexander";
mode = "0755";
}
];
};
};
};
}

View File

@@ -123,7 +123,7 @@ in
kernel.version = lib.mkOption { kernel.version = lib.mkOption {
type = lib.types.str; type = lib.types.str;
# default = "linux"; # LTS # default = "linux"; # LTS
default = "linux_7_2"; # LTS default = "linux_7_2";
example = "linux_6_18"; example = "linux_6_18";
description = "What version of the kernl should we use."; description = "What version of the kernl should we use.";
}; };

View File

@@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
lutris.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install lutris.";
};
};
config = lib.mkIf (config.me.lutris.enable && config.me.graphical) {
environment.systemPackages = with pkgs; [
lutris
];
# If we need additional libraries for any games:
# (lutris.override {
# extraLibraries = pkgs: [
# # List library dependencies here
# ];
# extraPkgs = pkgs: [
# # List package dependencies here
# ];
# })
};
}

View File

@@ -0,0 +1,73 @@
# Example endpoint when run in qemu with slirp: http://10.0.2.2:8080/v1/chat/completions
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
pi_coding_agent.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install pi_coding_agent.";
};
};
config = lib.mkIf config.me.pi_coding_agent.enable {
environment.systemPackages = with pkgs; [
pi-coding-agent
];
nixpkgs.overlays = [
(final: prev: {
pi-coding-agent = pkgs.symlinkJoin {
name = prev.pi-coding-agent.name;
paths = [ prev.pi-coding-agent ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/pi \
--set-default NPM_CONFIG_PREFIX '$HOME/.pi/npm' \
--set-default PI_SKIP_VERSION_CHECK 1 \
--set-default PI_TELEMETRY 0 \
--set-default PI_OFFLINE 1 \
--set-default LLAMA_BASE_URL http://10.0.2.2:8080 \
--set-default LLAMA_API_KEY optional-secret \
--set-default PI_PROVIDER llama.cpp \
--set-default PI_MODEL qwen3.8_27b_bf16 \
--prefix PATH : ${
pkgs.lib.makeBinPath [
pkgs.nodejs_latest
]
}
'';
};
})
];
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".pi";
user = "talexander";
group = "talexander";
mode = "0700";
}
{
# For ~/.agents/skills
directory = ".agents";
user = "talexander";
group = "talexander";
mode = "0700";
}
];
};
};
};
}

View File

@@ -21,5 +21,19 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
freerdp freerdp
]; ];
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".config/freerdp";
user = "talexander";
group = "talexander";
mode = "0700";
}
];
};
};
}; };
} }

View File

@@ -0,0 +1,81 @@
{
config,
lib,
pkgs,
self,
...
}:
let
patchScriptBin =
filename: contents:
((pkgs.writeScriptBin filename contents).overrideAttrs (old: {
buildCommand = "${old.buildCommand}\n patchShebangs $out";
}));
launch_robot_script = (
patchScriptBin "launch_robot" (
builtins.readFile (
pkgs.replaceVars ./files/robot/launch_robot.bash (
let
robot_image_package = self.packages.${pkgs.system}.robot.vm_iso;
robot_image = "${robot_image_package}/iso/${robot_image_package.isoName}";
in
{
"OVMFfd" = "${pkgs.OVMF.fd}";
"mountiso" = robot_image;
}
)
)
)
);
launch_robot_script_wrapped =
(pkgs.writeScriptBin "launch_robot" ''
#!/usr/bin/env bash
export "PATH=${
pkgs.lib.makeBinPath (
with pkgs;
[
qemu
]
)
}:''${PATH}"
exec ${launch_robot_script}/bin/launch_robot "''${@}"
'').overrideAttrs
(old: {
buildCommand = ''
${old.buildCommand}
patchShebangs $out
'';
});
in
{
imports = [ ];
options.me = {
robot.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install robot.";
};
};
config = lib.mkIf config.me.robot.enable {
environment.systemPackages = with pkgs; [
launch_robot_script_wrapped
];
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
directories = [
{
directory = "/robot";
user = "talexander";
group = "talexander";
mode = "0700";
}
];
};
};
}

View File

@@ -0,0 +1,85 @@
#!/usr/bin/env bash
#
# Launch the robot virtual machine
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: ${CPU_CORES:="4"}
: ${MEMORY:="8G"}
: ${GTK_ENABLE:="NO"} # Only enable one, either GTK or VNC
: ${VNC_ENABLE:="NO"} # Only enable one, either GTK or VNC
: ${VNC_LISTEN:="127.0.0.1:0"}
: ${VNC_WIDTH:="1920"}
: ${VNC_HEIGHT:="1080"}
############## Setup #########################
function cleanup {
sync
for p in "${pids[@]}"; do
log "Killing $p"
kill "$p"
log "Killed $p"
done
}
pids=()
trap "set +e; cleanup" EXIT
function die {
local status_code="$1"
shift
(>&2 echo "${@}")
exit "$status_code"
}
function log {
(>&2 echo "${@}")
}
############## Program #########################
function main {
local mount_path="$1"
shift 1
local additional_args=()
additional_args+=(-drive "file=@mountiso@,media=cdrom,id=drive-cd1,readonly=on,if=none"
-device "ahci,id=achi0"
-device "ide-cd,bus=achi0.0,drive=drive-cd1,id=cd1,bootindex=1")
additional_args+=(-fsdev "local,id=fsdev0,path=${mount_path},security_model=mapped-xattr" -device "virtio-9p-pci,fsdev=fsdev0,mount_tag=host")
mkdir -p "${mount_path}/.persist" "${mount_path}/.state"
if [ "$VNC_ENABLE" = "YES" ]; then
additional_args+=(-vnc "${VNC_LISTEN},power-control=on")
elif [ "$GTK_ENABLE" = "YES" ]; then
additional_args+=(
-device 'virtio-gpu-gl,hostmem=8G,blob=true,venus=true'
-display 'gtk,gl=on'
-vga virtio
)
else
additional_args+=(-nographic)
fi
exec qemu-system-x86_64 \
-name robot \
-accel kvm \
-cpu host \
-smp cores="$CPU_CORES" \
-m "$MEMORY" \
-rtc base=localtime \
-device virtio-rng-pci \
-drive "file=@OVMFfd@/FV/OVMF_CODE.fd,if=pflash,format=raw,readonly=on" \
-nic 'user,hostfwd=tcp::60022-:22' \
"${additional_args[@]}"
}
main "${@}"

View File

@@ -15,45 +15,24 @@ let
ms-azuretools.vscode-docker ms-azuretools.vscode-docker
ms-vscode-remote.remote-ssh ms-vscode-remote.remote-ssh
esbenp.prettier-vscode esbenp.prettier-vscode
ms-python.python
ms-python.debugpy
]; ];
work_specific = [ work_specific = [
# ms-python.vscode-pylance ms-python.vscode-python-envs
ms-python.vscode-pylance
ms-python.debugpy
ms-python.python
] ]
++ (pkgs.vscode-utils.extensionsFromVscodeMarketplace [ ++ (pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{ {
name = "remote-server"; name = "remote-server";
publisher = "ms-vscode"; publisher = "ms-vscode";
version = "1.5.3"; version = "1.5.4";
sha256 = "MSayIBwvSgIHg6gTrtUotHznvo5kTiveN8iSrehllW0="; sha256 = "x0zD2MolMai8cCdNfn8kf58cf7oNe6XH1CDUfpJ/Zaw=";
}
{
name = "vscode-python-envs";
publisher = "ms-python";
version = "1.12.0";
sha256 = "8dCnGBuxv+8QwP0FrUZIKFxllVOR2z+wIhyyJgxsRns=";
}
{
name = "vscode-pylance";
publisher = "ms-python";
version = "2025.10.1";
sha256 = "7NLq5huykRAhhEIHjtXLKDBFwQ5yiJKFLG64Tjh0yaM=";
}
{
name = "debugpy";
publisher = "ms-python";
version = "2025.16.0";
sha256 = "QPIDUzzwIfzyicsCwqU2u6hVSjCJMInHhHMBqvL8tYs=";
}
{
name = "python";
publisher = "ms-python";
version = "2025.18.0";
sha256 = "6auzfS1DmOuaqV2rDHSCC9BlrcON4xUrdJZ0N0wYCs4=";
} }
]); ]);
personal_specific = [ personal_specific = [
ms-python.python
ms-python.debugpy
ms-vscode.cpptools # C/C++ support and debugging ms-vscode.cpptools # C/C++ support and debugging
ms-vscode.cpptools-extension-pack ms-vscode.cpptools-extension-pack
]; ];
@@ -99,9 +78,11 @@ in
me.install.user.talexander.file = { me.install.user.talexander.file = {
".config/Code/User/settings.json" = { ".config/Code/User/settings.json" = {
source = ./files/settings.json; source = ./files/settings.json;
method = "overwrite";
}; };
".config/Code/User/keybindings.json" = { ".config/Code/User/keybindings.json" = {
source = ./files/keybindings.json; source = ./files/keybindings.json;
method = "overwrite";
}; };
}; };
@@ -159,6 +140,12 @@ in
group = "talexander"; group = "talexander";
mode = "0755"; mode = "0755";
} }
{
directory = ".config/Code/CachedExtensionVSIXs";
user = "talexander";
group = "talexander";
mode = "0755";
}
]; ];
}; };
}; };

View File

@@ -22,7 +22,6 @@
# wineWowPackages.stable # supports 32 + 64 bit # wineWowPackages.stable # supports 32 + 64 bit
wineWow64Packages.waylandFull # Supports 32 + 64 bit with native wayland support. wineWow64Packages.waylandFull # Supports 32 + 64 bit with native wayland support.
# winetricks # winetricks
# lutris
]; ];
}; };
} }

View File

@@ -149,6 +149,7 @@
}) })
(disableOptimizationsPython3 "zopfli") (disableOptimizationsPython3 "zopfli")
(disableOptimizations "zopfli") (disableOptimizations "zopfli")
(disableOptimizations "libjpeg_turbo")
]; ];
# 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": 1789770686, "lastModified": 1792526520,
"narHash": "sha256-uZkBR7yHdIKUFB5SZdfgh1qkGfI3XmYmI/lTiquxbck=", "narHash": "sha256-3hSJlv8mUVnZPMWK2+CM7a9O+nR6Z4mCh27NfLCmTPc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "725ea35e410ad83be4931d1bff7e090eacaf3563", "rev": "cedd626e11b635470fa6f9fdb8ad79b0075dd7f9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -123,11 +123,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769548169, "lastModified": 1792739756,
"narHash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=", "narHash": "sha256-s0TeXWG5Ci75Y/Hzon0Z7NrN/fG773Rc54/z6oPFszQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "impermanence", "repo": "impermanence",
"rev": "7b1d382faf603b6d264f58627330f9faa5cba149", "rev": "fa627f4c8b8e92f58f58a73d99ee4e1304e64eb2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -164,11 +164,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1791260994, "lastModified": 1793540411,
"narHash": "sha256-Miqqk/ammqnTUxaoCyvtwoPeLbI1ksFyLxi/CazZpWY=", "narHash": "sha256-fiPJ88izTVucjeo2EQ3jk4aWmLg03I1D4vxnX2QjEgE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4", "rev": "0bb2eedc20e4739f29e8045034f2828ad7054f8f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -71,64 +71,49 @@
system = "x86_64-linux"; system = "x86_64-linux";
}; };
}; };
nixosConfigs = builtins.mapAttrs ( baseConfig = nixpkgs.lib.nixosSystem {
hostname: nodeConfig: format: specialArgs = {
nixpkgs.lib.nixosSystem { inherit self;
specialArgs = { };
inherit self; modules = [
impermanence.nixosModules.impermanence
this_nixos_config = self.nixosConfigurations."${hostname}"; lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
all_nixos_configs = self.nixosConfigurations; ./configuration.nix
}; {
config = {
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";
};
})
];
};
}
];
};
toplevelConfigs = builtins.mapAttrs (
hostname: nodeConfig:
baseConfig.extendModules {
modules = [ modules = [
impermanence.nixosModules.impermanence
lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
./configuration.nix
(./. + "/hosts/${hostname}") (./. + "/hosts/${hostname}")
(./. + "/formats/${format}.nix")
{ {
config = { config = {
nixpkgs.hostPlatform.system = nodeConfig.system; 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; ) nodes;
specialFormats =
nixosConfig: format:
nixosConfig.extendModules {
modules = [ (./. + "/formats/${format}.nix") ];
};
installerConfig = installerConfig =
hostname: nodeConfig: hostname: nodeConfig:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
@@ -137,46 +122,41 @@
}; };
modules = [ modules = [
./formats/installer.nix ./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; }) ({ nixpkgs.hostPlatform.system = nodeConfig.system; })
]; ];
}; };
in in
{ {
nixosConfigurations = (builtins.mapAttrs (name: value: value "toplevel") nixosConfigs); nixosConfigurations = toplevelConfigs;
} }
// { // {
packages = ( packages = (
forAllSystems ( forAllSystems (
system: system:
(builtins.mapAttrs (hostname: nodeConfig: { let
iso = (nixosConfigs."${hostname}" "iso").config.system.build.isoImage; machines = (
vm_iso = (nixosConfigs."${hostname}" "vm_iso").config.system.build.isoImage; builtins.mapAttrs (hostname: nodeConfig: {
sd = (nixosConfigs."${hostname}" "sd").config.system.build.sdImage; iso = (specialFormats self.nixosConfigurations."${hostname}" "iso").config.system.build.isoImage;
installer = (installerConfig hostname nodes."${hostname}").config.system.build.isoImage; vm_iso =
}) (nixpkgs.lib.attrsets.filterAttrs (hostname: nodeConfig: nodeConfig.system == system) nodes)) (specialFormats self.nixosConfigurations."${hostname}" "vm_iso").config.system.build.isoImage;
sd = (specialFormats self.nixosConfigurations."${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)
);
in
(
machines
// {
wip = nixpkgs.legacyPackages."${system}".symlinkJoin {
name = "wip";
paths = (
builtins.map (name: self.nixosConfigurations."${name}".config.system.build.toplevel) (
builtins.attrNames self.nixosConfigurations
)
);
};
}
)
) )
); );
}; };

View File

@@ -45,7 +45,6 @@ in
"systemd.unit=getty.target" "systemd.unit=getty.target"
]; ];
boot.supportedFilesystems.zfs = true; boot.supportedFilesystems.zfs = true;
boot.initrd.systemd.enable = true;
networking.hostId = "04581ecf"; networking.hostId = "04581ecf";

View File

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

View File

@@ -71,7 +71,6 @@
boot.loader.systemd-boot.memtest86.enable = true; boot.loader.systemd-boot.memtest86.enable = true;
# Check what will be lost with `zfs diff zroot/linux/root@blank` # Check what will be lost with `zfs diff zroot/linux/root@blank`
boot.initrd.systemd.enable = lib.mkDefault true;
boot.initrd.systemd.services.zfs-rollback = lib.mkIf config.me.rollback.enable { boot.initrd.systemd.services.zfs-rollback = lib.mkIf config.me.rollback.enable {
description = "Rollback ZFS root dataset to blank snapshot"; description = "Rollback ZFS root dataset to blank snapshot";
wantedBy = [ wantedBy = [