-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathflake.nix
More file actions
52 lines (50 loc) · 1.43 KB
/
flake.nix
File metadata and controls
52 lines (50 loc) · 1.43 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
{
description = "Kafkarator";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { nixpkgs, ... }:
let
goOverlay = final: prev: let
version = "1.25.6";
newerGoVersion = prev.go.overrideAttrs (old: {
inherit version;
src = prev.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
hash = "sha256-WMv3ceRNdt5vVtGeM7d9dFoeSJNAkih15GWFuXXCsFk=";
};
});
nixpkgsVersion = prev.go.version;
newVersionNotInNixpkgs = -1 == builtins.compareVersions nixpkgsVersion version;
in {
go = if newVersionNotInNixpkgs then newerGoVersion else prev.go;
buildGoModule = prev.buildGoModule.override { go = final.go; };
};
# helpers
withSystem = nixpkgs.lib.genAttrs [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
withPkgs = f:
withSystem (system:
f (import nixpkgs {
inherit system;
overlays = [ goOverlay ];
}));
in {
devShells = withPkgs (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
go
golangci-lint-langserver
gopls
python3
python3Packages.python-lsp-server
black
];
};
});
formatter = withPkgs (pkgs: pkgs.nixfmt-rfc-style);
};
}