lohr/flake.nix

66 lines
1.7 KiB
Nix
Raw Normal View History

2021-03-29 20:00:01 +02:00
{
inputs = {
naersk = {
url = "github:nmattia/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
2021-03-29 20:00:01 +02:00
mozillapkgs = {
url = "github:mozilla/nixpkgs-mozilla";
flake = false;
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
2021-03-29 20:00:01 +02:00
};
outputs = { self, naersk, mozillapkgs, 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
{
2021-03-29 22:47:42 +02:00
defaultPackage = naersk-lib.buildPackage {
src = ./.;
pname = "lohr";
meta = with pkgs.lib; {
description = "A Git mirroring tool";
homepage = "https://github.com/alarsyo/lohr";
license = with licenses; [ mit asl20 ];
platforms = platforms.unix;
};
2021-03-29 22:47:42 +02:00
};
2021-03-29 20:00:01 +02:00
defaultApp = flake-utils.lib.mkApp {
drv = self.defaultPackage."${system}";
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
nixpkgs-fmt
pre-commit
rustPackages.clippy
rustNightly
rustfmt
];
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
};
});
}