Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (60 loc) · 1.85 KB
/
Copy pathflake.nix
File metadata and controls
69 lines (60 loc) · 1.85 KB
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
{
description = "q, a fast implementation of quilt";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs =
{ self, nixpkgs }:
let
lib = nixpkgs.lib;
systems = [
"aarch64-darwin"
"x86_64-darwin"
"aarch64-linux"
"x86_64-linux"
];
forAllSystems = f: lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
q =
{
lib,
stdenv,
rustPlatform,
git,
diffutils,
gnupatch,
diffstat,
util-linux,
}:
rustPlatform.buildRustPackage {
pname = "q";
version = self.shortRev or self.dirtyShortRev or "unknown";
src = lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
env.Q_VERSION = self.shortRev or self.dirtyShortRev or "unknown";
# Tests drive q against real git, diff, patch and diffstat.
nativeCheckInputs = [
git
diffutils
gnupatch
diffstat
]
++ lib.optional stdenv.hostPlatform.isLinux util-linux;
# Needs util-linux `script -c`, which macOS's script lacks.
checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
"--skip=paged_commands_honor_quilt_pager_on_tty"
];
meta = {
description = "Fast implementation of quilt";
homepage = "https://github.com/imputnet/q";
license = lib.licenses.gpl3Plus;
mainProgram = "q";
};
};
in
{
packages = forAllSystems (pkgs: {
q = pkgs.callPackage q { };
default = self.packages.${pkgs.stdenv.hostPlatform.system}.q;
});
overlays.default = final: _: { q = final.callPackage q { }; };
formatter = forAllSystems (pkgs: pkgs.nixfmt);
};
}