Skip to content

Nix packaging#256

Open
Lillecarl wants to merge 4 commits into
dynamist:masterfrom
Lillecarl:nix
Open

Nix packaging#256
Lillecarl wants to merge 4 commits into
dynamist:masterfrom
Lillecarl:nix

Conversation

@Lillecarl

Copy link
Copy Markdown

Packaging phabfive with Nix.
Exposes a flake as well as "traditional Nix" with support for user-supplied nixpkgs instance, nixpkgs from NIX_PATH or the nixpkgs version locked in the flake.

@Lillecarl

Copy link
Copy Markdown
Author

@holmboe I'm open to walking through the complete changeset 1on1 once/if you have a moment to spare :)

Comment thread nix/phabfive.nix
build-system = [ hatchling ];
dependencies = [
installShellFiles
# deps

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.

Is it possible, and advisable, to get this list fromTOML somehow?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's possible with https://pyproject-nix.github.io/uv2nix I've been packing up https://github.com/dynamist/weav with uv2nix so you'll be able to see the different approaches (It's more complex but it also uses uv.lock to fetch deps which is more correct).

When packaging with the nixpkgs Python builders it's not recommended however.

Comment thread .envrc

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.

Is this direnv? See T2157 for context and evaluate if this is desirable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It is direnv, using direnv is absolutely optional (you don't have to install it and you don't have to approve a projects .envrc if you don't want to). It's not possible to get a Nix environment without executing Nix.
Without direnv you can run either "nix-shell" or "nix develop" but IMO they're slightly worse since they force you into a bash subprocess (which is technically good since you get access to Nix bash builder functions) but it's not nice if you're an alternative shell user. (You can hack your way around that by exec'ing $SHELL in shellHook).

I think it's worthwhile to revisit T2157 if we're pivoting towards exploring the world of Nix (direnv is authored by numtide which is a Nix consultancy). Static .env files doesn't work when you bring in Nix.

lillecarl added 2 commits July 15, 2026 11:29
- Removed nix/pkgsSettings.nix (contained unnecessary allowUnfree = true)
- flake.nix now uses inputs.self.legacyPackages.${system} as pkgs for default.nix
- default.nix default pkgs no longer references pkgsSettings.nix
- Ran nix flake update (nixpkgs -> 2026-07-14, flake-compatish -> 2026-07-13)
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.

2 participants