{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; nixng = { url = "github:nix-community/NixNG"; inputs.nixpkgs.follows = "nixpkgs"; }; website = { url = "git+https://gitea.redalder.org/Magic_RB/website"; inputs.nixpkgs.follows = "nixpkgs"; }; camptules = { url = "git+https://gitea.redalder.org/ThyW/camptules"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, nixng, ... }@inputs: with nixpkgs.lib; let supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; forAllSystems' = systems: fun: nixpkgs.lib.genAttrs systems fun; forAllSystems = forAllSystems' supportedSystems; pkgsForSystem = system: import nixpkgs { inherit system; }; in { nixngSystems = let base = { nglib = nixng.nglib nixpkgs.lib; inherit nixpkgs; }; in { hydra = (import ./containers/hydra.nix base).hydra; hydraPostgresql = (import ./containers/hydra.nix base).postgresql; ingressToothpick = import ./containers/ingress-toothpick.nix base; ingressBlowhole = import ./containers/ingress-blowhole.nix base; website = import ./containers/website.nix (base // { inherit (inputs.website) website; }); camptules = (import ./containers/camptules.nix (base // { inherit (inputs) camptules; })); gitea = import ./containers/gitea.nix base; minecraft = import ./containers/minecraft.nix base; mosquitto = import ./containers/mosquitto.nix base; dovecot = import ./containers/dovecot.nix base; getmail = import ./containers/getmail base; syncthing = import ./containers/syncthing.nix base; zigbee2mqtt = import ./containers/zigbee2mqtt.nix base; home-assistant = import ./containers/home-assistant.nix base; reicio = import ./containers/reicio.nix base; baikal = import ./containers/baikal.nix base; conduit = import ./containers/conduit.nix base; }; hydraJobs = let pkgs = import nixpkgs { system = "x86_64-linux"; }; makeJob = container: container.config.system.build.toplevel; in nixpkgs.lib.mapAttrs (n: v: makeJob v) self.nixngSystems; devShell = forAllSystems (system: let pkgs = pkgsForSystem system; in pkgs.mkShell { nativeBuildInputs = with pkgs; [ nomad_1_3 consul vault packer jq terraform ]; } ); }; }