-
-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (54 loc) · 1.59 KB
/
Copy pathflake.nix
File metadata and controls
62 lines (54 loc) · 1.59 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
{
description = "Cherri - A language that compiles to Apple Shortcuts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
version =
let
content = builtins.readFile ./version.go;
# Extract version string using regex
matches = builtins.match ''.*version = "([^"]+)".*'' content;
in
builtins.head matches;
in
{
packages = {
cherri = pkgs.buildGoModule {
pname = "cherri";
version = version;
src = ./.;
vendorHash = "sha256-5hACp6B2eO82pv470E/dIMbKAO1Z/PI978pSzOB7Wtk=";
# Only run tests that don't require network access
# TestDecomp is excluded due to a pre-existing bug
checkFlags = [ "-run" "TestCherriNoSign" ];
meta = with pkgs.lib; {
description = "A language that compiles to Apple Shortcuts";
homepage = "https://github.com/electrikmilk/cherri";
license = licenses.gpl2;
maintainers = [ ];
mainProgram = "cherri";
};
};
default = self.packages.${system}.cherri;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
];
};
}
);
}