Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
73 lines (70 loc) · 1.8 KB
/
Copy pathflake.nix
File metadata and controls
73 lines (70 loc) · 1.8 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
{
description = "Tailor flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nix-packages.url = "github:wimpysworld/nix-packages";
nix-packages.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
nix-packages,
...
}:
let
supportedSystems = [
"x86_64-linux"
"aarch64-darwin"
"aarch64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
tailorPkgs = nix-packages.packages.${system} or { };
in
{
default = pkgs.mkShell {
shellHook = import ./nix/hooks.nix { inherit pkgs; };
packages =
with pkgs;
[
actionlint
cosign
gh
just
]
++ (if tailorPkgs ? tailor then [ tailorPkgs.tailor ] else [ ])
++ import ./nix/loader.nix { inherit pkgs; };
};
}
);
packages = forAllSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
version = "0.0.0-${self.sourceInfo.shortRev or (self.sourceInfo.dirtyShortRev or "dirty")}";
tailor = pkgs.buildGo126Module {
pname = "tailor";
inherit version;
src = ./.;
vendorHash = "sha256-GuGmFzx3p1k5b61NTVCFlkPz2M+Cd8cyCoop/w89gVU=";
subPackages = [ "cmd/tailor" ];
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
};
in
{
inherit tailor;
default = tailor;
}
);
};
}