From ea0ffb99d96ef6e36155e158e9c1482735cd95c3 Mon Sep 17 00:00:00 2001 From: MathisWellmann Date: Fri, 26 Jun 2026 16:58:35 +0100 Subject: [PATCH 1/6] Include `dirge` input. --- flake.lock | 101 +++++++++++++++++++++++++++------------- flake.nix | 1 + home/home.nix | 1 - modules/ai/local_ai.nix | 1 + 4 files changed, 70 insertions(+), 34 deletions(-) diff --git a/flake.lock b/flake.lock index 2d1a377..48e847e 100644 --- a/flake.lock +++ b/flake.lock @@ -136,6 +136,24 @@ "type": "github" } }, + "dirge": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1782480809, + "narHash": "sha256-fFv1DzbZUn4p8LExpTlqGnpVofL3vckxpJG1MI2d4zQ=", + "owner": "dirge-code", + "repo": "dirge", + "rev": "5475e741f9c73d962c1a703efac7169cee1faf45", + "type": "github" + }, + "original": { + "owner": "dirge-code", + "repo": "dirge", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -304,7 +322,7 @@ }, "forgecode": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1776782580, @@ -361,7 +379,7 @@ "hermes-agent": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "pyproject-build-systems": "pyproject-build-systems", "pyproject-nix": "pyproject-nix_2", "uv2nix": "uv2nix_2" @@ -424,7 +442,7 @@ "iggy": { "inputs": { "flakeUtils": "flakeUtils", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "rust-overlay": "rust-overlay_2" }, "locked": { @@ -444,7 +462,7 @@ }, "kopuz": { "inputs": { - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "rust-overlay": "rust-overlay_3" }, "locked": { @@ -466,7 +484,7 @@ "blueprint": "blueprint", "bun2nix": "bun2nix", "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "systems": "systems_4", "treefmt-nix": "treefmt-nix" }, @@ -544,7 +562,7 @@ "inputs": { "flake-utils": "flake-utils_3", "nix-kube-generators": "nix-kube-generators_2", - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1781010231, @@ -593,6 +611,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1752950548, + "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1780749050, "narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=", @@ -608,7 +642,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1780930886, "narHash": "sha256-rppURzHviaQN131F+nLiLdGfcb0uCd9gGP0E5+iw9MI=", @@ -624,7 +658,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_13": { "locked": { "lastModified": 1775036866, "narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=", @@ -657,6 +691,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1781577229, + "narHash": "sha256-lrp67w8AulE9Ks53n27I45ADSzbOCn4H+CNW1Ck8B+8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "567a49d1913ce81ac6e9582e3553dd90a955875f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1773282481, "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=", @@ -672,7 +722,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1775036866, "narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=", @@ -688,7 +738,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1781074563, "narHash": "sha256-md8WlXOlfnIeHeOScMTTHFyf2d6iaTwPl2apR5EQ3P4=", @@ -704,7 +754,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1744536153, "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", @@ -720,7 +770,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1776877367, "narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=", @@ -736,7 +786,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1781607440, "narHash": "sha256-rxO+uc/KFbSJp+pgyXRuAX6QlG9hJdnt0BXpEQRXY+U=", @@ -752,27 +802,11 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1752950548, - "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nox": { "inputs": { "flake-utils": "flake-utils_4", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_10" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1774976368, @@ -930,6 +964,7 @@ "inputs": { "agenix": "agenix", "awww": "awww", + "dirge": "dirge", "flake-utils": "flake-utils", "forgecode": "forgecode", "hermes-agent": "hermes-agent", @@ -968,7 +1003,7 @@ }, "rust-overlay_2": { "inputs": { - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1781320681, @@ -1007,7 +1042,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1775682595, @@ -1027,7 +1062,7 @@ "inputs": { "crane": "crane", "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_12" + "nixpkgs": "nixpkgs_13" }, "locked": { "lastModified": 1778953830, diff --git a/flake.nix b/flake.nix index eb13903..dea54e9 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ kopuz.url = "github:temidaradev/kopuz"; stochos.url = "github:museslabs/stochos"; nixidy.url = "github:arnarg/nixidy"; + dirge.url = "github:dirge-code/dirge"; # Helm charts packaged as nix derivations, used by nixidy applications. nixhelm = { url = "github:farcaller/nixhelm"; diff --git a/home/home.nix b/home/home.nix index e9c3e86..d9ee6d8 100644 --- a/home/home.nix +++ b/home/home.nix @@ -124,7 +124,6 @@ in { dust # Check disk usage of directories. broot # Navigate directory trees. ouch # Obvious unified compression helper - rage # Modern encryption implemented in rust. Go reference is `age` # bend # A massively parallel, high-level programming language # futhark # A data-parallel functional programming language kew # music player for shell diff --git a/modules/ai/local_ai.nix b/modules/ai/local_ai.nix index 71da87d..0d395ab 100644 --- a/modules/ai/local_ai.nix +++ b/modules/ai/local_ai.nix @@ -5,6 +5,7 @@ }: { environment.systemPackages = with pkgs; [ inputs.forgecode.packages.${pkgs.stdenv.hostPlatform.system}.forge + inputs.dirge.packages.${pkgs.stdenv.hostPlatform.system}.default # mistral-rs # vllm # Fails to build claude-code From 8bd638ced28b167f171e904aaa99bcf4f6432f5f Mon Sep 17 00:00:00 2001 From: MathisWellmann Date: Fri, 26 Jun 2026 16:58:35 +0100 Subject: [PATCH 2/6] fix minor nits. --- .gitignore | 1 + README.md | 2 +- hosts/meshify/configuration.nix | 5 ----- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index e2e1909..bc4e447 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ nixos.qcow2 result cheatsheet.pdf +.dirge/ diff --git a/README.md b/README.md index c8bdf9b..52cdf32 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ nix flake metadata . Update a specific input (e.g. `nixpkgs`): ```sh -nix flake lock --update-input nixpkgs +nix flake lock --update-input nixpkgs-unstable ``` Then rebuild the system, e.g. for the `meshify` host: diff --git a/hosts/meshify/configuration.nix b/hosts/meshify/configuration.nix index 45368b6..0d5e807 100644 --- a/hosts/meshify/configuration.nix +++ b/hosts/meshify/configuration.nix @@ -118,11 +118,6 @@ in { }; }; npm.enable = true; - # E.g `kani` requires this if installed with `cargo install --locked kani` - nix-ld = { - enable = true; - libraries = []; - }; }; virtualisation = { docker.enable = true; From 97694dc8681b3d782f592af2f06dfd0bf33b4782 Mon Sep 17 00:00:00 2001 From: MathisWellmann Date: Fri, 26 Jun 2026 17:31:32 +0100 Subject: [PATCH 3/6] hosts: remove redundant import of home-manager --- hosts/de-msa2/configuration.nix | 1 - hosts/de-n5/configuration.nix | 1 - hosts/desg0/configuration.nix | 1 - hosts/elitedesk/configuration.nix | 1 - hosts/meshify/configuration.nix | 41 ----------------------------- hosts/razerblade/configuration.nix | 1 - hosts/superserver/configuration.nix | 1 - hosts/tensorbook/configuration.nix | 1 - 8 files changed, 48 deletions(-) diff --git a/hosts/de-msa2/configuration.nix b/hosts/de-msa2/configuration.nix index 58464bd..1fbbcf4 100644 --- a/hosts/de-msa2/configuration.nix +++ b/hosts/de-msa2/configuration.nix @@ -30,7 +30,6 @@ in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - inputs.home-manager.nixosModules.default ./../../modules/user_m.nix ./../../modules/bash_aliases.nix ./../../modules/german_locale.nix diff --git a/hosts/de-n5/configuration.nix b/hosts/de-n5/configuration.nix index 5e018a7..344a0de 100644 --- a/hosts/de-n5/configuration.nix +++ b/hosts/de-n5/configuration.nix @@ -12,7 +12,6 @@ in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - inputs.home-manager.nixosModules.default ./../../modules/user_m.nix ./../../modules/bash_aliases.nix ./../../modules/german_locale.nix diff --git a/hosts/desg0/configuration.nix b/hosts/desg0/configuration.nix index b3b2b36..0eb1880 100644 --- a/hosts/desg0/configuration.nix +++ b/hosts/desg0/configuration.nix @@ -35,7 +35,6 @@ in { enableAgentica = true; }) forgejo_runner - inputs.home-manager.nixosModules.default ]; networking = { diff --git a/hosts/elitedesk/configuration.nix b/hosts/elitedesk/configuration.nix index b38f504..c7698c1 100644 --- a/hosts/elitedesk/configuration.nix +++ b/hosts/elitedesk/configuration.nix @@ -15,7 +15,6 @@ in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - inputs.home-manager.nixosModules.default ./../../modules/user_m.nix ./../../modules/bash_aliases.nix ./../../modules/german_locale.nix diff --git a/hosts/meshify/configuration.nix b/hosts/meshify/configuration.nix index 0d5e807..cfa38e4 100644 --- a/hosts/meshify/configuration.nix +++ b/hosts/meshify/configuration.nix @@ -12,21 +12,9 @@ hostname = "meshify"; const = import ./constants.nix {}; global_const = import ../../global_constants.nix; - # vllm = import ./../../modules/ai/vllm_cuda_container.nix { - # port = const.vllm_port; - # # model = "Qwen/Qwen3.5-27B"; - # # model = "google/gemma-4-31B-it"; - # model = "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4"; - # }; - # tensorrt = import ./../../modules/ai/tensorrt_llm_container.nix { - # port = const.tensorrt_port; - # }; in { imports = [ ./hardware-configuration.nix - inputs.home-manager.nixosModules.default - inputs.sops-nix.nixosModules.sops - # inputs.agentica-framework.nixosModules.agentica-chat ./../../modules/user_m.nix ./../../modules/bash_aliases.nix ./../../modules/german_locale.nix @@ -35,9 +23,7 @@ in { ./../../modules/desktop_nvidia.nix ./../../modules/mullvad_tailscale.nix (import ./../../modules/remote_builder.nix {}) - # ./../../modules/mount_external_drives.nix ./../../modules/mount_remote_nfs_exports.nix - # ./../../modules/backup_home_to_remote.nix ./../../modules/prometheus_exporter.nix ./../../modules/yubi_key.nix ./../../modules/nix_binary_cache_client.nix @@ -126,42 +112,15 @@ in { services = { blueman.enable = true; - # backup_home_to_remote = { - # enable = true; - # local_username = "${global_const.username}"; - # backup_host_addr = "poweredge"; - # backup_host_name = "poweredge"; - # backup_host_dir = "/SATA_SSD_POOL/backup_${hostname}"; - # }; mount_remote_nfs_exports = { enable = true; nfs_host_name = "de-msa2"; nfs_host_addr = "de-msa2"; nfs_dirs = map (dir: "/nvme_pool/${dir}") ["video" "series" "movies" "music" "magewe"]; }; - # agentica-chat = { - # enable = true; - # sourceDir = "/home/m/symbolica/agentica-framework"; - # environmentFile = "/etc/secrets/agentica-framework"; - # frontendPort = 5173; - # openFirewall = true; - # }; }; programs.steam.enable = true; - # fileSystems = { - # "/mnt/elitedesk_series" = { - # device = "${static_ips.elitedesk_ip}:/external_hdd/series"; - # fsType = "nfs"; - # options = ["rw" "rsize=131072" "wsize=131072"]; - # }; - # "/mnt/elitedesk_movies" = { - # device = "${static_ips.elitedesk_ip}:/external_hdd/movies"; - # fsType = "nfs"; - # options = ["rw" "rsize=131072" "wsize=131072"]; - # }; - # }; - sops = { defaultSopsFile = "./../../sops_secrets.yaml"; defaultSopsFormat = "yaml"; diff --git a/hosts/razerblade/configuration.nix b/hosts/razerblade/configuration.nix index 03b5a2b..4d58849 100644 --- a/hosts/razerblade/configuration.nix +++ b/hosts/razerblade/configuration.nix @@ -13,7 +13,6 @@ in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - inputs.home-manager.nixosModules.default ./../../modules/user_m.nix ./../../modules/bash_aliases.nix ./../../modules/german_locale.nix diff --git a/hosts/superserver/configuration.nix b/hosts/superserver/configuration.nix index fb19d76..59d3abc 100644 --- a/hosts/superserver/configuration.nix +++ b/hosts/superserver/configuration.nix @@ -13,7 +13,6 @@ }; in { imports = [ - inputs.home-manager.nixosModules.default ./hardware-configuration.nix ./../../modules/bash_aliases.nix ./../../modules/german_locale.nix diff --git a/hosts/tensorbook/configuration.nix b/hosts/tensorbook/configuration.nix index 09980e1..121a8f2 100644 --- a/hosts/tensorbook/configuration.nix +++ b/hosts/tensorbook/configuration.nix @@ -13,7 +13,6 @@ in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - inputs.home-manager.nixosModules.default ./../../modules/user_m.nix ./../../modules/bash_aliases.nix ./../../modules/german_locale.nix From bfcea0c2882abf7e8b00ed77b34eb49db195a9b0 Mon Sep 17 00:00:00 2001 From: MathisWellmann Date: Fri, 26 Jun 2026 17:31:32 +0100 Subject: [PATCH 4/6] home: use `system` more explicitly. --- home/home.nix | 2 +- home/home_hyprland.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/home/home.nix b/home/home.nix index d9ee6d8..379b547 100644 --- a/home/home.nix +++ b/home/home.nix @@ -35,7 +35,7 @@ in { home.packages = with pkgs; [ # From inputs # inputs.nox.packages.${pkgs.stdenv.hostPlatform.system}.default # Nix options search - inputs.nixidy.packages.${system}.default + inputs.nixidy.packages.${pkgs.stdenv.hostPlatform.system}.default # Fonts terminus_font diff --git a/home/home_hyprland.nix b/home/home_hyprland.nix index 4080e96..0ae4f81 100644 --- a/home/home_hyprland.nix +++ b/home/home_hyprland.nix @@ -12,8 +12,8 @@ # The home.packages option allows you to install Nix packages into your # environment. home.packages = with pkgs; [ - inputs.kopuz.packages.${system}.default # Music GUI - inputs.stochos.packages.${system}.default # keyboard driven mouse control + inputs.kopuz.packages.${pkgs.stdenv.hostPlatform.system}.default # Music GUI + inputs.stochos.packages.${pkgs.stdenv.hostPlatform.system}.default # keyboard driven mouse control inputs.awww.packages.${pkgs.stdenv.hostPlatform.system}.awww # Desktop firefox From 7a8eb98dc4880b4fd1eb4012aa9afddd3560ef31 Mon Sep 17 00:00:00 2001 From: MathisWellmann Date: Fri, 26 Jun 2026 17:31:32 +0100 Subject: [PATCH 5/6] flake: create `mkHost` function to deduplicate code. --- flake.nix | 121 +++++++++++++++++++++--------------------------------- 1 file changed, 46 insertions(+), 75 deletions(-) diff --git a/flake.nix b/flake.nix index dea54e9..2c607ec 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,21 @@ } @ inputs: let system = "x86_64-linux"; pkgs = import nixpkgs-unstable {inherit system;}; + # Build a NixOS configuration for a host in `hosts//`. + # `home-manager` is always wired in here so individual host + # `configuration.nix` files don't each re-import it. `extraModules` + # carries host-specific flake modules (agenix, sops, hermes-agent, ...). + mkHost = name: extraModules: + nixpkgs-unstable.lib.nixosSystem { + inherit system; + specialArgs = {inherit inputs;}; + modules = + [ + ./hosts/${name}/configuration.nix + home-manager.nixosModules.default + ] + ++ extraModules; + }; in { nixidyEnvs."${system}" = nixidy.lib.mkEnvs { inherit pkgs; @@ -72,82 +87,38 @@ }; # The nixidy CLI, e.g. `nix run .#nixidy -- switch .#prod` packages."${system}".nixidy = nixidy.packages.${system}.default; + nixosConfigurations = { - meshify = nixpkgs-unstable.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; - modules = [ - ./hosts/meshify/configuration.nix - home-manager.nixosModules.default - inputs.agenix.nixosModules.default - inputs.sops-nix.nixosModules.sops - hermes-agent.nixosModules.default - {_module.args = inputs;} - ]; - }; - superserver = nixpkgs-unstable.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/superserver/configuration.nix - inputs.home-manager.nixosModules.default - inputs.agenix.nixosModules.default - ]; - }; - elitedesk = nixpkgs-unstable.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/elitedesk/configuration.nix - inputs.agenix.nixosModules.default - inputs.home-manager.nixosModules.default - ]; - }; - poweredge = nixpkgs-unstable.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/poweredge/configuration.nix - inputs.home-manager.nixosModules.default - ]; - }; - razerblade = nixpkgs-unstable.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/razerblade/configuration.nix - {_module.args = inputs;} - ]; - }; - desg0 = nixpkgs-unstable.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/desg0/configuration.nix - inputs.agenix.nixosModules.default - {_module.args = inputs;} - ]; - }; - de-msa2 = nixpkgs-unstable.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/de-msa2/configuration.nix - inputs.agenix.nixosModules.default - {_module.args = inputs;} - ]; - }; - de-n5 = nixpkgs-unstable.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/de-n5/configuration.nix - {_module.args = inputs;} - ]; - }; - tensorbook = nixpkgs-unstable.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./hosts/tensorbook/configuration.nix - {_module.args = inputs;} - ]; - }; + meshify = mkHost "meshify" [ + inputs.agenix.nixosModules.default + inputs.sops-nix.nixosModules.sops + hermes-agent.nixosModules.default + {_module.args = inputs;} + ]; + superserver = mkHost "superserver" [ + inputs.agenix.nixosModules.default + ]; + elitedesk = mkHost "elitedesk" [ + inputs.agenix.nixosModules.default + ]; + poweredge = mkHost "poweredge" []; + razerblade = mkHost "razerblade" [ + {_module.args = inputs;} + ]; + desg0 = mkHost "desg0" [ + inputs.agenix.nixosModules.default + {_module.args = inputs;} + ]; + de-msa2 = mkHost "de-msa2" [ + inputs.agenix.nixosModules.default + {_module.args = inputs;} + ]; + de-n5 = mkHost "de-n5" [ + {_module.args = inputs;} + ]; + tensorbook = mkHost "tensorbook" [ + {_module.args = inputs;} + ]; }; apps = { "${system}" = rec { From c54109094b5831edd04a34403724dae4cb57e848 Mon Sep 17 00:00:00 2001 From: MathisWellmann Date: Fri, 26 Jun 2026 17:31:32 +0100 Subject: [PATCH 6/6] include `treefmt` --- flake.lock | 37 ++++++++++++++++++++++++++++++++++- flake.nix | 3 +++ hosts/de-msa2/constants.nix | 2 +- hosts/de-msa2/readeck.nix | 2 +- hosts/de-n5/constants.nix | 2 +- hosts/desg0/constants.nix | 2 +- hosts/elitedesk/constants.nix | 2 +- hosts/meshify/constants.nix | 2 +- hosts/poweredge/constants.nix | 2 +- modules/ai/ollama.nix | 14 +------------ modules/ai/pi-agent.nix | 2 +- modules/constants.nix | 4 +--- modules/monero_miner.nix | 2 +- modules/remote_builder.nix | 2 +- treefmt.nix | 10 ++++++++++ vms/tor.nix | 2 +- 16 files changed, 62 insertions(+), 28 deletions(-) create mode 100644 treefmt.nix diff --git a/flake.lock b/flake.lock index 48e847e..ee4f2f4 100644 --- a/flake.lock +++ b/flake.lock @@ -674,6 +674,22 @@ "type": "github" } }, + "nixpkgs_14": { + "locked": { + "lastModified": 1770107345, + "narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4533d9293756b63904b7238acb84ac8fe4c8c2c4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1763934636, @@ -977,7 +993,8 @@ "nixpkgs-unstable": "nixpkgs-unstable", "nox": "nox", "sops-nix": "sops-nix", - "stochos": "stochos" + "stochos": "stochos", + "treefmt-nix": "treefmt-nix_2" } }, "rust-overlay": { @@ -1219,6 +1236,24 @@ "type": "github" } }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": "nixpkgs_14" + }, + "locked": { + "lastModified": 1780220602, + "narHash": "sha256-eynAfOmbmxJnkp7YewvCEbShNnnYJ9gLLqkzsYtBPeM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "db947814a175b7ca6ded66e21383d938df01c227", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "uv2nix": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 2c607ec..7f4da5c 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ inputs = { nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; + treefmt-nix.url = "github:numtide/treefmt-nix"; home-manager = { url = "github:nix-community/home-manager"; @@ -74,6 +75,7 @@ ] ++ extraModules; }; + treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in { nixidyEnvs."${system}" = nixidy.lib.mkEnvs { inherit pkgs; @@ -120,6 +122,7 @@ {_module.args = inputs;} ]; }; + formatter.${system} = treefmtEval.config.build.wrapper; apps = { "${system}" = rec { default = list_apps; diff --git a/hosts/de-msa2/constants.nix b/hosts/de-msa2/constants.nix index 5464fb0..29d1377 100644 --- a/hosts/de-msa2/constants.nix +++ b/hosts/de-msa2/constants.nix @@ -1,4 +1,4 @@ -{...}: let +_: let shared = import ../../modules/ports.nix; in { nfs_port = shared.nfs; diff --git a/hosts/de-msa2/readeck.nix b/hosts/de-msa2/readeck.nix index baf2ca2..27a9da9 100644 --- a/hosts/de-msa2/readeck.nix +++ b/hosts/de-msa2/readeck.nix @@ -1,7 +1,7 @@ { dir, port ? 8080, -}: {...}: { +}: _: { virtualisation.oci-containers.containers = { "readeck" = { image = "codeberg.org/readeck/readeck:latest"; diff --git a/hosts/de-n5/constants.nix b/hosts/de-n5/constants.nix index ad64600..48ec631 100644 --- a/hosts/de-n5/constants.nix +++ b/hosts/de-n5/constants.nix @@ -1,4 +1,4 @@ -{...}: let +_: let shared = import ../../modules/ports.nix; in { nfs_port = shared.nfs; diff --git a/hosts/desg0/constants.nix b/hosts/desg0/constants.nix index ec0f015..2daefdf 100644 --- a/hosts/desg0/constants.nix +++ b/hosts/desg0/constants.nix @@ -1,4 +1,4 @@ -{...}: { +_: { hostname = "desg0"; open-webui_port = 3000; diff --git a/hosts/elitedesk/constants.nix b/hosts/elitedesk/constants.nix index 8ebd553..91cb387 100644 --- a/hosts/elitedesk/constants.nix +++ b/hosts/elitedesk/constants.nix @@ -1,4 +1,4 @@ -{...}: { +_: { # Ports homer_port = 80; jellyfin_port = 8096; diff --git a/hosts/meshify/constants.nix b/hosts/meshify/constants.nix index 5d34928..7849ec5 100644 --- a/hosts/meshify/constants.nix +++ b/hosts/meshify/constants.nix @@ -1,4 +1,4 @@ -{...}: { +_: { open-webui_port = 8080; vllm_port = 8000; llama-cpp_port = 8001; diff --git a/hosts/poweredge/constants.nix b/hosts/poweredge/constants.nix index 9c7c48c..f83c2e4 100644 --- a/hosts/poweredge/constants.nix +++ b/hosts/poweredge/constants.nix @@ -1,4 +1,4 @@ -{...}: let +_: let shared = import ../../modules/ports.nix; in { # Constants regarding the `poweredge` host. diff --git a/modules/ai/ollama.nix b/modules/ai/ollama.nix index eceae22..447f00e 100644 --- a/modules/ai/ollama.nix +++ b/modules/ai/ollama.nix @@ -1,16 +1,4 @@ -{...}: let - # new_ollama = pkgs.ollama.overrideAttrs (oldAttrs: rec { - # version = "0.20.2"; - # doCheck = false; - # doTest = false; - # src = pkgs.fetchFromGitHub { - # owner = "ollama"; - # repo = "ollama"; - # rev = "v${version}"; - # hash = "sha256-Ic3eLOohLR7MQGkLvDJBNOCiBBKxh6l8X9MgK0b4w+Y="; - # }; - # }); -in { +_: { services.ollama = { enable = true; # package = new_ollama; diff --git a/modules/ai/pi-agent.nix b/modules/ai/pi-agent.nix index bb84258..5c04bc9 100644 --- a/modules/ai/pi-agent.nix +++ b/modules/ai/pi-agent.nix @@ -8,7 +8,7 @@ inputs, ... }: let - lib = pkgs.lib; + inherit (pkgs) lib; pi-models-config = (pkgs.formats.json {}).generate "pi-agent-models.json" { providers = { diff --git a/modules/constants.nix b/modules/constants.nix index 15d44a8..f4c054a 100644 --- a/modules/constants.nix +++ b/modules/constants.nix @@ -1,5 +1,3 @@ -{...}: let - ports = import ./ports.nix; -in { +_: { adguardhome_port = 5000; } diff --git a/modules/monero_miner.nix b/modules/monero_miner.nix index 1b9223f..01cfe76 100644 --- a/modules/monero_miner.nix +++ b/modules/monero_miner.nix @@ -1,4 +1,4 @@ -{max-threads-hint ? 25}: {...}: { +{max-threads-hint ? 25}: _: { services.xmrig = { enable = true; settings = { diff --git a/modules/remote_builder.nix b/modules/remote_builder.nix index 8ef3013..5df244c 100644 --- a/modules/remote_builder.nix +++ b/modules/remote_builder.nix @@ -1,4 +1,4 @@ -{hostname ? "desg0"}: _: { +_: _: { # Use remote builder machine # Make sure the `root` user can `ssh` into the host: # sudo mkdir -p /root/.ssh diff --git a/treefmt.nix b/treefmt.nix new file mode 100644 index 0000000..4a0e70a --- /dev/null +++ b/treefmt.nix @@ -0,0 +1,10 @@ +# treefmt config (consumed by numtide/treefmt-nix). +# Run `nix fmt` to format, or `nix flake check` to verify formatting in CI. +_: { + projectRootFile = "flake.nix"; + programs = { + alejandra.enable = true; + deadnix.enable = true; + statix.enable = true; + }; +} diff --git a/vms/tor.nix b/vms/tor.nix index 879505c..0eec95c 100644 --- a/vms/tor.nix +++ b/vms/tor.nix @@ -2,7 +2,7 @@ let pkgs = import {}; - tor_vm = {...}: { + tor_vm = _: { users = { users.root.initialPassword = "test"; users.guest = {