Repository navigation
Add NixOS installation method to doc - #5757
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5757 +/- ##
============================================
- Coverage 84.52% 84.48% -0.05%
- Complexity 3731 3742 +11
============================================
Files 544 546 +2
Lines 12759 12791 +32
Branches 2232 2233 +1
============================================
+ Hits 10785 10806 +21
- Misses 864 869 +5
- Partials 1110 1116 +6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
| ### NixOS | ||
|
|
||
| ```sh | ||
| nix-shell -p detekt -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/f80ac848e3d6f0c12c52758c0f25c10c97ca3b62.tar.gz --command 'detekt --version' [detekt_version] |
There was a problem hiding this comment.
I'm not familiar with Nix - does the hash in the filename have to be updated with every detekt release? If so, is there a way to remove that from this command, because having to update this for every release may be a bit of a hassle.
There was a problem hiding this comment.
@mdr do you know whether the hash has to be updated with each and every detekt release?
(With the caveat I'm a Nix beginner!) Yes - if you specify a specific revision as above then you'd always get the same version of Detekt, so you'd have to update to get a more recent version of Detekt. You can just reference the detekt package unqualified, e.g. with nix-shell -p detekt - and then you'll get the Detekt version associated with the Nix channel you're using. If you're using the stable channel, that might be a few months out of date (and right now, detekt is too new to be in a stable Nix channel).
There was a problem hiding this comment.
Okay, then I'll change the script in the docs to be more generic, like this.
nixpkgs=https://github.com/NixOS/nixpkgs/archive/[hash].tar.gzThere was a problem hiding this comment.
I guess at some point when it's in stable channel we can simplify the command. But this is good in the meantime.
Where do people get the hash though? Is there a link we can include in the instructions?
There was a problem hiding this comment.
You can grab a commit hash from the Nix status page (for the nixpkgs-unstable channel). It does feel kinda awkward - I don't know if there's a way you can directly reference the latest nixpkgs-unstable channel directly in the command.
There was a problem hiding this comment.
If you have added the unstable channel via nix-channel, you can run: nix-shell -I nixpkgs=channel:nixpkgs-unstable -p detekt
|
I've backported it here #5776 |
No description provided.