diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1bf7c64 --- /dev/null +++ b/.envrc @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if has lorri; then + eval "$(lorri direnv)" +elif has nix; then + use flake +fi diff --git a/flake.lock b/flake.lock index c643901..b5b95e7 100644 --- a/flake.lock +++ b/flake.lock @@ -1,13 +1,35 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "naersk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1752475459, + "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -17,30 +39,15 @@ } }, "flake-utils": { - "locked": { - "lastModified": 1652372896, - "narHash": "sha256-lURGussfF3mGrFPQT3zgW7+RC0pBhbHzco0C7I+ilow=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "0d347c56f6f41de822a4f4c7ff5072f3382db121", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { "inputs": { "systems": "systems" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -51,14 +58,15 @@ }, "naersk": { "inputs": { + "fenix": "fenix", "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1698420672, - "narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=", + "lastModified": 1752689277, + "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=", "owner": "nix-community", "repo": "naersk", - "rev": "aeb58d5e8faead8980a807c840232697982d47b9", + "rev": "0e72363d0938b0208d6c646d10649164c43f4d64", "type": "github" }, "original": { @@ -69,25 +77,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708501555, - "narHash": "sha256-zJaF0RkdIPbh8LTmnpW/E7tZYpqIE+MePzlWwUNob4c=", + "lastModified": 1752077645, + "narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b50a77c03d640716296021ad58950b1bb0345799", + "rev": "be9e214982e20b8310878ac2baa063a961c1bdf6", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1708542344, - "narHash": "sha256-IXJJMaRv1RlaXPsJlohwiQKM5775g+dujrPqtg5PhmQ=", + "lastModified": 1753135609, + "narHash": "sha256-//xMo8MwSw1HoTnIk455J7NIJpsDqwVyD69MOXb7gZM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7394735942afb1f0f826ac9aa29f419339c85b22", + "rev": "5d9316e7fb2d6395818d506ef997530eba1545b7", "type": "github" }, "original": { @@ -105,19 +115,35 @@ "rust-overlay": "rust-overlay" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1752428706, + "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1708481452, - "narHash": "sha256-s07K6pwJtnB7Z/3wbkf4iaYXj+H5CuDD94I8hohm3Ig=", + "lastModified": 1753066249, + "narHash": "sha256-j2UBrfDRIePGx3532Bbb9UeosNX2F73hfOAHtmACfnM=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "3d6647bf9d1f8e537b0d026c51ea25c0cdd92055", + "rev": "0751b65633a1785743ca44fd7c14a633c54c1f91", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e715988..afc38a5 100644 --- a/flake.nix +++ b/flake.nix @@ -10,17 +10,17 @@ }; naersk.url = "github:nix-community/naersk"; flake-compat = { - url = github:edolstra/flake-compat; + url = "github:edolstra/flake-compat"; flake = false; }; }; - outputs = {self, nixpkgs, flake-utils, rust-overlay, naersk, flake-compat}: + outputs = {nixpkgs, flake-utils, rust-overlay, naersk, ...}: flake-utils.lib.eachDefaultSystem (system: let overlays = [ rust-overlay.overlays.default ]; pkgs = import nixpkgs { inherit system overlays; }; - rust-bin = pkgs.rust-bin.stable."1.70.0".default.override { + rust-bin = pkgs.rust-bin.stable."1.87.0".default.override { extensions = [ "rust-src" ]; # Add wasm32 as an extra target besides the native target. targets = [ "wasm32-unknown-unknown" ]; @@ -29,13 +29,12 @@ rustc = rust-bin; cargo = rust-bin; }; - ucg = with pkgs; - naersk-lib.buildPackage rec { - pname = "ucg"; - version = "0.7.3"; - src = ./.; - cargoBuildOptions = opts: opts ++ ["-p" "${pname}" ]; - }; + ucg = naersk-lib.buildPackage rec { + pname = "ucg"; + version = "0.7.3"; + src = ./.; + cargoBuildOptions = opts: opts ++ ["-p" "${pname}" ]; + }; in { packages = { @@ -46,5 +45,9 @@ type = "app"; program = "${ucg}/bin/ucg"; }; + devShells.default = pkgs.mkShell { + buildInputs = [ rust-bin pkgs.rust-analyzer pkgs.cargo-tarpaulin ]; + packages = with pkgs; [ gnumake ]; + }; }); -} \ No newline at end of file +} diff --git a/result b/result new file mode 120000 index 0000000..acc2527 --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/38y7vjmqjcdbygjfv30csnbhr6p435dm-ucg-0.7.3 \ No newline at end of file