aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix35
1 files changed, 4 insertions, 31 deletions
diff --git a/flake.nix b/flake.nix
index be5d5db..b041812 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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;