-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
63 lines (53 loc) · 1.4 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
{
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
};
outputs = {
self,
nixpkgs,
}: let
supportedSystems = ["x86_64-linux"];
perSystem = attrs:
nixpkgs.lib.genAttrs supportedSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in
attrs system pkgs);
in {
packages = perSystem (system: pkgs: {
bazarr-bulk = pkgs.callPackage ({rustPlatform, ...}: let
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
rev = self.shortRev or self.dirtyShortRev or "dirty";
in
rustPlatform.buildRustPackage {
pname = "bazarr-bulk";
version = "${cargoToml.package.version}-${rev}";
src = ./.;
strictDeps = true;
cargoLock.lockFile = ./Cargo.lock;
meta.mainProgram = "bb";
}) {};
default = self.packages.${system}.bazarr-bulk;
});
formatter = perSystem (_: pkgs: pkgs.alejandra);
devShells = perSystem (_: pkgs: {
default = pkgs.mkShell {
strictDeps = true;
env.RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
nativeBuildInputs = with pkgs; [
cargo
rustc
rust-analyzer-unwrapped
rustfmt
];
packages = with pkgs; [
alejandra
];
};
});
};
}