{ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; nixinate.url = "github:maxaudron/nixinate"; secrets = { url = "git+ssh://git@gitlab.com/cocainefarm/k8s/secrets"; flake = false; }; }; outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, flake-parts, nixinate, ... }: flake-parts.lib.mkFlake { inherit inputs; } { imports = [ nixinate.flakeModule ./lib ]; flake = let system = "x86_64-linux"; specialArgs = inputs // { nodes = self.nixosConfigurations; }; overlay-unstable = final: prev: { unstable = import nixpkgs-unstable { system = prev.system; config.allowUnfree = true; }; }; overlays = { config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }; mkSystem = modules: nixpkgs.lib.nixosSystem { inherit specialArgs system; modules = modules ++ (with self.nixosModules; [ nixinate.nixosModules.default overlays common users wireguard crypto ]); }; in { nixosModules = import ./modules; nixosConfigurations = with self.nixosModules; { # vultr-image = mkSystem [ common users image vultr ]; ettves = mkSystem [ (import ./machines/ettves) kubernetes zfs teamspeak postgresql quassel powerdns acme authentik hydra homeassistant palworld games ]; phaenn = mkSystem [ (import ./machines/phaenn) zfs acme tlmp ]; fra01 = mkSystem [ (import ./machines/fra01) vultr bgp powerdns acme garage ]; nyc01 = mkSystem [ (import ./machines/nyc01) vultr bgp powerdns acme garage ]; sin01 = mkSystem [ (import ./machines/sin01) vultr bgp powerdns acme garage ]; }; }; systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; }; }