-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
65 lines (61 loc) · 1.5 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
{
description = "NAIS CLI";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
}: let
version = builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101");
# goOverlay = final: prev: {
# go = prev.go.overrideAttrs (old: {
# version = "1.23.2";
# src = prev.fetchurl {
# url = "https://go.dev/dl/go1.23.2.src.tar.gz";
# hash = "sha256-NpMBYqk99BfZC9IsbhTa/0cFuqwrAkGO3aZxzfqc0H8=";
# };
# });
# };
withSystem = nixpkgs.lib.genAttrs [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
withPkgs = callback:
withSystem (
system:
callback (
import nixpkgs {
inherit system;
# overlays = [goOverlay];
}
)
);
in {
packages = withPkgs (pkgs: rec {
nais = pkgs.buildGoModule {
pname = "nais-cli";
inherit version;
src = ./.;
vendorHash = "sha256-WE5WSOOAUBEfxF/NAaVjTFBZeMRA3APmOJGbBueKObo=";
postInstall = ''
mv $out/bin/cli $out/bin/nais
'';
};
default = nais;
});
devShells = withPkgs (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
go-tools
nodejs_20
nodePackages.prettier
];
};
});
formatter = withPkgs (pkgs: pkgs.nixfmt-rfc-style);
};
}