-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathflake.nix
More file actions
86 lines (83 loc) · 2.37 KB
/
flake.nix
File metadata and controls
86 lines (83 loc) · 2.37 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
go = (
prev.go.overrideAttrs {
version = "1.25.4";
src = prev.fetchurl {
url = "https://go.dev/dl/go1.25.4.src.tar.gz";
hash = "sha256-nqz4JydXl3ayQhnzCmcE4aQ89GkOJRtDjK3HxYZTJkw=";
};
}
);
})
];
};
in
{
devShells.default = pkgs.mkShell {
packages = [
pkgs.go
# Any nodejs 20 is fine.
pkgs.nodejs_20
# The version of python3 does not matter that much.
pkgs.python3
pkgs.pkg-config
(pkgs.golangci-lint.overrideAttrs (
prev:
let
version = "2.5.0";
in
{
inherit version;
src = pkgs.fetchFromGitHub {
owner = "golangci";
repo = "golangci-lint";
rev = "v${version}";
hash = "sha256-7dHr7cd+yYofIb+yR2kKfj0k0onLH2W/YuxNor7zPeo=";
};
vendorHash = "sha256-QEYbFz7SJxLMblkNqaRLDn/PO+mtSPvNYiEUmZh0sLQ=";
# We do not actually override anything here,
# but if we do not repeat this, ldflags refers to the original version.
ldflags = [
"-s"
"-X main.version=${version}"
"-X main.commit=v${version}"
"-X main.date=19700101-00:00:00"
];
}
))
];
buildInputs = [
pkgs.icu
pkgs.vips
# file includes libmagic.
pkgs.file
# https://discourse.nixos.org/t/non-interactive-bash-errors-from-flake-nix-mkshell/33310
pkgs.bashInteractive
];
nativeBuildInputs = [
pkgs.pkg-config
pkgs.icu
pkgs.vips
pkgs.file
];
};
}
);
}