How to instsall nix-linter - nix

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

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

Related

nixos installation issue,'command not found: nix'

I deleted /nix and started a fresh install of nix, however after installing nix install nix (MACBook Pro M1 arm64 BigSur) with sh <(curl -L https://nixos.org/nix/install) I run $ nix but I get the output zsh: command not found: nix , same for nix-shellalso the /nix volume is not created, I also tried the instruction at https://docs.plutus-community.com/docs/setup/MacOS.html still same issue
Open /etc/zshrc and look for the following lines (probably at the end of the file):
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
Copy these lines and delete them from this file.
Open ~/.zshrc and add the above copied lines to the end of this file
Reboot terminal and nix should work now.

Build HDFView 3.1 on ubuntu-20.04

I have downloaded the deb file from the https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.1.2/bin/ link and install it via
sudo dpkg -i hdfview_3.1.2-1_amd64.deb
I didn't see any error during installation.
But hdfview didn't open.
I am using java-1.11.0-openjdk and hdf5-1.10.
How to solve this problem?
I found a way to solve this. The program gets installed in /opt/hdfview. However, starting it causes the error
$ ./bin/HDFView
Error: dl failure on line 534
Error: failed /opt/hdfview/lib/runtime/lib/server/libjvm.so, because /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /opt/hdfview/lib/runtime/lib/server/libjvm.so)
Failed to launch JVM
We can fix this by patching the libjvm.so file:
Install java-15 if it is not present already:
sudo apt install openjdk-15-jre
Find the libjvm.so file:
cd /usr/lib
find . -name libjvm.so
In my case, the correct version is located in /usr/lib/jvm/java-15-openjdk-amd64/lib/server/libjvm.so
Replace the libjvm.so in hdfview with a symlink to this libjvm.so
cd /opt/hdfview/lib/runtime/lib/server
sudo mv libjvm.so libjvm.so.bak
sudo ln -s /usr/lib/jvm/java-15-openjdk-amd64/lib/server/libjvm.so libjvm.so
(optional) link the hdfview binary, so that it is found in the terminal
sudo ln -s /opt/hdfview/bin/HDFView /usr/local/bin/hdfview
Afterwards, you should be able to start hdfview both from the terminal and the icon.

Cardano-node nix-build error: attribute 'ff' in selection path 'scripts.ff.node' not found

Using the recommended nix build method from this guide for a cardano-node from scratch (on Debian or Ubuntu latest) running this command:
$ nix-build -A scripts.ff.node -o ff-node-local
I get the following error:
error: attribute 'ff' in selection path 'scripts.ff.node' not found
To get past that error, try using a more updated guide here, and run the following nix-build command instead:
nix-build -A scripts.mainnet.node -o mainnet-node-local

Nix and Haskell-ng install error : attribute ‘nixpkgs’ in selection path ‘nixpkgs.haskellEnv’ not found

I am following this guide to set up nix and haskell-ng. But when I get to the step
nix-env -iA nixpkgs.haskellEnv
then I get the error:
error: attribute ‘nixpkgs’ in selection path ‘nixpkgs.haskellEnv’ not
found
Any idea what is going wrong?
The command nix-env -f "<nixpkgs>" -iA haskellEnv should work.
Citing from http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure:
Attribute paths are deterministic inside of Nixpkgs, but the path necessary to
reach Nixpkgs varies from system to system. We dodged that problem by giving
nix-env an explicit -f "<nixpkgs>" parameter, but if you call nix-env
without that flag, then chances are the invocation fails:
$ nix-env -iA haskellPackages.cabal-install
error: attribute ‘haskellPackages’ in selection path
‘haskellPackages.cabal-install’ not found
On NixOS, for example, Nixpkgs does not exist in the top-level namespace by
default. To figure out the proper attribute path, it's easiest to query for the
path of a well-known Nixpkgs package, i.e.:
$ nix-env -qaP coreutils
nixos.coreutils coreutils-8.23
If your system responds like that (most NixOS installations will), then the
attribute path to haskellPackages is nixos.haskellPackages. Thus, if you
want to use nix-env without giving an explicit -f flag, then that's the way
to do it:
$ nix-env -qaP -A nixos.haskellPackages
$ nix-env -iA nixos.haskellPackages.cabal-install

Makefile error: "install 'filename' was not found anywhere!"

I am attempting to make a project and have run into this error when trying to issue an install command on a handful of executables. Looks something like this:
(in highest level dir:)
DIRS = \
dir1 \
dir2 \
... \
lastDir \
all clean release:
for x in $(DIRS); do cd $$x; make $#; cd ..; done
Then in dir1, for example:
all: $(PROG)
install $(PROG) ../../bin
and the same for each directory. Log looks like this:
[exec] install my_prog_name ../../bin
[exec] install: my_prog_name was not found anywhere!
[exec] make[1]: Leaving dir1
Neither makefile (in upper or lower directory) has been changed since the last successful build, same with the build file (using ant).
Kind of looks like either a pathing issue or a permissions issue. Permissions on destination directory are 777, though. Issuing the install command manually in dir1 works fine...
Thanks for the help!
Are you running this on Solaris? It seems the Solaris version of the install command is prone to generate this error.
I'm not sure what the root cause is, but you could try using /usr/ucb/install, plain cp or the GNU ginstall.

Resources