/ flake.nix
flake.nix
1 # SPDX-FileCopyrightText: 2024-2025 sntx <sntx@sntx.space> 2 # SPDX-License-Identifier: AGPL-3.0-or-later 3 4 { 5 inputs = { 6 # Package Sources 7 ## nixpkgs 8 nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11"; 9 nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; 10 nixpkgs-master.url = "github:NixOS/nixpkgs/master"; 11 ## community 12 nixpkgs-xr.url = "github:nix-community/nixpkgs-xr"; 13 nixbg.url = "sourcehut:~sntx/nix-bg"; 14 ## wrapper 15 nixpkgs-base.follows = "nixpkgs"; 16 nixpkgs.follows = "nixpkgs-stable"; 17 18 # Modules 19 deploy-rs = { 20 url = "github:serokell/deploy-rs"; 21 inputs.nixpkgs.follows = "nixpkgs"; 22 }; 23 devshell = { 24 url = "github:numtide/devshell"; 25 inputs.nixpkgs.follows = "nixpkgs"; 26 }; 27 nixago = { 28 url = "github:nix-community/nixago"; 29 inputs.nixpkgs.follows = "nixpkgs"; 30 }; 31 hive = { 32 url = "github:divnix/hive"; 33 inputs = { 34 nixpkgs.follows = "nixpkgs"; 35 }; 36 }; 37 std = { 38 url = "github:divnix/std"; 39 inputs = { 40 devshell.follows = "devshell"; 41 nixago.follows = "nixago"; 42 nixpkgs.follows = "nixpkgs"; 43 }; 44 }; 45 std-configs = { 46 url = "sourcehut:~sntx/std-configs"; 47 inputs = { 48 devshell.follows = "devshell"; 49 nixago.follows = "nixago"; 50 nixpkgs.follows = "nixpkgs"; 51 }; 52 }; 53 54 nixos-hardware.url = "github:nixos/nixos-hardware"; 55 56 home-manager = { 57 url = "github:nix-community/home-manager/release-25.11"; 58 inputs.nixpkgs.follows = "nixpkgs"; 59 }; 60 stylix = { 61 url = "github:nix-community/stylix/release-25.11"; 62 inputs.nixpkgs.follows = "nixpkgs"; 63 }; 64 65 ragenix = { 66 url = "github:yaxitech/ragenix"; 67 inputs.nixpkgs.follows = "nixpkgs"; 68 }; 69 70 impermanence.url = "github:nix-community/impermanence"; 71 lanzaboote = { 72 url = "github:nix-community/lanzaboote"; 73 inputs.nixpkgs.follows = "nixpkgs"; 74 }; 75 disko = { 76 url = "github:nix-community/disko"; 77 inputs.nixpkgs.follows = "nixpkgs"; 78 }; 79 80 # Applications 81 arkenfox = { 82 url = "github:dwarfmaster/arkenfox-nixos/update_action"; 83 inputs.nixpkgs.follows = "nixpkgs"; 84 }; 85 comfyui = { 86 url = "github:haras-unicorn/nix-comfyui/master"; 87 inputs.nixpkgs.follows = "nixpkgs"; 88 }; 89 foundryvtt = { 90 url = "github:reckenrode/nix-foundryvtt"; 91 inputs.nixpkgs.follows = "nixpkgs"; 92 }; 93 nix-gaming = { 94 url = "github:fufexan/nix-gaming"; 95 inputs.nixpkgs.follows = "nixpkgs"; 96 }; 97 oxzy = { 98 url = "sourcehut:~sntx/oxzy"; 99 inputs.nixpkgs.follows = "nixpkgs"; 100 }; 101 website = { 102 url = "sourcehut:~sntx/website"; 103 # inputs.nixpkgs.follows = "nixpkgs"; 104 }; 105 106 # Misc Files 107 mediawiki-skin-Citizen = { 108 url = "github:StarCitizenTools/mediawiki-skins-Citizen"; 109 flake = false; 110 }; 111 friendly-snippets = { 112 url = "github:rafamadriz/friendly-snippets"; 113 flake = false; 114 }; 115 116 # Patches 117 patch-bigscreen-beyond-kernel = { 118 url = "git+https://gitea.seeseepuff.be/archlinux/linux-seba"; 119 flake = false; 120 }; 121 yazi-plugins = { 122 url = "github:yazi-rs/plugins"; 123 flake = false; 124 }; 125 yazi-ucp = { 126 url = "github:simla33/ucp.yazi"; 127 flake = false; 128 }; 129 }; 130 131 outputs = 132 { 133 hive, 134 self, 135 std, 136 ... 137 }@inputs: 138 hive.growOn 139 { 140 inherit inputs; 141 cellsFrom = ./cells; 142 cellBlocks = with (std.blockTypes // hive.blockTypes); [ 143 # configurations 144 diskoConfigurations 145 nixosConfigurations 146 homeConfigurations 147 148 # modules 149 (functions "nixosModules") 150 151 # packages 152 (installables "packages") 153 154 # profiles 155 (functions "hardwareProfiles") 156 (functions "homeProfiles") 157 (functions "nixosProfiles") 158 (functions "userProfiles") 159 160 # suites 161 (functions "homeSuites") 162 (functions "nixosSuites") 163 164 # themes 165 (functions "homeThemes") 166 167 # repo 168 (functions "devshells") 169 170 # meta 171 (functions "keys") 172 (functions "lib") 173 ]; 174 } 175 { 176 devShells = std.harvest self [ 177 "repo" 178 "devshells" 179 ]; 180 diskoConfigurations = hive.collect self "diskoConfigurations"; 181 nixosConfigurations = (hive.collect // { renamer = _: target: target; }) self "nixosConfigurations"; 182 } 183 { 184 deploy.nodes = builtins.mapAttrs (name: _: { 185 hostname = name; 186 profiles.system = { 187 user = "root"; 188 path = 189 inputs.deploy-rs.lib.${ 190 self.nixosConfigurations.${name}.pkgs.stdenv.hostPlatform.system 191 }.activate.nixos 192 self.nixosConfigurations.${name}; 193 }; 194 sshUser = "deploy"; 195 sshOpts = [ "-A" ]; 196 }) (inputs.nixpkgs.lib.filterAttrs (name: _: true) self.nixosConfigurations); 197 198 checks = builtins.mapAttrs ( 199 system: deployLib: deployLib.deployChecks self.deploy 200 ) inputs.deploy-rs.lib; 201 }; 202 }