diff options
author | Akshay <[email protected]> | 2023-09-09 08:34:59 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2023-09-09 08:34:59 +0100 |
commit | 39c3e7baf034bdbecc29f5f441d8dde634833b52 (patch) | |
tree | 0fca16e6f8df5bea7ffbc777a02751d182f0b574 | |
parent | 306640f502ef24e31590eef910b78ccd85ce8f6e (diff) |
fix builds
-rw-r--r-- | flake.lock | 39 | ||||
-rw-r--r-- | flake.nix | 35 |
2 files changed, 4 insertions, 70 deletions
@@ -1,26 +1,5 @@ | |||
1 | { | 1 | { |
2 | "nodes": { | 2 | "nodes": { |
3 | "fenix": { | ||
4 | "inputs": { | ||
5 | "nixpkgs": [ | ||
6 | "nixpkgs" | ||
7 | ], | ||
8 | "rust-analyzer-src": "rust-analyzer-src" | ||
9 | }, | ||
10 | "locked": { | ||
11 | "lastModified": 1642141613, | ||
12 | "narHash": "sha256-WFS7T5oOLD8anu/77iz7EPz7zQsJZtP5qVa5485k3dI=", | ||
13 | "owner": "nix-community", | ||
14 | "repo": "fenix", | ||
15 | "rev": "d75ffc9f1d3b60bb597e48ae01f486a6de27d30e", | ||
16 | "type": "github" | ||
17 | }, | ||
18 | "original": { | ||
19 | "owner": "nix-community", | ||
20 | "repo": "fenix", | ||
21 | "type": "github" | ||
22 | } | ||
23 | }, | ||
24 | "nixpkgs": { | 3 | "nixpkgs": { |
25 | "locked": { | 4 | "locked": { |
26 | "lastModified": 1642069818, | 5 | "lastModified": 1642069818, |
@@ -39,26 +18,8 @@ | |||
39 | }, | 18 | }, |
40 | "root": { | 19 | "root": { |
41 | "inputs": { | 20 | "inputs": { |
42 | "fenix": "fenix", | ||
43 | "nixpkgs": "nixpkgs" | 21 | "nixpkgs": "nixpkgs" |
44 | } | 22 | } |
45 | }, | ||
46 | "rust-analyzer-src": { | ||
47 | "flake": false, | ||
48 | "locked": { | ||
49 | "lastModified": 1642101527, | ||
50 | "narHash": "sha256-C4zcaWULWlrirpEt/pA85CCMBt+7SWZweMaMJ7EvrXw=", | ||
51 | "owner": "rust-analyzer", | ||
52 | "repo": "rust-analyzer", | ||
53 | "rev": "b4c31481a554d0132003228ba319bd9476fe85ae", | ||
54 | "type": "github" | ||
55 | }, | ||
56 | "original": { | ||
57 | "owner": "rust-analyzer", | ||
58 | "ref": "nightly", | ||
59 | "repo": "rust-analyzer", | ||
60 | "type": "github" | ||
61 | } | ||
62 | } | 23 | } |
63 | }, | 24 | }, |
64 | "root": "root", | 25 | "root": "root", |
@@ -1,19 +1,11 @@ | |||
1 | { | 1 | { |
2 | inputs = { | 2 | inputs = { |
3 | |||
4 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | 3 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; |
5 | |||
6 | fenix = { | ||
7 | url = "github:nix-community/fenix"; | ||
8 | inputs.nixpkgs.follows = "nixpkgs"; | ||
9 | }; | ||
10 | |||
11 | }; | 4 | }; |
12 | 5 | ||
13 | outputs = | 6 | outputs = |
14 | { self | 7 | { self |
15 | , nixpkgs | 8 | , nixpkgs |
16 | , fenix | ||
17 | }: | 9 | }: |
18 | let | 10 | let |
19 | supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; | 11 | supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; |
@@ -23,14 +15,6 @@ | |||
23 | inherit system; | 15 | inherit system; |
24 | overlays = [ self.overlay ]; | 16 | overlays = [ self.overlay ]; |
25 | }); | 17 | }); |
26 | |||
27 | chanspec = { | ||
28 | date = "2021-12-01"; | ||
29 | channel = "nightly"; | ||
30 | sha256 = "DhIP1w63/hMbWlgElJGBumEK/ExFWCdLaeBV5F8uWHc="; # set zeros after modifying channel or date | ||
31 | }; | ||
32 | rustChannel = p: (fenix.overlay p p).fenix.toolchainOf chanspec; | ||
33 | |||
34 | in | 18 | in |
35 | { | 19 | { |
36 | 20 | ||
@@ -40,11 +24,8 @@ | |||
40 | let | 24 | let |
41 | pname = "prompt"; | 25 | pname = "prompt"; |
42 | packageMeta = (lib.importTOML ./Cargo.toml).package; | 26 | packageMeta = (lib.importTOML ./Cargo.toml).package; |
43 | rustPlatform = makeRustPlatform { | ||
44 | inherit (rustChannel final) cargo rustc; | ||
45 | }; | ||
46 | in | 27 | in |
47 | rustPlatform.buildRustPackage { | 28 | final.rustPlatform.buildRustPackage { |
48 | inherit pname; | 29 | inherit pname; |
49 | inherit (packageMeta) version; | 30 | inherit (packageMeta) version; |
50 | 31 | ||
@@ -73,23 +54,15 @@ | |||
73 | devShell = forAllSystems (system: | 54 | devShell = forAllSystems (system: |
74 | let | 55 | let |
75 | pkgs = nixpkgsFor."${system}"; | 56 | pkgs = nixpkgsFor."${system}"; |
76 | toolchain = (rustChannel pkgs).withComponents [ | ||
77 | "rustc" | ||
78 | "cargo" | ||
79 | "rust-std" | ||
80 | "rustfmt" | ||
81 | "clippy" | ||
82 | "rust-src" | ||
83 | ]; | ||
84 | inherit (fenix.packages."${system}") rust-analyzer; | ||
85 | in | 57 | in |
86 | pkgs.mkShell { | 58 | pkgs.mkShell { |
87 | nativeBuildInputs = [ | 59 | nativeBuildInputs = [ |
88 | pkgs.pkgconfig | 60 | pkgs.pkgconfig |
89 | pkgs.openssl | 61 | pkgs.openssl |
90 | pkgs.bacon | 62 | pkgs.bacon |
91 | rust-analyzer | 63 | pkgs.rust-analyzer |
92 | toolchain | 64 | pkgs.rustc |
65 | pkgs.cargo | ||
93 | ]; | 66 | ]; |
94 | RUST_LOG = "info"; | 67 | RUST_LOG = "info"; |
95 | RUST_BACKTRACE = 1; | 68 | RUST_BACKTRACE = 1; |