summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAljaž Mur Eržen <aljaz@edgedb.com>2023-08-24 18:24:28 +0200
committerJan-Erik Rediger <janerik@fnordig.de>2023-08-25 13:42:28 -0400
commit5c454c02336cd0af935ce7d3f5a041e0a2fac5ae (patch)
tree15b01afef9b21f30de985c876efdcf9acf52e5be
parent61c9ab5ee41b86253849f06c2c4d0819505129d4 (diff)
build: nix flake
-rw-r--r--flake.lock94
-rw-r--r--flake.nix29
2 files changed, 123 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..e82b8bb
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,94 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1692799911,
+ "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "naersk": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ },
+ "locked": {
+ "lastModified": 1692351612,
+ "narHash": "sha256-KTGonidcdaLadRnv9KFgwSMh1ZbXoR/OBmPjeNMhFwU=",
+ "owner": "nix-community",
+ "repo": "naersk",
+ "rev": "78789c30d64dea2396c9da516bbcc8db3a475207",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "naersk",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1692808169,
+ "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "9201b5ff357e781bf014d0330d18555695df7ba8",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "type": "indirect"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1692808169,
+ "narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "9201b5ff357e781bf014d0330d18555695df7ba8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "naersk": "naersk",
+ "nixpkgs": "nixpkgs_2"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..42145c2
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,29 @@
+{
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ naersk.url = "github:nix-community/naersk";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ };
+
+ outputs = { self, flake-utils, naersk, nixpkgs }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = (import nixpkgs) {
+ inherit system;
+ };
+
+ naersk' = pkgs.callPackage naersk {};
+
+ in rec {
+ # For `nix build` & `nix run`:
+ defaultPackage = naersk'.buildPackage {
+ src = ./.;
+ };
+
+ # For `nix develop`:
+ devShell = pkgs.mkShell {
+ nativeBuildInputs = with pkgs; [ rustc cargo ];
+ };
+ }
+ );
+}