{ description = "Nixos Config Flake"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nix-darwin.url = "github:nix-darwin/nix-darwin/master"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs-unstable"; nix-snapd.url = "github:nix-community/nix-snapd"; comfyui-nix.url = "github:utensils/comfyui-nix"; #nix-snapd.inputs.pkgs-unstable.follows = "nixpkgs"; home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager-unstable = { url = "github:nix-community/home-manager/"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; nixos-hardware = { url = "github:NixOS/nixos-hardware/master"; #inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, comfyui-nix, home-manager, home-manager-unstable, nix-darwin, nix-snapd, nixos-hardware, nixpkgs, nixpkgs-unstable, nixvim, ... }@inputs: let system = "x86_64-linux"; configPath = "/etc/nixos"; pkgs-unstable = import nixpkgs-unstable { system = system; config.allowUnfree = true; overlays = [ comfyui-nix.overlays.default ]; }; # Host type abstractions hostTypes = { # Server hosts isServer = hostname: builtins.elem hostname [ "acheron" "buildbox" "ender-ml" ]; # Linux desktop hosts isLinuxDesktop = hostname: builtins.elem hostname [ "eva-01" "eva-03" ]; # macOS host isMacos = hostname: hostname == "eva-02"; # Helper to get host type category getHostType = hostname: if builtins.elem hostname [ "acheron" "buildbox" "ender-ml" ] then "server" else if hostname == "eva-02" then "macos" else "linux-desktop"; }; in { nixosConfigurations = { acheron = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs pkgs-unstable configPath hostTypes; hostname = "acheron"; }; system = system; modules = [ ./hosts/acheron/configuration.nix inputs.home-manager.nixosModules.default ]; }; buildbox = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs pkgs-unstable configPath hostTypes; hostname = "buildbox"; }; system = system; modules = [ ./hosts/buildbox/configuration.nix inputs.home-manager.nixosModules.default ]; }; ender-ml = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs pkgs-unstable configPath hostTypes; hostname = "ender-ml"; }; system = system; modules = [ ./hosts/ender-ml/configuration.nix inputs.home-manager.nixosModules.default comfyui-nix.nixosModules.default ]; }; eva-01 = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs pkgs-unstable configPath hostTypes; hostname = "eva-01"; }; system = system; modules = [ ./hosts/eva-01/configuration.nix inputs.home-manager.nixosModules.default nixos-hardware.nixosModules.lenovo-thinkpad-x1-nano-gen1 nix-snapd.nixosModules.default { services.snap.enable = true; } ]; }; eva-03 = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs pkgs-unstable configPath hostTypes; hostname = "eva-03"; }; system = system; modules = [ ./hosts/eva-03/configuration.nix inputs.home-manager.nixosModules.default comfyui-nix.nixosModules.default ]; }; }; darwinConfigurations = { eva-02 = nix-darwin.lib.darwinSystem{ specialArgs = { inherit inputs configPath hostTypes; hostname = "eva-02"; pkgs-unstable = import nixpkgs-unstable { system = "aarch64-darwin"; config.allowUnfree = true; overlays = [ comfyui-nix.overlays.default ]; }; }; system = "aarch64-darwin"; modules = [ ./hosts/eva-02/configuration.nix inputs.home-manager-unstable.darwinModules.home-manager ]; }; }; }; }