From 93665d8e056b6a0f2ca7507fdaacfb27b808f4c8 Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Mon, 21 Mar 2022 16:28:18 +0100 Subject: flake update --- flake.lock | 96 ++++++++++++++++++++++++++++---------------------------------- flake.nix | 80 +++++++++++++++++---------------------------------- 2 files changed, 69 insertions(+), 107 deletions(-) diff --git a/flake.lock b/flake.lock index 11414ad..2800fa9 100644 --- a/flake.lock +++ b/flake.lock @@ -1,74 +1,48 @@ { "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", - "type": "github" + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "mozilla": { - "flake": false, "locked": { - "lastModified": 1629225446, - "narHash": "sha256-HJX4Pc5ZUAg4apxB/XHuJ+6ukzvRQqeZMjscOBst2bA=", - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "rev": "0510159186dd2ef46e5464484fbdf119393afa58", + "lastModified": 1646115921, + "narHash": "sha256-qWsIHQ8Lb0Fk5HcMGD1aVyO1DL+GV1ulf9NuHLcU0V4=", + "owner": "nix-community", + "repo": "fenix", + "rev": "637a0fde617a93d01e5275946402cca15d50ef46", "type": "github" }, "original": { - "owner": "mozilla", - "repo": "nixpkgs-mozilla", + "owner": "nix-community", + "repo": "fenix", "type": "github" } }, - "naersk": { - "inputs": { - "nixpkgs": "nixpkgs" - }, + "flake-utils": { "locked": { - "lastModified": 1632266297, - "narHash": "sha256-J1yeJk6Gud9ef2pEf6aKQemrfg1pVngYDSh+SAY94xk=", - "owner": "nmattia", - "repo": "naersk", - "rev": "ee7edec50b49ab6d69b06d62f1de554efccb1ccd", + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { - "owner": "nmattia", - "repo": "naersk", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1631118067, - "narHash": "sha256-tEcFvm3a6ToeBGwHdjfB2mVQwa4LZCZTQYE2LnY3ycA=", - "path": "/nix/store/6dcqil119qr3sad2lp9ykkkc852ppmqm-source", - "rev": "09cd65b33c5653d7d2954fef4b9f0e718c899743", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1634436779, - "narHash": "sha256-D/nrXTWpe1bPIjFy85sgiLHYqu+AeaC6v5/+KlA9PRg=", + "lastModified": 1645433236, + "narHash": "sha256-4va4MvJ076XyPp5h8sm5eMQvCrJ6yZAbBmyw95dGyw4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9aeeb7574fb784eaf6395f4400705b5f619e6cc3", + "rev": "7f9b6e2babf232412682c09e57ed666d8f84ac2d", "type": "github" }, "original": { @@ -80,10 +54,26 @@ }, "root": { "inputs": { + "fenix": "fenix", "flake-utils": "flake-utils", - "mozilla": "mozilla", - "naersk": "naersk", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1646043344, + "narHash": "sha256-eRjC16pYTv6EqyyuE/EN3MwIx+sckiVKJVVP0LgXlPs=", + "owner": "rust-analyzer", + "repo": "rust-analyzer", + "rev": "342c3c42bb282cae05e9d8740c2f724ea8014150", + "type": "github" + }, + "original": { + "owner": "rust-analyzer", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 4b7dbad..a94eb7d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,62 +1,34 @@ { 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"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, flake-utils, mozilla, naersk, nixpkgs }: flake-utils.lib.eachDefaultSystem ( + outputs = { self, flake-utils, nixpkgs, fenix }: 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 - ]; - }; - } + let + pkgs = import nixpkgs { + inherit system; + overlays = [ fenix.overlay ]; + }; + in + { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + (fenix.packages.${system}.complete.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + ]) + rust-analyzer-nightly + cargo-edit + ]; + }; + } ); } -- cgit 1.4.1