{ nixConfig = { experimental-features = "nix-command flakes"; substitute = "true"; extra-substituters = [ "https://cache.nixos.org" "https://crane.cachix.org" "https://isabelroses.cachix.org" "https://nix-community.cachix.org" "https://nixpkgs-wayland.cachix.org" "https://viperml.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=" "isabelroses.cachix.org-1:mXdV/CMcPDaiTmkQ7/4+MzChpOe6Cb97njKmBQQmLPM=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" "viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8=" ]; cores = 0; max-jobs = 2; netrc-file = "/home/thehedgehog/.netrc"; }; description = "PyroNet machines and services"; inputs = { snowfall-lib = { url = "github:snowfallorg/lib"; inputs.nixpkgs.follows = "nixpkgs"; }; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; stable.url = "github:nixos/nixpkgs/nixos-24.05"; # Overrides flake-compat.url = "github:edolstra/flake-compat"; systems.url = "github:nix-systems/default"; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs-lib"; }; flake-utils = { url = "github:numtide/flake-utils"; inputs.systems.follows = "systems"; }; nixpkgs-lib.url = "github:nix-community/nixpkgs.lib"; # Inputs agenix = { url = "github:ryantm/agenix"; inputs = { nixpkgs.follows = "nixpkgs"; systems.follows = "systems"; home-manager.follows = "home-manager"; }; }; authentik = { url = "github:nix-community/authentik-nix"; inputs = { flake-utils.follows = "flake-utils"; flake-parts.follows = "flake-parts"; flake-compat.follows = "flake-compat"; nixpkgs.follows = "nixpkgs"; }; }; buildbot-nix = { url = "github:Mic92/buildbot-nix"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-parts.follows = "flake-parts"; }; ctp = { url = "github:catppuccin/nix"; }; deploy-rs = { url = "github:serokell/deploy-rs"; inputs = { nixpkgs.follows = "nixpkgs"; utils.follows = "flake-utils"; flake-compat.follows = "flake-compat"; }; }; dns = { url = "github:nix-community/dns.nix"; inputs.flake-utils.follows = "flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; }; golink = { url = "github:tailscale/golink"; inputs.flake-utils.follows = "flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; }; hardware = { url = "github:nixos/nixos-hardware"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; iceshrimp = { url = "git+https://iceshrimp.dev/pyrox/packaging"; inputs.nixpkgs.follows = "nixpkgs"; }; mailserver = { url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; inputs = { flake-compat.follows = "flake-compat"; nixpkgs.follows = "nixpkgs"; }; }; mkshell-minimal = { url = "github:viperML/mkshell-minimal"; }; neovim = { url = "github:neovim/neovim/v0.9.5?dir=contrib"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; }; nix-search = { url = "github:diamondburned/nix-search"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; inputs.flake-compat.follows = "flake-compat"; }; nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; inputs.nixlib.follows = "nixpkgs-lib"; }; nvim = { url = "github:nix-community/neovim-nightly-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; flake-parts.follows = "flake-parts"; flake-compat.follows = "flake-compat"; }; }; nh = { url = "github:viperML/nh"; inputs.nixpkgs.follows = "nixpkgs"; }; nixd = { url = "github:nix-community/nixd"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-parts.follows = "flake-parts"; }; nix-index = { url = "github:nix-community/nix-index"; inputs.flake-compat.follows = "flake-compat"; inputs.nixpkgs.follows = "nixpkgs"; }; nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; }; nur.url = "github:nix-community/nur"; my-pkgs = { url = "git+https://git.pyrox.dev/pyrox/pkgs"; inputs.nixpkgs.follows = "nixpkgs"; }; topology = { url = "github:oddlama/nix-topology"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; }; waybar = { url = "github:Alexays/Waybar"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-compat.follows = "flake-compat"; }; }; outputs = inputs@{ self, ... }: let lib = inputs.snowfall-lib.mkLib { inherit inputs; src = ./.; snowfall = { meta = { name = "pyronet"; title = "PyroNet Config"; }; namespace = "py"; }; }; overlays = [ self.overlays.pyronet-packages self.overlays.nix-index self.overlays.bluez-wiimote self.overlays.sway-unwrapped inputs.my-pkgs.overlays.cinny inputs.golink.overlay inputs.neovim.overlay inputs.nixd.overlays.default inputs.nur.overlays.default inputs.topology.overlays.default ]; in lib.mkFlake { # Nixpkgs configuration channels-config = { allowUnfree = true; }; # Overlays for Nixpkgs. inherit overlays; # Home-manager configurations homes = { # Default modules for all homes modules = with inputs; [ nix-index-database.hmModules.nix-index ctp.homeManagerModules.catppuccin ]; }; # NixOS Configurations systems = { # Modules for all systems modules.nixos = with inputs; [ agenix.nixosModules.default buildbot-nix.nixosModules.buildbot-worker ctp.nixosModules.catppuccin topology.nixosModules.default ]; hosts = { # Zaphod, my personal Framework 16 laptop zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ]; # Prefect, my main VPS prefect.modules = with inputs; [ mailserver.nixosModule ]; # Marvin, my main homelab machine marvin.modules = with inputs; [ authentik.nixosModules.default buildbot-nix.nixosModules.buildbot-master golink.nixosModules.default iceshrimp.nixosModules.default ]; }; }; templates = { uv.description = "Python template flake that uses uv"; }; outputs-builder = channels: { # Define default packages to use everywhere packages = { nvim = channels.nixpkgs.neovim-unwrapped; customGit = channels.nixpkgs.git.override { withLibsecret = true; withSsh = true; perlSupport = false; osxkeychainSupport = false; guiSupport = false; svnSupport = false; }; }; formatter = channels.nixpkgs.nixfmt-rfc-style; # Export packages and systems as checks for buildbot-nix checks = let inherit (channels.nixpkgs) system; packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self.packages.${system}; devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self.devShells.${system}; machines = lib.mapAttrs' ( name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel ) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); in packages // devShells // machines; }; deploy = lib.mkDeploy { inherit (inputs) self; }; topology = import inputs.topology { pkgs = import inputs.nixpkgs { inherit overlays; system = "x86_64-linux"; }; modules = [ ./topology.nix { nixosConfigurations = self.nixosConfigurations; } ]; }; }; }