From 151187a47a10b63f003924ab432a194bbcc79d93 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 1 Nov 2021 21:15:26 +0530 Subject: simplify flake a bit, remove statix warning --- flake.nix | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 439f076..3536770 100644 --- a/flake.nix +++ b/flake.nix @@ -43,22 +43,28 @@ { overlay = final: prev: { - statix = with final; (makeRustPlatform { - inherit (rustChannel final) cargo rustc; - }).buildRustPackage rec { - pname = "statix"; - version = (lib.importTOML ./bin/Cargo.toml).package.version; - src = gitignoreSource ./.; - - cargoLock.lockFile = ./Cargo.lock; - - meta = with lib; { - description = "Lints and suggestions for the Nix programming language"; - homepage = "https://git.peppe.rs/languages/statix/about"; - license = licenses.mit; + statix = with final; + let + pname = "statix"; + packageMeta = (lib.importTOML ./bin/Cargo.toml).package; + rustPlatform = makeRustPlatform { + inherit (rustChannel final) cargo rustc; + }; + in + rustPlatform.buildRustPackage { + inherit pname; + inherit (packageMeta) version; + + src = gitignoreSource ./.; + cargoLock.lockFile = ./Cargo.lock; + + meta = with lib; { + description = "Lints and suggestions for the Nix programming language"; + homepage = "https://git.peppe.rs/languages/statix/about"; + license = licenses.mit; + }; }; - }; statix-vim = with final; vimUtils.buildVimPlugin { -- cgit v1.2.3