Skip to content

Commit

Permalink
Use devenv rust support (#313)
Browse files Browse the repository at this point in the history
* run devenv update

* use devenv rust support
  • Loading branch information
ss2165 authored Jul 28, 2023
1 parent aca1dee commit be09a32
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 14 deletions.
57 changes: 48 additions & 9 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1687378457,
"narHash": "sha256-EkRX4S60BGFlQuEYJegk/9aCODPdMV6XLI+2C2HTBEI=",
"lastModified": 1690534632,
"narHash": "sha256-kOXS9x5y17VKliC7wZxyszAYrWdRl1JzggbQl0gyo94=",
"owner": "cachix",
"repo": "devenv",
"rev": "c6ac4dbf501edafe0d6860e821b9e9fff0828921",
"rev": "6568e7e485a46bbf32051e4d6347fa1fed8b2f25",
"type": "github"
},
"original": {
Expand All @@ -17,6 +17,27 @@
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1690525255,
"narHash": "sha256-jWmEJsV0mbWhUTCmkVg0URTVaQxzX9SPx33DPJPOmWc=",
"owner": "nix-community",
"repo": "fenix",
"rev": "6d22d0989ebc9e8fc7e1d15f973613fae928ebb2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
Expand Down Expand Up @@ -74,11 +95,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1687392660,
"narHash": "sha256-E4bsKvHGFsKYegkfJ/FwR64OMtpjTWHM4CvCyWSTlnM=",
"lastModified": 1690441914,
"narHash": "sha256-Ac+kJQ5z9MDAMyzSc0i0zJDx2i3qi9NjlW5Lz285G/I=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3fb3ce0b6b84d3b4e7b49e142da9c5764b563058",
"rev": "db8672b8d0a2593c2405aed0c1dfa64b2a2f428f",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -115,11 +136,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1687251716,
"narHash": "sha256-+sFS41thsB5U+lY/dBYPSmU4AJ7nz/VdM1WD35fXVeM=",
"lastModified": 1690464206,
"narHash": "sha256-38V4kmOh6ikpfGiAS+Kt2H/TA2DubSqE66veP/jmB4Q=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "7807e1851d95828ed98491930d2d9e7ddbe65da4",
"rev": "9289996dcac62fd45836db7c07b87d2521eb526d",
"type": "github"
},
"original": {
Expand All @@ -131,10 +152,28 @@
"root": {
"inputs": {
"devenv": "devenv",
"fenix": "fenix",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1690216158,
"narHash": "sha256-TUF0YoWweQj0hNHWykC1vtBQVUncARlLLPmQP9hUeME=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "b64e5b3919b24bc784f36248e6e1f921ee7bb71b",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
Expand Down
8 changes: 5 additions & 3 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# https://devenv.sh/packages/
# manually set rust packages rather than use devenv language support because
# it doesn't seem to be up to date for macos yet (link error)
packages = with pkgs; [ cargo rustc rust-analyzer rustfmt clippy ];
env.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
packages = [ ];

# https://devenv.sh/scripts/
scripts.hello.exec = "echo Welcome to hugr dev shell!";
Expand All @@ -19,7 +18,10 @@

# https://devenv.sh/languages/
# https://devenv.sh/reference/options/#languagesrustversion
# languages.rust.enable = true;
languages.rust = {
enable = true;
components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ];
};

# https://devenv.sh/pre-commit-hooks/
pre-commit.hooks.clippy.enable = true;
Expand Down
7 changes: 5 additions & 2 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
fenix:
url: github:nix-community/fenix
inputs:
nixpkgs:
follows: nixpkgs

0 comments on commit be09a32

Please sign in to comment.