nix: flake: build package with vanilla 'nixpkgs'

This commit is contained in:
Bruno BELANYI 2021-03-31 16:03:24 +00:00
parent 3fc96cd7a8
commit 8f60cfe836
2 changed files with 10 additions and 63 deletions

View file

@ -31,43 +31,6 @@
"type": "github"
}
},
"mozillapkgs": {
"flake": false,
"locked": {
"lastModified": 1603906276,
"narHash": "sha256-RsNPnEKd7BcogwkqhaV5kI/HuNC4flH/OQCC/4W5y/8=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "8c007b60731c07dd7a052cce508de3bb1ae849b4",
"type": "github"
},
"original": {
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1614785451,
"narHash": "sha256-TPw8kQvr2UNCuvndtY+EjyXp6Q5GEW2l9UafXXh1XmI=",
"owner": "nmattia",
"repo": "naersk",
"rev": "e0fe990b478a66178a58c69cf53daec0478ca6f9",
"type": "github"
},
"original": {
"owner": "nmattia",
"ref": "master",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1616670887,
@ -88,8 +51,6 @@
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"mozillapkgs": "mozillapkgs",
"naersk": "naersk",
"nixpkgs": "nixpkgs"
}
}

View file

@ -1,13 +1,5 @@
{
inputs = {
naersk = {
url = "github:nmattia/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
mozillapkgs = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
@ -16,27 +8,19 @@
};
};
outputs = { self, naersk, mozillapkgs, nixpkgs, flake-utils, ... }:
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { };
rustNightly = (mozilla.rustChannelOf {
date = "2021-03-29";
channel = "nightly";
sha256 = "sha256-Y94CnslybZgiZlNVV6Cg0TUPV2OeDXakPev1kqdt9Kk=";
}).rust;
naersk-lib = pkgs.callPackage naersk {
cargo = rustNightly;
rustc = rustNightly;
};
in
{
defaultPackage = naersk-lib.buildPackage {
src = ./.;
defaultPackage = pkgs.rustPlatform.buildRustPackage {
pname = "lohr";
version = "0.3.1";
src = ./.;
cargoSha256 = "sha256-XnBvb13Pv7bNTLCL3WV+bxRK0/uMEKA1/Bk0Tfua3Rs=";
meta = with pkgs.lib; {
description = "A Git mirroring tool";
@ -52,10 +36,12 @@
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
cargo
clippy
nixpkgs-fmt
pre-commit
rustPackages.clippy
rustNightly
rustc
rustfmt
];