about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix25
1 files changed, 16 insertions, 9 deletions
diff --git a/flake.nix b/flake.nix
index 007218a..0cf7d95 100644
--- a/flake.nix
+++ b/flake.nix
@@ -9,8 +9,15 @@
       inputs.flake-utils.follows = "flake-utils";
       inputs.nixpkgs.follows = "nixpkgs";
     };
+    naersk = {
+      type = "github";
+      owner = "nmattia";
+      repo = "naersk";
+      ref = "master";
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
   };
-  outputs = { self, nixpkgs, rust, flake-utils }: let
+  outputs = { self, nixpkgs, rust, flake-utils, naersk }: let
     supportedSystems = ["aarch64-linux" "x86_64-linux"];
     forAllSystems = f: flake-utils.lib.eachSystem supportedSystems f;
   in forAllSystems (system: let
@@ -20,15 +27,15 @@
     };
     rust-bin = pkgs.rust-bin.stable.latest;
     packages = {
-      kittybox-micropub = { stdenv, lib, openssl, pkg-config, redis, rustPlatform }:
-      rustPlatform.buildRustPackage {
-        name = "kittybox-micropub";
+      kittybox-micropub = { stdenv, lib, openssl, pkg-config, redis, naersk-lib }:
+      naersk-lib.buildPackage {
+        pname = "kittybox-micropub";
         version = "0.1.0";
 
         src = ./.;
 
         #cargoSha256 = nixpkgs.lib.fakeSha256;
-        cargoHash = "sha256-c862J7qXkrCAA6+gFn/bX5NXrgu/1HtCH1DqOpQePgk=";
+        #cargoHash = "sha256-c862J7qXkrCAA6+gFn/bX5NXrgu/1HtCH1DqOpQePgk=";
 
         buildInputs = [ openssl ];
         nativeBuildInputs = [ pkg-config ];
@@ -44,12 +51,12 @@
     };
   in {
     packages = let
-      rustPlatform = pkgs.makeRustPlatform {
-        rustc = rust-bin.minimal;
-        cargo = rust-bin.minimal;
+      naersk-lib = naersk.lib.${system}.override {
+        rustc = pkgs.rust-bin.nightly.latest.minimal;
+        cargo = pkgs.rust-bin.nightly.latest.minimal;
       };
     in {
-      kittybox-micropub = pkgs.callPackage packages.kittybox-micropub { inherit rustPlatform; };
+      kittybox-micropub = pkgs.callPackage packages.kittybox-micropub { inherit naersk-lib; };
     };
     defaultPackage = self.packages.${system}.kittybox-micropub;