Skip to content

Conversation

@kittywitch
Copy link

@kittywitch kittywitch commented Dec 1, 2025

Hi! This adds several things for NixOS and Nix users to this project.

I can make a separate repository (presumably I would name it something like pesde-flake) to maintain these additions separately, if you should wish instead of incorporating them into your 0.7 branch.

I may also contemplate upstreaming this directly to nixpkgs and becoming its maintainer separately aside from the project itself, to provide this package manager for all nixpkgs users.

Usage

  • to build package with Nix: nix build .# or nix build .#pesde
  • to obtain shell automagically (.envrc provided): use direnv and run direnv allow to be dropped into a shell automatically
  • manual shell obtainment: nix develop, nix develop .#

Maintenance

When you change the contents of your Cargo.toml or the Cargo.lock lockfile changes, nix/package.nix will require updating thusly; there is a cargoHash, e.g.

  cargoHash = "sha256-7rEU4vU6qp6eaj777cC3BgrRyiLRe+5xZC+cqV5TTc4=";

Replace the hash with "" and nix build .# to get the new hash that should be provided where the old one was.
The version within nix/package.nix must also be incremented alongside the repository changes.

Copy link
Member

@daimond113 daimond113 left a comment

Choose a reason for hiding this comment

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

Overall, while providing Nix support would be nice, I don't believe pesde fits the criteria as it is inherently impure. You must especially consider this if you plan on PRing to nixpkgs.

buildNoDefaultFeatures = true;
buildFeatures = [
"bin"
"version-management"
Copy link
Member

Choose a reason for hiding this comment

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

I actually made version-management in mind to be disabled when using Nix, as it manages pesde's and engines' executables, which is impure. Additionally, you'd most likely want wally-compat and patches enabled for Nix users.

openssl,
dbus,
}:
rustPlatform.buildRustPackage (_finalAttrs: {
Copy link
Member

Choose a reason for hiding this comment

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

If Nix is to be added, I think I'd prefer for it to use crate2nix.

Copy link
Author

Choose a reason for hiding this comment

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

I think I would agree for the packaging within this repository, but when upstreaming it to nixpkgs this would be a bad idea.

Comment on lines +9 to +10
pname = "pesde";
version = "0.7.1";
Copy link
Member

Choose a reason for hiding this comment

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

Ideally these would be read from the Cargo manifest.

@kittywitch
Copy link
Author

Overall, while providing Nix support would be nice, I don't believe pesde fits the criteria as it is inherently impure. You must especially consider this if you plan on PRing to nixpkgs.

What inherent impurity is there within pesde?

@daimond113
Copy link
Member

daimond113 commented Dec 1, 2025

What inherent impurity is there within pesde?

Engine management and binary packages.

@kittywitch
Copy link
Author

What inherent impurity is there within pesde?

Engine management and binary packages.

That's fine, so as long as the program does not self-mutate where it is installed from. It is not a necessary concern to have, if there is a wider concern that would regard say, the manager(s) of Lua packaging for Nix as a whole, and not the use of an individual package manager within a system in an impure fashion (not everything need be perfect and pure).

@daimond113
Copy link
Member

daimond113 commented Dec 1, 2025

That's fine, so as long as the program does not self-mutate where it is installed from. It is not a necessary concern to have, if there is a wider concern that would regard say, the manager(s) of Lua packaging for Nix as a whole, and not the use of an individual package manager within a system in an impure fashion (not everything need be perfect and pure).

pesde does, as version management replaces its own executable with a version fetched from the internet. For engines & binaries, it hardlinks the executable in the bin directory to the name used whenever it is referenced by a project (dependency or not).

@kittywitch
Copy link
Author

kittywitch commented Dec 1, 2025

That's fine, so as long as the program does not self-mutate where it is installed from. It is not a necessary concern to have, if there is a wider concern that would regard say, the manager(s) of Lua packaging for Nix as a whole, and not the use of an individual package manager within a system in an impure fashion (not everything need be perfect and pure).

pesde does, as version management replaces its own executable with a version fetched from the internet. For engines & binaries, it hardlinks the executable in the bin directory to the name used whenever it is referenced by a project (dependency or not).

I will make sure that feature is not enabled within the rework of this PR to use crate2nix, although I figure crate2nix adds a lot more ...bloat to the overall Nix for a project, especially considering flake-parts and all. Also, it seems to make it harder to use the packaging and shell without flakes, in the sense of, currently there is a shell.nix and a package.nix, which allows for both to be consumed by non-flake users.

@daimond113
Copy link
Member

I will make sure that feature is not enabled within the rework of this PR to use crate2nix, although I figure crate2nix adds a lot more ...bloat to the overall Nix for a project, especially considering flake-parts and all.

You needn't use crate2nix, just my personal preference when using Rust flakes.

Unfortunately for Nix, disabling the feature does not remove binary package executables, as it would inherently break them. This issue will hopefully improve in pesde 0.8 when we switch to using croshet, as we will generate ephemeral binary directories that we will append to PATH when running tasks.

@kittywitch
Copy link
Author

Do you think it is worth holding off on packaging for Nix until 0.8, then?

@daimond113
Copy link
Member

Probably so. If you wish, you can leave this PR as a draft, and I'll ping you when the required changes get pushed to main.

@kittywitch kittywitch marked this pull request as draft December 1, 2025 23:00
@CompeyDev
Copy link
Member

CompeyDev commented Dec 2, 2025

Why the PR? We already have pesde-nix which uses FHS to get around impurities introduced by the entire concept of a package manager which fetches arbitrary packages from the internet.

The package is made by an individual who is currently already associated with the project, it might even be worth merging in the organization itself to make it official.

@kittywitch
Copy link
Author

I was not aware of that project.

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.

3 participants