Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flake.nix #226

Merged
merged 2 commits into from
Mar 12, 2023
Merged

Add flake.nix #226

merged 2 commits into from
Mar 12, 2023

Conversation

nullishamy
Copy link
Contributor

This adds support for Nix flakes.

@b3nj5m1n
Copy link
Owner

Hi! First of all, thank you for this!

I'm currently in the process of nix'ifying a lot of my personal projects, so great timing as well.

I have to admit that I'm a little confused about where this package definition is supposed to go, since it's already a package in the official nixpkgs repo.

It doesn't seem like a good idea to maintain both, but it also seems like a good idea to maintain it as part of a flake in the project's repository.

I guess my question is what the current best practice is regarding this, would the nixpkgs definition be changed to use this flake, should we change the definition of this flake to use the nixpkgs definition and overwrite the src attribute?

I'd also like to add a dev shell, but I can do that myself after this PR is merged.

flake.nix Outdated
install -Dm755 xdg-ninja.sh "$out/share/xdg-ninja/xdg-ninja.sh"
install -Dm644 programs/* -t "$out/share/xdg-ninja/programs"
mkdir -p "$out/bin"
ln -s "$out/share/xdg-ninja/xdg-ninja.sh" "$out/bin/xdg-ninja"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not move it to $out/bin in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

install handles file permissions (setting the executable flag) at the same time.

@nullishamy
Copy link
Contributor Author

Oh, I did not see the official package 😆

I'm not quite sure what the etiquette there is. Maybe opening something on the Nix Discourse would be a good idea?

@b3nj5m1n
Copy link
Owner

Since I'm a little busy at the moment, for now I just did what seemed the most sensible to me. (Use the derivation I hope I'm using that term correctly from the official nixpkgs repo and overwrite the src attribute)

Thank you again for the contribution!

@b3nj5m1n b3nj5m1n changed the title Add nix flake support Add flake.nix Mar 12, 2023
@b3nj5m1n b3nj5m1n merged commit b03a94b into b3nj5m1n:main Mar 12, 2023
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.

None yet

3 participants