{ outputs = { flake-parts, nixpkgs, nixpkgs-unstable, self, ... }@inputs: let overlays = [ (final: _: { unstable = nixpkgs-unstable.legacyPackages.${final.system}; prometheus-fail2ban-exporter = final.callPackage ./pkgs/prometheus-fail2ban-exporter { }; }) ]; in flake-parts.lib.mkFlake { inherit inputs; } { flake = { nixosConfigurations.main-node = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ { nixpkgs = { config.allowUnfree = true; inherit overlays; }; } ./hosts/main-node ./config ./modules inputs.agenix.nixosModules.default inputs.attic.nixosModules.atticd inputs.home-manager.nixosModules.home-manager inputs.satisfactory-server.nixosModules.default inputs.valheim-server.nixosModules.default ]; specialArgs = { inherit inputs; }; }; checks = nixpkgs.lib.recursiveUpdate { x86_64-linux.main-node = self.nixosConfigurations.main-node.config.system.build.toplevel; } (builtins.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib); deploy.nodes.main-node = { hostname = "winston.sh"; profiles.system = { sshUser = "root"; path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.main-node; }; }; }; perSystem = { config, inputs', pkgs, self', system, ... }: { _module.args.pkgs = import nixpkgs { inherit overlays system; }; devShells.default = pkgs.mkShell { inherit (config.pre-commit.devShell) shellHook; buildInputs = [ inputs'.agenix.packages.agenix pkgs.age-plugin-yubikey pkgs.unstable.deploy-rs pkgs.unstable.nh pkgs.unstable.nixd self'.formatter ]; }; formatter = pkgs.nixfmt-rfc-style; pre-commit = { check.enable = true; settings.excludes = [ "_sources/" ]; settings.hooks = { commitizen.enable = true; editorconfig-checker.enable = true; nil.enable = true; nixfmt-rfc-style.enable = true; shellcheck.enable = true; }; }; }; imports = [ inputs.pre-commit-hooks.flakeModule ]; systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; }; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; flake-utils.url = "github:numtide/flake-utils"; agenix = { url = "github:ryantm/agenix"; inputs.darwin.follows = ""; inputs.home-manager.follows = ""; inputs.nixpkgs.follows = "nixpkgs"; }; attic = { url = "github:zhaofengli/attic"; inputs.nixpkgs.follows = "nixpkgs-unstable"; inputs.nixpkgs-stable.follows = "nixpkgs"; inputs.flake-compat.follows = ""; inputs.flake-utils.follows = "flake-utils"; }; deploy-rs = { url = "github:serokell/deploy-rs"; inputs.flake-compat.follows = ""; inputs.nixpkgs.follows = "nixpkgs"; inputs.utils.follows = "flake-utils"; }; pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; inputs.flake-compat.follows = ""; inputs.nixpkgs.follows = "nixpkgs-unstable"; inputs.nixpkgs-stable.follows = "nixpkgs"; }; # game servers steam-fetcher = { url = "github:nix-community/steam-fetcher"; inputs.nixpkgs.follows = "nixpkgs"; }; satisfactory-server = { url = "github:nekowinston/satisfactory-server-flake"; inputs.nixpkgs.follows = "nixpkgs"; inputs.steam-fetcher.follows = "steam-fetcher"; }; valheim-server = { url = "github:aidalgol/valheim-server-flake"; inputs.nixpkgs.follows = "nixpkgs"; inputs.steam-fetcher.follows = "steam-fetcher"; }; }; nixConfig = { substituters = [ "https://cache.nixos.org" "https://cache.garnix.io" "https://pre-commit-hooks.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" ]; }; }