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 a README section on Nix #26

Merged
merged 1 commit into from Dec 22, 2020
Merged

Add a README section on Nix #26

merged 1 commit into from Dec 22, 2020

Conversation

lrworth
Copy link
Contributor

@lrworth lrworth commented Dec 22, 2020

There are many ways someone could use the expression in nixpkgs, so I've chosen the simplest possible thing to do: just run unused. I hope this provides enough information for someone to use nix-channel and nix-env, or home-manager, or configuration.nix, or their own expression, etc.

@lrworth lrworth mentioned this pull request Dec 22, 2020
10 tasks
@joshuaclayton
Copy link
Member

Thanks for adding this @lrworth!

There are many ways to run `unused` with Nix, but the simplest is:

```sh
nix run -f https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.zip unused -c unused --help

Choose a reason for hiding this comment

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

This should probably be nix-shell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. I don't know how to do the same with nix-shell, could you please translate?

Copy link

Choose a reason for hiding this comment

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

nix-shell -p unused --run unused --help

If you just do nix-shell -p unused it opens a bash shell with unused in your PATH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That brings up the man page for nix-shell, and

nix-shell -p unused --run 'unused --help'

gives me

error: undefined variable 'unused' at (string):1:94
(use '--show-trace' to show detailed location information)

Is there a nix-shell one-liner to launch unused without manipulating channels? Note we are aiming for the simplest method here — everyone is going to have their own preferred way to use it.

Choose a reason for hiding this comment

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

Forgot the quotes.

Works for me:

nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz -p unused --run 'unused --help'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I'll make another PR I guess.

@lrworth lrworth deleted the nix branch December 27, 2020 00:58
@lrworth lrworth mentioned this pull request Dec 27, 2020
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