Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
description = "Instant, easy, predictable shells and containers";
description = "Instant, easy, predictable dev environments";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
Expand All @@ -13,15 +13,14 @@

lastTag = "0.13.2";

# Add the commit to the version string, in case someone builds from main
getVersion = pkgs.lib.trivial.pipe self [
(x: "${lastTag}")
(x: if (self ? revCount)
then "${x}-${self.shortRev}"
else "${x}-${self.dirtyShortRev}")
];
revision = if (self ? shortRev)
then "${self.shortRev}"
else "${self.dirtyShortRev or "dirty"}";

# Run `devbox run update-flake` to update the vendorHash
# Add the commit to the version string for flake builds
version = "${lastTag}-${revision}";

# Run `devbox run update-flake` to update the vendor-hash
vendorHash = if builtins.pathExists ./vendor-hash
then builtins.readFile ./vendor-hash
else "";
Expand All @@ -31,18 +30,17 @@
in
{
inherit self;
packages.default = buildGoModule rec {
packages.default = buildGoModule {
pname = "devbox";
version = getVersion;
inherit version vendorHash;

src = ./.;

inherit vendorHash;

ldflags = [
"-s"
"-w"
"-X go.jetpack.io/devbox/internal/build.Version=${version}"
"-X go.jetpack.io/devbox/internal/build.Commit=${revision}"
];

# Disable tests if they require network access or are integration tests
Expand Down
Loading