-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
61 lines (51 loc) · 1.69 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
{
description = "Upload OS images to cloud provider";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
uplosi = pkgs.buildGoModule {
pname = "uplosi";
version = "devel";
src = ./.;
# this needs to be updated together with go.mod / go.sum
vendorHash = "sha256-0DEgai8DLNeBwl/JiX7NxOEDNPXnfVrgnKEt1TyO0Sw=";
CGO_ENABLED = 0;
ldflags = [ "-s" ];
nativeBuildInputs = [ pkgs.installShellFiles ];
postInstall = ''
installShellCompletion --cmd uplosi \
--bash <($out/bin/uplosi completion bash) \
--fish <($out/bin/uplosi completion fish) \
--zsh <($out/bin/uplosi completion zsh)
'';
meta = with pkgs.lib; {
description = "Upload OS images to cloud provider";
homepage = "https://github.com/edgelesssys/uplosi";
maintainers = with maintainers; [ katexochen malt3 ];
license = licenses.asl20;
};
};
in
{
devShells.default = import ./shell.nix { inherit pkgs; };
packages = {
default = uplosi;
uplosi = uplosi;
};
legacyPackages = {
nixpkgs = nixpkgs.legacyPackages.${system};
};
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
}
);
}