about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-09-07 19:07:37 -0700
committerFranck Cuny <franck@fcuny.net>2022-09-07 19:12:12 -0700
commit5685d297f2376f6c3bb6d27297c8f268b2da8192 (patch)
tree28efe04fa926eab46bc39d94994126145f712f65
parentfeat(tool/sendsms): a CLI to send SMS (diff)
downloadworld-5685d297f2376f6c3bb6d27297c8f268b2da8192.tar.gz
feat(flake): use naersk to build rust projects
The flake naersk is used to build rust crates with nix.

Change-Id: Ia1c95de34fe802ae6a6b623dc169ca502fa72f12
-rw-r--r--flake.lock33
-rw-r--r--flake.nix5
-rw-r--r--nix/mkSystem.nix1
3 files changed, 37 insertions, 2 deletions
diff --git a/flake.lock b/flake.lock
index 3d07120..b6f534b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -105,6 +105,24 @@
         "type": "github"
       }
     },
+    "naersk": {
+      "inputs": {
+        "nixpkgs": "nixpkgs_2"
+      },
+      "locked": {
+        "lastModified": 1662220400,
+        "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=",
+        "owner": "nix-community",
+        "repo": "naersk",
+        "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-community",
+        "repo": "naersk",
+        "type": "github"
+      }
+    },
     "nixpkgs": {
       "locked": {
         "lastModified": 0,
@@ -135,6 +153,18 @@
     },
     "nixpkgs_2": {
       "locked": {
+        "lastModified": 0,
+        "narHash": "sha256-/l1HI2tFLihda6yh+j848GlRDVUiSJPr+yzA7ip8Z84=",
+        "path": "/nix/store/wi84fkkl5lq0bmf7c1jycax5vrw7fl6s-source",
+        "type": "path"
+      },
+      "original": {
+        "id": "nixpkgs",
+        "type": "indirect"
+      }
+    },
+    "nixpkgs_3": {
+      "locked": {
         "lastModified": 1658355931,
         "narHash": "sha256-/l1HI2tFLihda6yh+j848GlRDVUiSJPr+yzA7ip8Z84=",
         "owner": "nixos",
@@ -194,7 +224,8 @@
         "emacs-overlay": "emacs-overlay",
         "futils": "futils",
         "home-manager": "home-manager",
-        "nixpkgs": "nixpkgs_2",
+        "naersk": "naersk",
+        "nixpkgs": "nixpkgs_3",
         "nixpkgs-unstable": "nixpkgs-unstable",
         "nur": "nur",
         "pre-commit-hooks": "pre-commit-hooks",
diff --git a/flake.nix b/flake.nix
index 5d2d595..d83a052 100644
--- a/flake.nix
+++ b/flake.nix
@@ -30,6 +30,8 @@
       inputs.nixpkgs.follows = "nixpkgs";
     };
 
+    naersk.url = "github:nix-community/naersk";
+
     pre-commit-hooks = {
       type = "github";
       owner = "cachix";
@@ -55,6 +57,7 @@
     eachMySystem
       (system:
         let
+          naersk = inputs.naersk;
           pkgs = import inputs.nixpkgs { inherit system; };
           home-manager = inputs.home-manager.defaultPackage."${system}";
           pre-commit-golang = pkgs.callPackage
@@ -94,7 +97,7 @@
           packages = pkgs // {
             inherit home-manager;
 
-            tools = import ./tools { inherit pkgs; };
+            tools = import ./tools { inherit pkgs naersk; };
             ops = import ./ops { inherit pkgs; };
             users.fcuny = import ./users/fcuny { inherit pkgs; };
           };
diff --git a/nix/mkSystem.nix b/nix/mkSystem.nix
index 1f7ccaf..e33ddf7 100644
--- a/nix/mkSystem.nix
+++ b/nix/mkSystem.nix
@@ -15,6 +15,7 @@ inputs.nixpkgs.lib.nixosSystem {
           inputs.emacs-overlay.overlay
           inputs.nur.overlay
           inputs.rust.overlay
+          inputs.naersk.overlay
           (final: prev: {
             tools = import "${self}/tools" { pkgs = prev; };
           })