Skip to content

build: add a nix flake#233

Open
niklaas wants to merge 6 commits into
naggie:masterfrom
niklaas:feat/nix-flake
Open

build: add a nix flake#233
niklaas wants to merge 6 commits into
naggie:masterfrom
niklaas:feat/nix-flake

Conversation

@niklaas
Copy link
Copy Markdown
Contributor

@niklaas niklaas commented May 7, 2026

Closes #209

niklaas added 6 commits March 31, 2026 13:06
Provides buildGoModule derivation for both dstask and dstask-import,
with proper ldflags for version info. Includes a dev shell with go
and golangci-lint.

Closes naggie#209
Delegates to the flake's devShell so both `nix-shell` and
`nix develop` use the same environment.
Runs `nix build` and `nix flake check` on every push/PR. A stale
vendorHash causes a hash mismatch error, so dependency changes that
forget to update the hash will fail CI.
The commit hash already identifies the build. The date added
complexity (reformatting self.lastModifiedDate) for little value,
especially since Nix builds prioritize reproducibility.

Only print the 'Build date' line when a real value is injected
(e.g. by goreleaser). Plain `go build` and Nix builds leave it
as the default 'Unknown', which is just noise.
@niklaas
Copy link
Copy Markdown
Contributor Author

niklaas commented May 7, 2026

As requested in #209 (comment). I won't have time to iterate on this over the next couple of weeks. So feel free to take over @eduardofuncao.

Comment thread README.md
Comment on lines +156 to +176
## Nix Flake

Run directly without installing:

```sh
nix run github:naggie/dstask -- version
```

Install into your profile:

```sh
nix profile install github:naggie/dstask
```

Dev shell (Go + golangci-lint):

```sh
nix develop # with flakes
nix-shell # legacy, uses flake-compat shim
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor suggestion, but I would add this inside a <details> block, like this:

Nix Flake Run directly without installing:
nix run github:naggie/dstask -- version

Install into your profile:

nix profile install github:naggie/dstask

Dev shell (Go + golangci-lint):

nix develop        # with flakes
nix-shell          # legacy, uses flake-compat shim

Comment thread shell.nix
Copy link
Copy Markdown
Contributor

@eduardofuncao eduardofuncao May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider removing shell.nix altogether

@eduardofuncao
Copy link
Copy Markdown
Contributor

eduardofuncao commented May 7, 2026

As requested in #209 (comment). I won't have time to iterate on this over the next couple of weeks. So feel free to take over @eduardofuncao.

@niklaas Thanks for opening the PR! Unfortunately I can't push to your fork :( is it ok if I open another PR? The changes would be just a minor update on the readme, and dropping the shell.nix and the flake-compat dependency

@niklaas
Copy link
Copy Markdown
Contributor Author

niklaas commented May 7, 2026

is it ok if I open another PR? The changes would be just a minor update on the readme, and dropping the shell.nix and the flake-compat dependency

Sure thing, take it on! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Nix Flake

2 participants