Search code examples
nix

How to instsall nix-linter


I've tried to install nix-linter with 3 way. None works

nix package manager

 nix-env -iA nixpkgs.nix-linter

Package is marked as broken, refusing to evaluate.

It propose me several option to add broken package ( export NIXPKGS_ALLOW_BROKEN=1 ). But I don't understand exactly what will be the repercutions. I prefer not to follow this option

with cachix

I follow this tutorial

and add this line

echo "trusted-users = root myusername" | sudo tee -a /etc/nix/nix.conf && sudo pkill nix-daemon

normally after cachix use nix-linter there is a cache that nix-build use

But it doesn't work. I get an error saying that there is no default.nix in my repository

https://github.com/Synthetica9/nix-linter

cachix use nix-linter git clone https://github.com/Synthetica9/nix-linter cd nix-linter $(nix-build -A nix-linter)/bin/nix-linter --help

error: attribute 'nix-linter' in selection path 'nix-linter' not found -bash: /bin/nix-linter: No such file or directory


Solution

  • somebody from cacheix said that this package is no longer maintain and I should try statix.

    statix works