-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
67 lines (57 loc) · 1.8 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
rust-overlay.url = "github:oxalica/rust-overlay";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
};
outputs = inputs@{ self, utils, rust-overlay, ... }:
utils.lib.mkFlake rec {
inherit self inputs;
sharedOverlays = [ (import rust-overlay) ];
supportedSystems = [
"aarch64-linux"
"aarch64-darwin"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
outputsBuilder = channels: with channels; {
devShell = nixpkgs.mkShell {
name = "photosphere";
buildInputs = with nixpkgs; [
# `rust-overlay` has a set of
# rust tools see more on
# https://github.com/oxalica/rust-overlay
rust-bin.stable.latest.complete
];
};
packages = with nixpkgs; {
inherit (nixpkgs) package-from-overlays;
photosphere = rustPlatform.buildRustPackage rec {
pname = "photosphere";
version = "v0.3.0";
doCheck = true;
src = ./.;
checkInputs = [ rustfmt cargo-nextest clippy ];
checkPhase = ''
runHook preCheck
cargo check
rustfmt --check src/main.rs
cargo clippy
cargo nextest run
runHook postCheck
'';
cargoLock = {
lockFile = ./Cargo.lock;
};
meta = with nixpkgs.lib; {
description = "An easy way to start a Photosphere project";
homepage = "https://github.com/solfacil/photosphere-cli";
license = licenses.bsd3;
maintainers = [ maintainers.zoedsoupe ];
};
};
};
};
};
}