{ inputs = { flake-utils = { type = "github"; owner = "numtide"; repo = "flake-utils"; ref = "master"; }; naersk = { type = "github"; owner = "nmattia"; repo = "naersk"; ref = "master"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, flake-utils, naersk }: let supportedSystems = ["aarch64-linux" "x86_64-linux"]; forAllSystems = f: flake-utils.lib.eachSystem supportedSystems f; in { nixosModules.default = import ./configuration.nix self; } // forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; naersk-lib = naersk.lib.${system}.override { inherit (pkgs) rustc cargo; }; in { packages = { kittybox = pkgs.callPackage ./kittybox.nix { inherit naersk-lib; }; default = self.packages.${system}.kittybox; }; checks = { kittybox = self.packages.${system}.kittybox; distributed-test = pkgs.nixosTest (import ./distributed-test.nix self); nixos-test = pkgs.nixosTest (import ./smoke-test.nix self); dockerContainer = pkgs.callPackage ./docker.nix { inherit (self.packages.${system}) kittybox; rev = self.rev or "development"; inherit (self) lastModifiedDate; }; }; devShells.default = pkgs.mkShell { name = "rust-dev-shell"; nativeBuildInputs = with pkgs; [ # required for tokio-console's console-subscriber pkg-config protobuf # required for httpmock, not actually used in the release openssl.dev zlib xh systemfd tokio-console cargo-watch cargo-edit cargo-outdated rustc cargo rust-analyzer clippy ]; }; }); }