{ description = "Harald Hoyer's Nix Configurations"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; # NixPkgs Unstable (nixos-unstable) unstable.url = "github:nixos/nixpkgs/nixos-unstable"; cratedocs = { url = "git+https://git.hoyer.xyz/harald/cratedocs-mcp.git"; inputs.nixpkgs.follows = "nixpkgs"; }; crane.url = "github:ipetkov/crane/v0.20.3"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; lanzaboote = { url = "github:nix-community/lanzaboote/v0.4.3"; inputs.nixpkgs.follows = "nixpkgs"; inputs.crane.follows = "crane"; inputs.rust-overlay.follows = "rust-overlay"; }; snowfall-lib = { url = "github:snowfallorg/lib"; inputs.nixpkgs.follows = "nixpkgs"; }; # macOS Support (master) darwin.url = "github:lnl7/nix-darwin/nix-darwin-25.11"; darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-homebrew.url = "github:zhaofengli-wip/nix-homebrew"; homebrew-core = { url = "github:homebrew/homebrew-core"; flake = false; }; homebrew-cask = { url = "github:homebrew/homebrew-cask"; flake = false; }; homebrew-bundle = { url = "github:homebrew/homebrew-bundle"; flake = false; }; home-manager.url = "github:nix-community/home-manager/release-25.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; neovim-flake.url = "github:NotAShelf/nvf/"; neovim-flake.inputs.nixpkgs.follows = "nixpkgs"; disko.url = "github:nix-community/disko"; disko.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.url = "github:Mic92/sops-nix"; sops-nix.inputs.nixpkgs.follows = "nixpkgs"; simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.11"; simple-nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs"; claude.url = "github:k3d3/claude-desktop-linux-flake"; claude.inputs.nixpkgs.follows = "nixpkgs"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; xremap-flake.url = "github:xremap/nix-flake"; ssh-tresor.url = "github:haraldh/ssh-tresor"; ssh-tresor.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs: let lib = inputs.snowfall-lib.mkLib { inherit inputs; src = ./.; snowfall.namespace = "metacfg"; snowfall = { meta = { name = "metacfg"; title = "Metacfg"; }; }; }; in lib.mkFlake { channels-config = { allowUnfree = true; }; channels.unstable.overlays = [ (final: prev: { rocm-runtime = prev.rocm-runtime.overrideAttrs (prevAttrs: { patches = (prevAttrs.patches or [ ]) ++ [ (final.fetchpatch { # [PATCH] hsakmt: bump vgpr count for gfx1151 (#1807) (#1986) # We apply only the change that adds a GFX_VERSION_GFX1151 define but # *not* the default vgpr change which causes crashes on old kernels # This was later partially reverted in # [PATCH] Revert "hsakmt: bump vgpr count for gfx1151 (#1807) (#1986)" name = "rocr-runtime-gfx1151-vgpr.patch"; url = "https://github.com/ROCm/rocm-systems/commit/09ba45b3f43ec333a84a0ca178fcd1e3ea9400a9.patch"; relative = "projects/rocr-runtime"; includes = [ "libhsakmt/src/libhsakmt.h" ]; hash = "sha256-/V5i+sr88n7fK4yNjR/FpY0ZpiEG5xAD6Oq+9ZOikd4="; }) (final.fetchpatch { # [PATCH] hsakmt: Expose and use CWSR and Control stack sizes (#2200) # Fixes potential mismatches between stack sizes configured in amdgpu kernel module # and userspace by relying on kernel value when available # Falls back to hardcoded size based on ISA if kernel is too old. For gfx1151, also prints: # WARNING: KFD ABI 1.20+ is recommended … This may result in faults, crashes and other application instability # This allows new kernels to work with this runtime detection mechanism # Only gfx1151 warns loudly because only it has had the size updated in kernel… name = "rocr-runtime-kernel-stack-size.patch"; url = "https://github.com/ROCm/rocm-systems/commit/7037a71f311c021974fafd13727dfefd8a1cc79d.patch"; relative = "projects/rocr-runtime"; hash = "sha256-EbDxuEvNu0fyQJZmqq0fbcCdNtaEWUbmyPLvcfqDPjc="; }) ]; }); }) ]; homes.modules = with inputs; [ neovim-flake.homeManagerModules.default ]; systems.modules.nixos = with inputs; [ nix-homebrew.darwinModules.nix-homebrew lanzaboote.nixosModules.lanzaboote home-manager.nixosModules.home-manager sops-nix.nixosModules.sops disko.nixosModules.disko simple-nixos-mailserver.nixosModule cratedocs.nixosModules.default xremap-flake.nixosModules.default ]; overlays = with inputs; [ (final: prev: { inherit (claude.packages.${prev.stdenv.hostPlatform.system}) claude-desktop-with-fhs; }) (final: prev: { inherit (cratedocs.packages.${prev.stdenv.hostPlatform.system}) cratedocs-mcp; }) ssh-tresor.overlays.default ]; outputs-builder = channels: { formatter = channels.nixpkgs.nixfmt-rfc-style; defaultApp = lib.flake-utils-plus.mkApp { drv = channels.nixpkgs.home-manager; }; }; }; }