diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/flake.nix b/flake.nix index c844c23..77b518c 100644 --- a/flake.nix +++ b/flake.nix @@ -6,11 +6,8 @@ repo = "flake-utils"; ref = "main"; }; - naersk = { - type = "github"; - owner = "nix-community"; - repo = "naersk"; - ref = "master"; + crane = { + url = "github:ipetkov/crane"; inputs.nixpkgs.follows = "nixpkgs"; }; nixpkgs = { @@ -20,32 +17,43 @@ ref = "nixos-unstable"; }; }; - outputs = { self, nixpkgs, flake-utils, naersk }: let + outputs = { self, nixpkgs, flake-utils, crane }: 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}; + crane' = crane.mkLib pkgs; + + kittybox = pkgs.callPackage ./kittybox.nix { + # TODO: this may break cross-compilation. It may be better to + # inject it as an overlay. However, I am unsure whether Crane + # can recognize it's being passed a cross-compilation set. + crane = crane'; + + nixosTests = { + smokeTest = self.checks.${system}.nixos-test; + postgresSmokeTest = self.checks.${system}.nixos-test-postgres; + }; + }; in { packages = { - kittybox = pkgs.callPackage ./kittybox.nix { - naersk = naersk.lib.${system}; - inherit (pkgs.nodePackages) typescript; - nixosTests = { - smokeTest = self.checks.${system}.nixos-test; - postgresSmokeTest = self.checks.${system}.nixos-test-postgres; - }; - }; + kittybox = kittybox; default = self.packages.${system}.kittybox; }; checks = { kittybox = self.packages.${system}.kittybox; + + deps = self.packages.${system}.kittybox.cargoArtifacts; + clippy = self.packages.${system}.kittybox.clippy; + distributed-test = pkgs.nixosTest (import ./nixos-tests/distributed-test.nix self); nixos-test = pkgs.nixosTest (import ./nixos-tests/smoke-test.nix self); nixos-test-postgres = pkgs.nixosTest (import ./nixos-tests/postgres-smoke-test.nix self); webmention-test = pkgs.nixosTest (import ./nixos-tests/webmention-test.nix self); + dockerContainer = pkgs.callPackage ./docker.nix { inherit (self.packages.${system}) kittybox; rev = self.rev or "development"; |