Skip to content

Commit 7063cda

Browse files
committed
Cleanup flake and json
1 parent ba51372 commit 7063cda

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

devbox.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"go": "latest",
66
"runx:golangci/golangci-lint": "latest",
77
"runx:mvdan/gofumpt": "latest",
8-
"github:nix-community/gomod2nix": ""
98
},
109
"env": {
1110
"GOENV": "off",
@@ -39,6 +38,10 @@
3938
"test": "go test -race -cover ./...",
4039
"test-projects-only": "DEVBOX_RUN_PROJECT_TESTS=1 go test -v -timeout ${DEVBOX_GOLANG_TEST_TIMEOUT:-30m} ./... -run \"TestExamples|TestScriptsWithProjects\"",
4140
"update-examples": "devbox run build && go run testscripts/testrunner/updater/main.go",
41+
// Updates the Flake's vendorHash: First run `go mod vendor` to vendor
42+
// the dependencies, then hash the vendor directory with Nix.
43+
// The hash is saved to the `vendor-hash` file, which is then
44+
// read into the Nix Flake.
4245
"update-hash": [
4346
"go mod vendor",
4447
"hash=$(nix hash path vendor)",

flake.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
pkgs = nixpkgs.legacyPackages.${system};
1313

1414
lastTag = "0.13.2";
15-
15+
16+
# Add the commit to the version string, in case someone builds from main
1617
getVersion = pkgs.lib.trivial.pipe self [
1718
(x: "${lastTag}")
1819
(x: if (self ? revCount)
1920
then "${x}-${self.shortRev}"
2021
else "${x}-${self.dirtyShortRev}")
2122
];
2223

24+
# Run `devbox run update-flake` to update the vendorHash
2325
vendorHash = if builtins.pathExists ./vendor-hash
2426
then builtins.readFile ./vendor-hash
2527
else "";
@@ -35,7 +37,7 @@
3537

3638
src = ./.;
3739

38-
inherit vendorHash; # Let nix compute the vendor hash
40+
inherit vendorHash;
3941

4042
ldflags = [
4143
"-s"
@@ -59,7 +61,7 @@
5961
description = "Instant, easy, predictable shells and containers";
6062
homepage = "https://www.jetpack.io/devbox";
6163
license = licenses.asl20;
62-
maintainers = with maintainers; [ urandom lagoja ];
64+
maintainers = with maintainers; [ lagoja ];
6365
};
6466
};
6567
}

0 commit comments

Comments
 (0)