diff options
author | Malte Voos <malte@malvo.org> | 2022-02-20 14:04:50 +0100 |
---|---|---|
committer | Malte Voos <malte@malvo.org> | 2022-02-20 14:04:50 +0100 |
commit | 6c028b01bf3c365f15ed0d68af5d3e68f27b0773 (patch) | |
tree | a42736bea5dae875391aceced9e56e9e89621c25 /flake.nix | |
download | bwinf402-6c028b01bf3c365f15ed0d68af5d3e68f27b0773.tar.gz bwinf402-6c028b01bf3c365f15ed0d68af5d3e68f27b0773.zip |
aufgabe 3 implementierung
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4b7dbad --- /dev/null +++ b/flake.nix @@ -0,0 +1,62 @@ +{ + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + mozilla = { + url = "github:mozilla/nixpkgs-mozilla"; + flake = false; + }; + naersk.url = "github:nmattia/naersk"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + outputs = { self, flake-utils, mozilla, naersk, nixpkgs }: flake-utils.lib.eachDefaultSystem ( + system: + let + overlay = final: prev: + let + # rustChannel = final.rustChannelOf { + # channel = "stable"; + # date = "2021-09-09"; + # sha256 = "sha256-HNIlEerJvk6sBfd8zugzwSgSiHcQH8ZbqWQn9BGfmpo="; + # }; + rustChannel = final.rustChannelOf { + channel = "nightly"; + date = "2021-10-25"; + sha256 = "sha256-/zS2GztCeH6kc3ZjhBRvT7Pbnea5JvGBuWdZmagh788="; + }; + rust = rustChannel.rust.override { + extensions = [ "rust-src" ]; + }; + in + { + rustc = rust; + cargo = rust; + }; + pkgs = import nixpkgs { + inherit system; + overlays = [ + (import "${mozilla}/rust-overlay.nix") + overlay + ]; + }; + naerskLib = pkgs.callPackage "${naersk}/default.nix" {}; + persea = naerskLib.buildPackage { + pname = "persea"; + src = ./.; + }; + in + { + defaultPackage = persea; + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + cargo + cargo-edit + rust-analyzer + rustfmt + + pkg-config + openssl + ]; + }; + } + ); +} |