-
Notifications
You must be signed in to change notification settings - Fork 9
/
flake.nix
70 lines (59 loc) · 2.03 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
68
69
70
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
nix-skyline-rs.url = "github:Naxdy/nix-skyline-rs";
nix-skyline-rs.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self
, flake-utils
, nix-skyline-rs
, nixpkgs
}: (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
packages = {
default = self.packages.${system}.latency-slider-de;
latency-slider-de =
let
cargoTOML = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in
pkgs.callPackage
({ mode ? "build", copyLibs ? true, cargoBuildOptions ? old: old, overrideMain ? old: old }:
nix-skyline-rs.lib.${system}.mkNroPackage {
pname = cargoTOML.package.name;
version = cargoTOML.package.version;
src = self;
inherit cargoBuildOptions overrideMain mode copyLibs;
})
{ };
latency-slider-de-classic = pkgs.callPackage
({ mode ? "build", copyLibs ? true }: self.packages.${system}.latency-slider-de.override {
inherit mode copyLibs;
cargoBuildOptions = old: old ++ [
"--no-default-features"
];
overrideMain = old: {
postInstall = (if (old ? postInstall) && (old.postInstall != false) then old.postInstall else "") + (pkgs.lib.optionalString (mode == "build") ''
mv $out/lib/liblatency_slider_de.nro $out/lib/liblatency_slider_de_classic.nro
'');
};
})
{ };
};
checks = {
clippy = self.packages.${system}.latency-slider-de.override {
mode = "clippy";
};
clippy-classic = self.packages.${system}.latency-slider-de-classic.override {
mode = "clippy";
};
};
devShells.default = nix-skyline-rs.devShells.${system}.default;
}));
}