Refactor flake targets into platform x build-type matrix
Check NixOS configurations / eval-hosts (push) Failing after 12m2s

Generates all nixosConfigurations from mkTarget(platform, buildType,
hostPath) instead of hand-written per-host blocks, so adding a new
platform or build type is a one-line addition. Per-machine identity
(hostname, hostId, secrets, stateVersion) moves into hosts/<name>/host.nix;
platform-specific config (hardware, boot, networking) into
modules/platforms/*.nix; build-type config (minimal/server/docker/gui/
nix-cache/pxe-boot) into modules/build-types/*.nix.

Old flat targets (nixos, docker, server, nix-cache, nix-minimal, pxe-boot)
are replaced by the 17-target <platform>-<buildtype> matrix; each new
target was verified to evaluate before its old counterpart was removed.
CI workflows and docs/aliases now discover hosts dynamically via
nixosConfigurations attrNames and /etc/flake-target instead of hardcoded
lists, so they can't drift from flake.nix again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 12:03:33 +10:00
co-authored by Claude Sonnet 5
parent 0b090cab07
commit c05e3a3821
31 changed files with 529 additions and 699 deletions
+3 -1
View File
@@ -20,7 +20,9 @@ jobs:
- name: Evaluate all NixOS hosts - name: Evaluate all NixOS hosts
run: | run: |
set -euo pipefail set -euo pipefail
for host in nixos docker server nix-cache nix-minimal pxe-boot linode-minimal; do hosts="$(nix --extra-experimental-features 'nix-command flakes' eval --json \
.#nixosConfigurations --apply builtins.attrNames | jq -r '.[]')"
for host in $hosts; do
echo "Evaluating ${host}" echo "Evaluating ${host}"
nix --extra-experimental-features 'nix-command flakes' eval \ nix --extra-experimental-features 'nix-command flakes' eval \
".#nixosConfigurations.${host}.config.system.build.toplevel.drvPath" --raw ".#nixosConfigurations.${host}.config.system.build.toplevel.drvPath" --raw
+3 -1
View File
@@ -20,7 +20,9 @@ jobs:
- name: Evaluate all NixOS hosts - name: Evaluate all NixOS hosts
run: | run: |
set -euo pipefail set -euo pipefail
for host in nixos docker server nix-cache nix-minimal pxe-boot linode-minimal; do hosts="$(nix --extra-experimental-features 'nix-command flakes' eval --json \
.#nixosConfigurations --apply builtins.attrNames | jq -r '.[]')"
for host in $hosts; do
echo "Evaluating ${host}" echo "Evaluating ${host}"
nix --extra-experimental-features 'nix-command flakes' eval \ nix --extra-experimental-features 'nix-command flakes' eval \
".#nixosConfigurations.${host}.config.system.build.toplevel.drvPath" --raw ".#nixosConfigurations.${host}.config.system.build.toplevel.drvPath" --raw
+7 -9
View File
@@ -5,15 +5,13 @@
This repository contains flake-based NixOS configurations for Wayne's LAN This repository contains flake-based NixOS configurations for Wayne's LAN
servers and workstation. servers and workstation.
The flake currently exposes these NixOS configurations: The flake exposes NixOS configurations named `<platform>-<buildtype>`
(platforms: `linode`, `proxmox`, `lxc`; build types: `minimal`, `nix-cache`,
- `nixos` `server`, `docker`, `gui`, `pxe-boot`), generated from `modules/platforms/*`
- `docker` and `modules/build-types/*` by the `mkTarget` function in `flake.nix`. Not
- `server` every combination is built — `pxe-boot` has no `linode` variant. See
- `nix-cache` `README.md` for the full current target list; treat `flake.nix` as the
- `nix-minimal` source of truth since this list can drift.
- `pxe-boot`
- `linode-minimal`
Do not deploy, switch, reboot, repartition, format disks, or run destructive Do not deploy, switch, reboot, repartition, format disks, or run destructive
install commands from this repository unless explicitly asked. install commands from this repository unless explicitly asked.
+34 -14
View File
@@ -5,17 +5,35 @@ workstation.
## Hosts ## Hosts
This flake currently defines: Targets are named `<platform>-<buildtype>`, generated from two orthogonal
pieces composed in `flake.nix`:
| Host | Purpose | - **Platforms** (what it runs on): `linode`, `proxmox`, `lxc`
- **Build types** (what it's for): `minimal`, `nix-cache`, `server`, `docker`,
`gui`, `pxe-boot`
Not every combination exists — `pxe-boot` has no `linode` variant, since
PXE/DHCP/TFTP need LAN L2 adjacency that a Linode VPS doesn't have. The full
list:
| Target | Purpose |
| --- | --- | | --- | --- |
| `nixos` | Main NixOS workstation / Cinnamon desktop | | `linode-minimal` | Minimal NixOS host profile on a Linode VPS (real, deployed) |
| `docker` | Docker host for the main container stack | | `proxmox-minimal` | Minimal NixOS host profile on Proxmox (real, deployed — previously the flat `nix-minimal` target) |
| `server` | Storage, NFS, backup, and monitoring exporter host | | `lxc-minimal` | Minimal NixOS host profile in a Proxmox LXC container |
| `nix-cache` | Local Nix binary cache and remote builder | | `linode-nix-cache` / `proxmox-nix-cache` / `lxc-nix-cache` | Local Nix binary cache and remote builder (`proxmox-nix-cache` is the real, deployed one — previously the flat `nix-cache` target) |
| `nix-minimal` | Minimal NixOS host profile with SSHFS tooling | | `linode-server` / `proxmox-server` / `lxc-server` | Storage, NFS, backup, and monitoring exporter host (`proxmox-server` is the real, deployed one — previously the flat `server` target) |
| `pxe-boot` | HTTP/iPXE boot asset host | | `linode-docker` / `proxmox-docker` / `lxc-docker` | Docker host for the main container stack (`proxmox-docker` is the real, deployed one — previously the flat `docker` target) |
| `linode-minimal` | Minimal NixOS host profile for Linode VPS instances | | `linode-gui` / `proxmox-gui` / `lxc-gui` | Cinnamon desktop workstation (`proxmox-gui` is the real, deployed one — previously the flat `nixos` target) |
| `proxmox-pxe-boot` / `lxc-pxe-boot` | HTTP/iPXE boot asset host (`proxmox-pxe-boot` is the real, deployed one — previously the flat `pxe-boot` target) |
Each buildtype's `hosts/<name>/host.nix` carries the per-machine identity
(hostname, hostId, per-machine secrets, `system.stateVersion`) that must stay
fixed regardless of which platform it's built for — see
`flake-target-refactor-spec.md` for the full rationale. Every deployed host
stamps its own active target name into `/etc/flake-target` at build time, so
`nixos-rebuild switch --flake .#$(cat /etc/flake-target)` always picks up the
right one even after a platform migration changes the flake attribute name.
List hosts with: List hosts with:
@@ -27,11 +45,13 @@ nix eval --json .#nixosConfigurations --apply builtins.attrNames | jq -r '.[]'
| Path | Purpose | | Path | Purpose |
| --- | --- | | --- | --- |
| `flake.nix` | Flake inputs and `nixosConfigurations` outputs | | `flake.nix` | Flake inputs, the `mkTarget` platform × build-type generator, and `nixosConfigurations` outputs |
| `hosts/<host>/configuration.nix` | Host-specific NixOS configuration | | `hosts/<name>/host.nix` | Per-machine identity: hostname, hostId, per-machine secrets, `system.stateVersion` |
| `hosts/nixos/home.nix` | Workstation-specific Home Manager config | | `hosts/nixos/home.nix` | Workstation-specific Home Manager config (used by the `gui` build type) |
| `common/` | Shared NixOS, Home Manager, aliases, and hardware config | | `modules/platforms/` | Platform-specific config: virtualisation guest tools, boot method, hardware config (`linode.nix`, `proxmox.nix`, `lxc.nix`) |
| `modules/nix/` | Binary cache and remote builder client/server modules | | `modules/build-types/` | Build-type-specific config: what makes a system minimal/server/docker/gui/pxe-boot/nix-cache |
| `modules/common/` | Shared NixOS config, Home Manager, aliases imported by every host |
| `modules/nix-cache/` | Binary cache and remote builder client/server modules |
| `docs/` | Operational notes for cache, builders, lock updates, and boot services | | `docs/` | Operational notes for cache, builders, lock updates, and boot services |
| `scripts/` | Codex setup and validation helpers | | `scripts/` | Codex setup and validation helpers |
+11 -9
View File
@@ -8,14 +8,10 @@ and to verify that declared NixOS hosts still evaluate after dependency updates.
- A scheduled workflow runs `nix flake update` once per week. - A scheduled workflow runs `nix flake update` once per week.
- On GitHub, any resulting `flake.lock` change is proposed through a pull request. - On GitHub, any resulting `flake.lock` change is proposed through a pull request.
- On Gitea, the workflow can commit and push `flake.lock` directly when PR automation is not configured. - On Gitea, the workflow can commit and push `flake.lock` directly when PR automation is not configured.
- A separate CI workflow evaluates every configured host before merge: - A separate CI workflow evaluates every configured host before merge, listed
- `nixos` dynamically via `nix eval --json .#nixosConfigurations --apply builtins.attrNames`
- `docker` rather than hand-enumerated, so it can't drift as `<platform>-<buildtype>`
- `server` targets are added or removed. See `README.md` for the current target list.
- `nix-cache`
- `nix-minimal`
- `pxe-boot`
- `linode-minimal`
## Why hosts should stop using `--upgrade-all` ## Why hosts should stop using `--upgrade-all`
@@ -24,9 +20,15 @@ and to verify that declared NixOS hosts still evaluate after dependency updates.
Recommended rebuild command: Recommended rebuild command:
```bash ```bash
sudo nixos-rebuild switch --flake git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#$(hostname) sudo nixos-rebuild switch --flake git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#$(cat /etc/flake-target)
``` ```
Flake attribute names are `<platform>-<buildtype>` (e.g. `proxmox-docker`)
and no longer match `hostname`, since a host's hostname stays fixed while
the platform backing it can change. Each `nixosConfiguration` stamps its own
active target name into `/etc/flake-target` at build time, which is what the
command above reads.
Using the committed lock file keeps all hosts aligned and makes updates auditable through CI and code review. Using the committed lock file keeps all hosts aligned and makes updates auditable through CI and code review.
Codex and automated review sessions must not run rebuilds. Limit checks to Codex and automated review sessions must not run rebuilds. Limit checks to
+143
View File
@@ -0,0 +1,143 @@
# Spec: Refactor Flake Targets into Platform × Build-Type Matrix
## Context
The flake at `~/nixos` currently defines these output targets (flat, ad-hoc naming):
- `docker`
- `linode-minimal`
- `nix-cache`
- `nix-minimal`
- `nixos`
- `server`
- `pxe-boot`
Some already follow a `platform-buildtype` convention (`linode-minimal`), most don't.
`~/nix-auto-installer` is a related repo and should be checked for any coupling to
these target names (scripts, docs, CI, or install automation that reference them by
name) before renaming anything.
## Goal
Restructure the flake so targets are generated from two orthogonal concepts:
**Build types** (what the system is for):
- `minimal`
- `nix-cache`
- `server`
- `docker`
- `pxe-boot`
- `gui`
**Platforms** (what it's deployed on):
- `linode` (Linode VM)
- `proxmox` (Proxmox VM)
- `lxc` (Proxmox LXC container)
Final targets should be named consistently as `<platform>-<buildtype>`, e.g.:
```
linode-minimal proxmox-minimal lxc-minimal
linode-nix-cache proxmox-nix-cache lxc-nix-cache
linode-server proxmox-server lxc-server
linode-docker proxmox-docker lxc-docker
linode-pxe-boot proxmox-pxe-boot lxc-pxe-boot
linode-gui proxmox-gui lxc-gui
```
That's the full matrix (18 targets) if every build type applies to every platform.
See **Open Questions** below — some combinations may not make sense and should be
confirmed with me before being built out, not silently included or dropped.
## Migration mapping (old → new)
| Old target | New target | Notes |
|--------------------|------------------------------------------------------|-------|
| `linode-minimal` | `linode-minimal` | Already correct, keep as-is |
| `nix-minimal` | likely `proxmox-minimal` or a platform-less base module | Ambiguous — see Open Questions |
| `nix-cache` | base module consumed by `linode-nix-cache`, `proxmox-nix-cache`, `lxc-nix-cache` | Currently platform-less; needs to become a build-type module, not a standalone target |
| `server` | base module consumed by `linode-server`, `proxmox-server`, `lxc-server` | Same as above |
| `docker` | base module consumed by `linode-docker`, `proxmox-docker`, `lxc-docker` | Confirm docker actually makes sense as an LXC/VM guest build vs. a standalone container image — see Open Questions |
| `pxe-boot` | TBD — may stay a single target rather than a per-platform one | See Open Questions |
| `nixos` | TBD — unclear what this maps to in the new scheme | See Open Questions |
## Open Questions (Claude Code: raise these with me before implementing, don't guess)
1. **`nixos` target** — what is this currently used for (bare metal install, dev
shell, template)? It doesn't obviously map to any of the six build types.
2. **`nix-minimal` vs `linode-minimal`** — are these two different things, or is
`nix-minimal` a leftover/duplicate?
3. **`pxe-boot` and `gui` across all three platforms** — does PXE boot make sense
for an LXC container or a cloud VM (Linode), or is it inherently bare-metal/
network-boot only and should remain a single non-platform target? Does `gui`
make sense inside an LXC container?
4. **`docker` as a build type** — is this "a NixOS host configured to run Docker"
(which would sensibly have linode/proxmox/lxc variants), or "a Docker container
image built by the flake" (which wouldn't take a platform prefix at all, since
it doesn't run on Linode/Proxmox/LXC as a guest OS)? These are structurally
different and change how it should be wired in.
5. Confirm whether all 18 combinations should actually exist, or whether this is
meant to produce only the combinations that are genuinely useful (e.g. maybe no
one needs `lxc-pxe-boot`).
## Implementation approach
1. **Inventory first.** Read the current `flake.nix` and any `nixosConfigurations`/
`modules` structure. Map every existing target to what module(s) it actually
pulls in. Don't assume — confirm against the real file contents.
2. **Separate build-type and platform into their own module directories**, e.g.:
```
modules/build-types/minimal.nix
modules/build-types/nix-cache.nix
modules/build-types/server.nix
modules/build-types/docker.nix
modules/build-types/pxe-boot.nix
modules/build-types/gui.nix
modules/platforms/linode.nix
modules/platforms/proxmox.nix
modules/platforms/lxc.nix
```
Build-type modules should contain only what makes a system "minimal" vs
"server" vs "gui", etc. Platform modules should contain only what's specific
to running as a Linode VM vs Proxmox VM vs LXC container (virtualisation
guest tools, boot method, filesystem/image format, LXC-specific constraints
like no kernel modules, etc).
3. **Generate the target matrix programmatically** in `flake.nix` rather than
hand-writing 18 near-identical `nixosConfigurations` entries — e.g. a small
function that takes a platform name and build-type name, composes the two
modules plus any shared base module, and produces the named output. This
keeps future build types/platforms a one-line addition rather than a copy-paste
job.
4. **Only build combinations we've confirmed make sense** (see Open Questions) —
don't emit all 18 by default if some are structurally invalid.
5. **Preserve existing working configs during the transition.** Don't delete the
old target names until their replacements build successfully — rename/alias
at the end, not the start, so there's no window where the flake is broken.
## Verification
For every new target produced:
```bash
nix flake check
nix build .#nixosConfigurations.<target>.config.system.build.toplevel
```
Confirm each builds without evaluation errors before considering it done. If a
target fails to build, report which one and why rather than silently skipping it.
## Deliverables
- Refactored `flake.nix` using the composed module + generated-matrix approach.
- New `modules/build-types/*.nix` and `modules/platforms/*.nix` files.
- Old flat target names removed only after their replacements are verified.
- A short `README.md` (or section in existing docs) listing the final target
names and what each one is for.
- A summary at the end of what changed, what was removed, and any of the Open
Questions above that got resolved differently than expected.
## Out of scope
- Don't touch `~/nix-auto-installer` contents beyond checking it for references
to the old target names — if changes there are needed, flag them, don't make
them without confirming.
- Don't add new build types or platforms beyond the ones listed here.
+50 -117
View File
@@ -18,137 +18,70 @@
let let
system = "x86_64-linux"; system = "x86_64-linux";
inherit (nixpkgs) lib;
# 🔧 Docker override (pin version here) # Generates a nixosConfiguration from a platform (what it runs on) and
# dockerOverlay = final: prev: { # a build type (what it's for), plus the per-identity host.nix that
# docker = prev.docker_29; # carries the bits that must stay fixed regardless of platform
# docker_cli = prev.docker_29; # (hostName, hostId, per-machine secrets). Every build type except
# }; # nix-cache itself consumes the nix-cache substituter and remote
# builder.
in { mkTarget = { platform, buildType, hostPath, homeFile ? ./modules/common/home.nix }:
nixpkgs.lib.nixosSystem {
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
./hosts/nixos/configuration.nix ./modules/common/configuration.nix
./modules/hardware-configuration/vm/proxmox.nix ./modules/platforms/${platform}.nix
./modules/build-types/${buildType}.nix
home-manager.nixosModules.home-manager { hostPath
home-manager.useGlobalPkgs = true; { environment.etc."flake-target".text = "${platform}-${buildType}"; }
home-manager.useUserPackages = true; home-manager.nixosModules.home-manager
home-manager.users.nixos = import ./hosts/nixos/home.nix; {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.nixos = import homeFile;
};
} }
] ++ lib.optionals (buildType != "nix-cache") [
./modules/nix-cache/client.nix
./modules/remote-builder-client.nix
]; ];
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
}; };
docker = nixpkgs.lib.nixosSystem { # Generated platform x build-type matrix. pxe-boot has no linode
inherit system; # variant (PXE/DHCP/TFTP need LAN L2 adjacency, which a Linode VPS
# doesn't have).
generatedTargets = {
linode-minimal = mkTarget { platform = "linode"; buildType = "minimal"; hostPath = ./hosts/linode-minimal/host.nix; };
proxmox-minimal = mkTarget { platform = "proxmox"; buildType = "minimal"; hostPath = ./hosts/proxmox-minimal/host.nix; };
lxc-minimal = mkTarget { platform = "lxc"; buildType = "minimal"; hostPath = ./hosts/lxc-minimal/host.nix; };
# 🔧 create custom pkgs with overlay linode-nix-cache = mkTarget { platform = "linode"; buildType = "nix-cache"; hostPath = ./hosts/nix-cache/host.nix; };
pkgs = import nixpkgs { proxmox-nix-cache = mkTarget { platform = "proxmox"; buildType = "nix-cache"; hostPath = ./hosts/nix-cache/host.nix; };
inherit system; lxc-nix-cache = mkTarget { platform = "lxc"; buildType = "nix-cache"; hostPath = ./hosts/nix-cache/host.nix; };
overlays = [ linode-server = mkTarget { platform = "linode"; buildType = "server"; hostPath = ./hosts/server/host.nix; };
(final: prev: { proxmox-server = mkTarget { platform = "proxmox"; buildType = "server"; hostPath = ./hosts/server/host.nix; };
docker = prev.docker_29; lxc-server = mkTarget { platform = "lxc"; buildType = "server"; hostPath = ./hosts/server/host.nix; };
docker_cli = prev.docker_29;
})
];
};
modules = [ linode-docker = mkTarget { platform = "linode"; buildType = "docker"; hostPath = ./hosts/docker/host.nix; };
inputs.disko.nixosModules.disko proxmox-docker = mkTarget { platform = "proxmox"; buildType = "docker"; hostPath = ./hosts/docker/host.nix; };
./hosts/docker/configuration.nix lxc-docker = mkTarget { platform = "lxc"; buildType = "docker"; hostPath = ./hosts/docker/host.nix; };
./modules/hardware-configuration/vm/proxmox.nix
home-manager.nixosModules.home-manager { linode-gui = mkTarget { platform = "linode"; buildType = "gui"; hostPath = ./hosts/nixos/host.nix; homeFile = ./hosts/nixos/home.nix; };
home-manager.useGlobalPkgs = true; proxmox-gui = mkTarget { platform = "proxmox"; buildType = "gui"; hostPath = ./hosts/nixos/host.nix; homeFile = ./hosts/nixos/home.nix; };
home-manager.useUserPackages = true; lxc-gui = mkTarget { platform = "lxc"; buildType = "gui"; hostPath = ./hosts/nixos/host.nix; homeFile = ./hosts/nixos/home.nix; };
home-manager.users.nixos = import ./modules/common/home.nix;
}
];
};
proxmox-pxe-boot = mkTarget { platform = "proxmox"; buildType = "pxe-boot"; hostPath = ./hosts/pxe-boot/host.nix; };
server = nixpkgs.lib.nixosSystem { lxc-pxe-boot = mkTarget { platform = "lxc"; buildType = "pxe-boot"; hostPath = ./hosts/pxe-boot/host.nix; };
inherit system;
modules = [
inputs.disko.nixosModules.disko
./hosts/server/configuration.nix
./modules/hardware-configuration/vm/proxmox.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nixos = import ./modules/common/home.nix;
}
];
};
nix-cache = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
inputs.disko.nixosModules.disko
./hosts/nix-cache/configuration.nix
./modules/hardware-configuration/vm/proxmox.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nixos = import ./modules/common/home.nix;
}
];
};
nix-minimal = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
inputs.disko.nixosModules.disko
./hosts/nix-minimal/configuration.nix
./modules/hardware-configuration/vm/proxmox.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nixos = import ./modules/common/home.nix;
}
];
};
pxe-boot = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
inputs.disko.nixosModules.disko
./hosts/pxe-boot/configuration.nix
./modules/hardware-configuration/vm/proxmox.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nixos = import ./modules/common/home.nix;
}
];
};
linode-minimal = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
# inputs.disko.nixosModules.disko
./hosts/linode-minimal/configuration.nix
./modules/hardware-configuration/vm/linode.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nixos = import ./modules/common/home.nix;
}
];
};
}; };
in
{
nixosConfigurations = generatedTargets;
}; };
} }
-70
View File
@@ -1,70 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, inputs, ... }:
{
imports =
[
../../modules/common/configuration.nix
../../modules/nix-cache/client.nix
../../modules/remote-builder-client.nix
../../modules/docker/mount-data.nix
../../modules/docker/enable-service.nix
../../modules/tailscale/enable-service.nix
../../modules/rotate-traefik-logs.nix
../../modules/raspi/mount-data.nix
../../modules/services/nextcloud-cron-job.nix
../../modules/services/docker-health-to-gotify.nix
../../modules/services/enable-rpcbind.nix
../../modules/disko/proxmox.nix
../../modules/boot/efi.nix
];
networking.hostName = "docker"; # Define your hostname.
networking.hostId = "007f0200";
boot.zfs.forceImportRoot = false;
environment.systemPackages = with pkgs; [
nfs-utils
];
boot.supportedFilesystems = [ "nfs" ];
systemd.tmpfiles.rules = [
"L+ /home/nixos/docker - - - - /mnt/docker/config"
"d /mnt/docker 0755 nixos users -"
"d /mnt/raspi-backup 0755 nixos users -"
];
users.users.nixos.extraGroups = [ "docker" ];
services.openssh.settings.PermitRootLogin = "yes";
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 80 8080 443 8090 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# 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.sta>
system.stateVersion = "25.05"; # Did you read the comment?
}
+11
View File
@@ -0,0 +1,11 @@
{ ... }:
{
networking.hostName = "docker";
networking.hostId = "007f0200";
boot.zfs.forceImportRoot = false;
# Preserved from the pre-refactor `docker` target — stateVersion must never
# be bumped on an already-installed machine.
system.stateVersion = "25.05";
}
-144
View File
@@ -1,144 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
../../modules/common/configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
# networking.hostName = "nixos"; # Define your hostname.
# Configure network connections interactively with nmcli or nmtui.
networking.networkmanager.enable = true;
# Set your time zone.
# time.timeZone = "Europe/Amsterdam";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# services.pulseaudio.enable = true;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = true;
# };
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# users.users.alice = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # Enable sudo for the user.
# packages = with pkgs; [
# tree
# ];
# };
# programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
environment.systemPackages = with pkgs; [
inetutils
mtr
sysstat
];
users.users.nixos = {
isNormalUser = true;
home = "/home/nixos";
description = "nixos";
extraGroups = [ "wheel" "networkmanager" ];
};
networking.usePredictableInterfaceNames = false;
networking.useDHCP = false;
networking.interfaces.eth0.useDHCP = true;
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
# settings.permitRootLogin = "yes";
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# 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 = "26.05"; # Did you read the comment?
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
networking.hostName = "linode-minimal";
# Preserved from the pre-refactor `linode-minimal` target — stateVersion
# must never be bumped on an already-installed machine.
system.stateVersion = "26.05";
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
networking.hostName = "lxc-minimal";
# No pre-existing deployed machine to preserve — pin explicitly to the
# current release rather than let it silently default.
system.stateVersion = "26.05";
}
-55
View File
@@ -1,55 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
../../modules/common/configuration.nix
../../modules/nix-cache/server.nix
../../modules/beszel/enable-agent.nix
../../modules/disko/proxmox.nix
../../modules/boot/efi.nix
];
networking.hostName = "nix-cache"; # Define your hostname.
services.beszel.agent.environment = {
#DOCKER_HOST = "tcp://docker-socket-proxy:2375";
#HUB_URL = "http://docker.sweet.home:8090";
KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPR9kwtC4TAeTRu46A7+opZsYpxqkRJ+x/ZyB2GWCeG";
TOKEN = "c9192e4c-7b5d-4910-8241-c2d68afadbac";
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 80 8080 443 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# 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.sta>
system.stateVersion = "25.05"; # Did you read the comment?
}
+16
View File
@@ -0,0 +1,16 @@
{ ... }:
{
networking.hostName = "nix-cache";
services.beszel.agent.environment = {
#DOCKER_HOST = "tcp://docker-socket-proxy:2375";
#HUB_URL = "http://docker.sweet.home:8090";
KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPR9kwtC4TAeTRu46A7+opZsYpxqkRJ+x/ZyB2GWCeG";
TOKEN = "c9192e4c-7b5d-4910-8241-c2d68afadbac";
};
# Preserved from the pre-refactor `nix-cache` target — stateVersion must
# never be bumped on an already-installed machine.
system.stateVersion = "25.05";
}
-50
View File
@@ -1,50 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
# inputs.disko.nixosModules.disko
../../modules/common/configuration.nix
../../modules/nix-cache/client.nix
../../modules/remote-builder-client.nix
../../modules/disko/proxmox.nix
../../modules/boot/efi.nix
];
networking.hostName = "nix-minimal"; # Define your hostname.
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ 80 8080 443 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# 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.sta>
system.stateVersion = "25.05"; # Did you read the comment?
}
-135
View File
@@ -1,135 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, inputs, ... }:
let
nixosConfEditor = builtins.getFlake "github:snowfallorg/nixos-conf-editor";
in {
#{
environment.systemPackages = with pkgs; [
inputs.nixos-conf-editor.packages.${pkgs.system}.nixos-conf-editor
nodejs
appimage-run
seahorse
vscode
p7zip
popsicle # balena-etcher
shotcut
gimp
pdfarranger
terminator
libreoffice-qt
transmission_4-qt
];
imports =
[ # Include the results of the hardware scan.
../../modules/common/configuration.nix
../../modules/nix-cache/client.nix
../../modules/remote-builder-client.nix
../../modules/disko/proxmox.nix
../../modules/boot/efi.nix
];
# Bootloader.
boot.loader.grub.useOSProber = true;
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Select internationalisation properties.
# i18n.defaultLocale = "en_AU.UTF-8";
# i18n.extraLocaleSettings = {
# LC_ADDRESS = "en_AU.UTF-8";
# LC_IDENTIFICATION = "en_AU.UTF-8";
# LC_MEASUREMENT = "en_AU.UTF-8";
# LC_MONETARY = "en_AU.UTF-8";
# LC_NAME = "en_AU.UTF-8";
# LC_NUMERIC = "en_AU.UTF-8";
# LC_PAPER = "en_AU.UTF-8";
# LC_TELEPHONE = "en_AU.UTF-8";
# LC_TIME = "en_AU.UTF-8";
# };
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the Cinnamon Desktop Environment.
services.xserver.displayManager.lightdm.enable = true;
services.xserver.desktopManager.cinnamon.enable = true;
# services.xserver.desktopManager.xfce.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "au";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
# services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
users.users.nixos.extraGroups = [ "networkmanager" ]; # Enable sudo for the user.
# Install firefox.
programs.firefox.enable = true;
system.stateVersion = "25.05"; # Did you read the comment?
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "cinnamon-session";
services.xrdp.openFirewall = true;
nixpkgs.config.allowUnfree = true;
services.gnome.gnome-keyring.enable = true;
# security.pam.services.lightdm.enableGnomeKeyring = true;
# services.gnome.gnome-keyring.enable = true;
security.pam.services.login.enableGnomeKeyring = true;
services.xserver.displayManager.sessionCommands = ''
eval $(gnome-keyring-daemon --start --components=secrets,ssh)
export SSH_AUTH_SOCK
'';
# systemd.services.nextcloud-appimage = {
# enable = true;
# Unit = {
# Description = "Nextcloud AppImage client";
# After = [ "graphical-session.target" ];
# Wants = [ "graphical-session.target" ]; # optional but helpful
# };
# Service = {
# ExecStart = "/run/current-system/sw/bin/appimage-run /home/nixos/Applications/Nextcloud.AppImage --background";
# Restart = "on-failure";
# # You can add RestartSec = "5s"; if you like
# };
# Install = {
# WantedBy = [ "default.target" ];
# };
# };
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
networking.hostName = "nixos";
# Preserved from the pre-refactor `nixos` target — stateVersion must never
# be bumped on an already-installed machine.
system.stateVersion = "25.05";
}
+12
View File
@@ -0,0 +1,12 @@
{ ... }:
{
# Preserves the hostname of the existing, already-deployed machine
# (previously the flat `nix-minimal` target) — the flake attribute name
# changed, the real machine's hostname did not.
networking.hostName = "nix-minimal";
# Preserved from the pre-refactor `nix-minimal` target — stateVersion must
# never be bumped on an already-installed machine.
system.stateVersion = "25.05";
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
networking.hostName = "pxe-boot";
# Preserved from the pre-refactor `pxe-boot` target — stateVersion must
# never be bumped on an already-installed machine.
system.stateVersion = "25.05";
}
-78
View File
@@ -1,78 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, inputs,... }:
{
imports =
[ # Include the results of the hardware scan.
../../modules/common/configuration.nix
../../modules/nix-cache/client.nix
../../modules/remote-builder-client.nix
../../modules/beszel/enable-agent.nix
../../modules/services/enable-rpcbind.nix
../../modules/services/zfs/enable-service.nix
# ../../modules/services/zfs/auto-mount-volumes.nix
../../modules/disko/proxmox.nix
../../modules/boot/efi.nix
];
networking.hostName = "server"; # Define your hostname.
networking.hostId = "6689f93e";
boot.zfs.extraPools = [ "tank" ];
services.beszel.agent.environment = {
#DOCKER_HOST = "tcp://docker-socket-proxy:2375";
#HUB_URL = "http://docker.sweet.home:8090";
KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPR9kwtC4TAeTRu46A7+opZsYpxqkRJ+x/ZyB2GWCeG";
TOKEN = "48e71783-35df-4ea0-a8c2-05bc5e020d2e";
EXTRA_FILESYSTEMS="/tank/docker/volumes";
LOG_LEVEL="debug";
};
systemd.services.nfs-server = {
after = [ "zfs-mount.service" ];
requires = [ "zfs-mount.service" ];
};
services.nfs.server = {
enable = true;
exports = ''
/tank/docker/config 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/docker/volumes 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/docker/databases 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/docker/nextcloud-data 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/raspi/volumes 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
'';
};
networking.firewall.allowedTCPPorts = [ 111 2049 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# 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.sta>
system.stateVersion = "25.05"; # Did you read the comment?
}
+19
View File
@@ -0,0 +1,19 @@
{ ... }:
{
networking.hostName = "server";
networking.hostId = "6689f93e";
services.beszel.agent.environment = {
#DOCKER_HOST = "tcp://docker-socket-proxy:2375";
#HUB_URL = "http://docker.sweet.home:8090";
KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFPR9kwtC4TAeTRu46A7+opZsYpxqkRJ+x/ZyB2GWCeG";
TOKEN = "48e71783-35df-4ea0-a8c2-05bc5e020d2e";
EXTRA_FILESYSTEMS = "/tank/docker/volumes";
LOG_LEVEL = "debug";
};
# Preserved from the pre-refactor `server` target — stateVersion must never
# be bumped on an already-installed machine.
system.stateVersion = "25.05";
}
+40
View File
@@ -0,0 +1,40 @@
{ pkgs, ... }:
{
# Pins the Docker Engine version, carried forward from the pre-refactor
# `docker` target's inline pkgs overlay.
nixpkgs.overlays = [
(final: prev: {
docker = prev.docker_29;
docker_cli = prev.docker_29;
})
];
imports = [
../docker/mount-data.nix
../docker/enable-service.nix
../tailscale/enable-service.nix
../rotate-traefik-logs.nix
../raspi/mount-data.nix
../services/nextcloud-cron-job.nix
../services/docker-health-to-gotify.nix
../services/enable-rpcbind.nix
];
environment.systemPackages = with pkgs; [
nfs-utils
];
boot.supportedFilesystems = [ "nfs" ];
systemd.tmpfiles.rules = [
"L+ /home/nixos/docker - - - - /mnt/docker/config"
"d /mnt/docker 0755 nixos users -"
"d /mnt/raspi-backup 0755 nixos users -"
];
users.users.nixos.extraGroups = [ "docker" ];
services.openssh.settings.PermitRootLogin = "yes";
networking.firewall.allowedTCPPorts = [ 80 8080 443 8090 ];
}
+57
View File
@@ -0,0 +1,57 @@
{ config, pkgs, lib, inputs, ... }:
{
environment.systemPackages = with pkgs; [
inputs.nixos-conf-editor.packages.${pkgs.system}.nixos-conf-editor
nodejs
appimage-run
seahorse
vscode
p7zip
popsicle # balena-etcher
shotcut
gimp
pdfarranger
terminator
libreoffice-qt
transmission_4-qt
];
boot.loader.grub.useOSProber = true;
services.xserver.enable = true;
services.xserver.displayManager.lightdm.enable = true;
services.xserver.desktopManager.cinnamon.enable = true;
services.xserver.xkb = {
layout = "au";
variant = "";
};
services.printing.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
users.users.nixos.extraGroups = [ "networkmanager" ];
programs.firefox.enable = true;
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "cinnamon-session";
services.xrdp.openFirewall = true;
nixpkgs.config.allowUnfree = true;
services.gnome.gnome-keyring.enable = true;
security.pam.services.login.enableGnomeKeyring = true;
services.xserver.displayManager.sessionCommands = ''
eval $(gnome-keyring-daemon --start --components=secrets,ssh)
export SSH_AUTH_SOCK
'';
}
+13
View File
@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
networking.networkmanager.enable = true;
users.users.nixos.extraGroups = [ "networkmanager" ];
environment.systemPackages = with pkgs; [
inetutils
mtr
sysstat
];
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
../nix-cache/server.nix
../beszel/enable-agent.nix
];
}
@@ -91,17 +91,6 @@ let
''; '';
in in
{ {
imports =
[
../../modules/common/configuration.nix
../../modules/nix-cache/client.nix
../../modules/remote-builder-client.nix
../../modules/disko/proxmox.nix
../../modules/boot/efi.nix
];
networking.hostName = "pxe-boot";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
ipxe ipxe
]; ];
@@ -164,6 +153,4 @@ in
networking.firewall.allowedTCPPorts = [ 80 ]; networking.firewall.allowedTCPPorts = [ 80 ];
networking.firewall.allowedUDPPorts = [ 69 ]; networking.firewall.allowedUDPPorts = [ 69 ];
system.stateVersion = "25.05";
} }
+28
View File
@@ -0,0 +1,28 @@
{ ... }:
{
imports = [
../beszel/enable-agent.nix
../services/zfs/enable-service.nix
];
boot.zfs.extraPools = [ "tank" ];
systemd.services.nfs-server = {
after = [ "zfs-mount.service" ];
requires = [ "zfs-mount.service" ];
};
services.nfs.server = {
enable = true;
exports = ''
/tank/docker/config 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/docker/volumes 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/docker/databases 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/docker/nextcloud-data 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
/tank/raspi/volumes 192.168.2.0/24(rw,sync,no_subtree_check,no_root_squash)
'';
};
networking.firewall.allowedTCPPorts = [ 111 2049 ];
}
+8 -3
View File
@@ -1,19 +1,24 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
# Flake attribute names are now <platform>-<buildtype> (e.g. proxmox-docker)
# and no longer match networking.hostName, since a host's hostname stays
# fixed while the platform backing it can change. Each nixosConfiguration
# stamps its own active target name into /etc/flake-target at build time.
mySwitchCmd = '' mySwitchCmd = ''
sudo nixos-rebuild switch \ sudo nixos-rebuild switch \
--no-write-lock-file \ --no-write-lock-file \
--refresh \ --refresh \
--flake git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#$(hostname) --flake git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#$(cat /etc/flake-target)
''; '';
myTestCmd = '' myTestCmd = ''
sudo nixos-rebuild test \ sudo nixos-rebuild test \
--no-write-lock-file \ --no-write-lock-file \
--refresh \ --refresh \
--flake git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#$(hostname) --flake git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#$(cat /etc/flake-target)
''; '';
in { in
{
programs.bash = { programs.bash = {
enable = true; enable = true;
shellAliases = { shellAliases = {
+13
View File
@@ -0,0 +1,13 @@
{ ... }:
{
imports = [
../hardware-configuration/vm/linode.nix
];
networking = {
usePredictableInterfaceNames = false;
useDHCP = false;
interfaces.eth0.useDHCP = true;
};
}
+8
View File
@@ -0,0 +1,8 @@
{ ... }:
{
boot.isContainer = true;
boot.loader.grub.enable = false;
boot.loader.systemd-boot.enable = false;
}
+9
View File
@@ -0,0 +1,9 @@
{ ... }:
{
imports = [
../hardware-configuration/vm/proxmox.nix
../boot/efi.nix
../disko/proxmox.nix
];
}