-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
72 lines (67 loc) · 2.01 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
66
67
68
69
70
71
72
{
description = "Send SSE when files change";
outputs = {
self,
nixpkgs,
}: let
systems = {
"x86_64-linux" = {};
"x86_64-darwin" = {};
"aarch64-linux" = {};
"aarch64-darwin" = {};
};
generate = arg: builtins.mapAttrs arg (builtins.intersectAttrs systems nixpkgs.legacyPackages);
in rec {
packages = generate (
system: pkgs:
rec {
ssentr = pkgs.callPackage blueprints.ssentr {};
default = ssentr;
}
// (
if builtins ? fetchClosure
then {
ssentr-baked = builtins.fetchClosure {
fromPath = "/nix/store/sazl2bwfrj9sm5qm6qxiqag5ghmd24dp-ssentr";
fromStore = "https://cache.floxdev.com";
};
}
else {}
)
);
blueprints.ssentr = {
lib,
buildGo118Module,
}:
buildGo118Module {
name = "ssentr";
# Ignore nix file changes during build
src = builtins.path {
filter = path: type: ! builtins.elem (builtins.baseNameOf path) ["flake.nix" "flake.lock"];
path = self;
name = "ssentr";
};
vendorSha256 = "sha256-3d5iPPz6iccXq1kJyp6IgyQBGlKI0yZUKZIedeuDzz8=";
meta = with lib; {
maintainers = [maintainers.tomberek];
platforms = builtins.attrNames systems;
license = licenses.mit;
};
};
apps = generate (system: pkgs: {
update = {
type = "app";
program =
(with pkgs;
writeScript "update.sh" ''
${nix-prefetch}/bin/nix-prefetch --file 'fetchTarball "channel:nixos-unstable"' \
"{ sha256 }: (builtins.getFlake \"$PWD\").defaultPackage.x86_64-linux.go-modules.overrideAttrs
(_: { modSha256 = sha256; })" \
--option experimental-features 'nix-command flakes'
'')
.outPath;
};
});
hydraJobs = generate (system: pkgs: {ssentr = self.packages.${system}.ssentr;});
};
}