Skip to content

Create nix derivation with and without flakes#12

Open
NelsonVides wants to merge 6 commits into
mainfrom
nixpkg
Open

Create nix derivation with and without flakes#12
NelsonVides wants to merge 6 commits into
mainfrom
nixpkg

Conversation

@NelsonVides

@NelsonVides NelsonVides commented Apr 6, 2026

Copy link
Copy Markdown

This creates Nix derivations, with and without Flakes. My homeserver is a NixOS box, and I'm currently doing magic systemd-unit+bash-script+curl-with-flags to update my records automatically and this CLI would make things insanely cleaner.

And other than me, once we make this repo public, Nix derivations are just a good installation tooling hopefully useful to tons of people other than myself 🙂

PS: I don't use flakes myself but they're insanely popular in the Nix community, @onlyhavecans uses them :)

Closes #14

📋 Deployment Pre/Post tasks

N/A

:shipit: Deployment Verification

N/A

@NelsonVides NelsonVides requested a review from weppos April 6, 2026 07:48
@NelsonVides NelsonVides self-assigned this Apr 6, 2026
@NelsonVides NelsonVides added the enhancement New feature or request label Apr 6, 2026
@weppos

weppos commented Apr 7, 2026

Copy link
Copy Markdown
Member

@NelsonVides thanks for the patch! Can you please create a ticket to describe the problem, and attach this PR to it? The ticket has a precise template that helps to understand what is the problem and the expectation, which is not always immediately evident from a PR.

@NelsonVides

Copy link
Copy Markdown
Author

@weppos created #14 :)

@onlyhavecans onlyhavecans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The standard nix didn't build so I fixed it build. I also added a standard nix-shell.

While I was in there I also dropped the with lib since it is now consitered an antipattern and it's use is being cleaned from upstream nixpkgs because it slows down calulating the derevation and can have side effects. In general with should be used sparingly and scoped as deeply as possible

I also think this would benefit from having make commands for the builds, & also CI tests to make sure we don't leave this broken and unbuildable accidentally.

Comment thread default.nix Outdated
@onlyhavecans

Copy link
Copy Markdown
Member

Correction, @onlyhavecans used flakes at one point and decided to spare herself the complexity and slow evalulations that come with flakes. She moved to using standard nix again with npins for pinning.

Flakes do have a lot of hype and you can do some great things if you are really into the Nix language but I find most people I talk to don't use them.

Comment thread flake.nix
description = "Command-line interface for the DNSimple API";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For performance reasons it is recommended to use hydra tarballs, especially for independant repos.

See
https://discourse.nixos.org/t/questions-about-inputs-nixpkgs/69095/14?u=malix
and an example in repo of https://github.com/NixOS/nixos-hardware/blob/6358ff76821101c178e3ab4919a62799bfe3652e/flake.nix#L4

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Nix packaging

3 participants