-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
82 lines (79 loc) · 1.97 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
71
72
73
74
75
76
77
78
79
80
81
82
{
description = "trash - Move FILE(s) to the trash";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
nur.url = "github:nix-community/NUR";
maolonglong-nur.url = "github:maolonglong/nur-packages";
maolonglong-nur.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
flake-utils,
nur,
maolonglong-nur,
...
}: let
trashVersion =
if (self ? shortRev)
then self.shortRev
else "dev";
supportSystems = [
"x86_64-darwin"
"i686-darwin"
"aarch64-darwin"
"armv7a-darwin"
];
overlays = [
(final: prev: {
nur = import nur {
nurpkgs = prev;
pkgs = prev;
repoOverrides = {
maolonglong = import maolonglong-nur {pkgs = prev;};
};
};
})
];
in
flake-utils.lib.eachSystem supportSystems (
system: let
pkgs = import nixpkgs {inherit system;};
lib = pkgs.lib;
in rec {
packages.trash = pkgs.buildGoModule {
pname = "trash";
version = trashVersion;
src = lib.cleanSource self;
vendorHash = "sha256-3PnXB8AfZtgmYEPJuh0fwvG38dtngoS/lxyx3H+rvFs=";
ldflags = ["-s" "-w"];
checkFlags = ["-skip=TestRm"];
};
packages.default = packages.trash;
apps.trash = flake-utils.lib.mkApp {
drv = packages.trash;
};
apps.default = apps.trash;
}
)
// flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system overlays;};
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs =
(with pkgs; [
just
go
golines
gosimports
])
++ (with pkgs.nur.repos.maolonglong; [
gofumpt
skywalking-eyes
]);
};
}
);
}