nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5}:
6
7buildGoModule {
8 pname = "mop";
9 version = "0-unstable-2025-12-20";
10
11 src = fetchFromGitHub {
12 owner = "mop-tracker";
13 repo = "mop";
14 rev = "64f37500a195d9c4e01eb3a97199b00515e9fd7a";
15 hash = "sha256-j6+bzWfYTBMjgJbyd6JQno2eFTUGHYAv8c4x1Ocp878=";
16 };
17
18 vendorHash = "sha256-Jq6SMnCUvuccEP85x1EEYnafUEeBT+AmqeikFvesMYY=";
19
20 postPatch = ''
21 # unsafe.Slice requires go1.17 or later
22 substituteInPlace go.mod --replace-fail 'go 1.15' 'go 1.17'
23 # go says: github.com/rivo/uniseg@v0.2.0: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
24 # so need to explicitly require it
25 echo 'require github.com/rivo/uniseg v0.2.0' >> go.mod
26 '';
27
28 meta = {
29 description = "Simple stock tracker implemented in go";
30 homepage = "https://github.com/mop-tracker/mop";
31 license = lib.licenses.mit;
32 mainProgram = "mop";
33 };
34}