What do I need to do to fix this
Being painfully new to nixos, I am not sure how to resolve this error. I searched the forums, but didn't find what I need to get beyond this... i didn't post because I didn't want to create an account just now (its 3am)
I am trying to install a piece of software but get this error:
nix --extra-experimental-features nix-command run github:nix-gui/nix-gui --extra-experimental-features flakes
error: attribute 'defaultApp.x86_64-linux' should have type 'derivation'
Additionally, how to I make permanent the following switches
--extra-experimental-features nix-command
--extra-experimental-features flakes
(any other options you know I will need)
edit: minor edit
Posted Sep 1, 2022, 9:56 AM UTC · edited
Error message tells you that it can only run derivations, and
defaultApp.x86_64-linuxis not one, you can run outputs of a flake(typically derivations) by specifying path with#something.somethingappended to the flake url/path, so in your case$ nix run github:nix-gui/nix-gui#nix-gui. You can check what outputs does flake provide here. Showing outputs without locating the file itself is done with$ nix flake show github:nix-gui/nix-gui(nix does some magic here when choosing what output to run and you should omit things like cpu architecture)Second issue is fixed with putting
nix.settings.experimental-features = [ "nix-command" "flakes" ];in yourconfiguration.nixfile(https://nixos.wiki/wiki/Flakes#NixOS)Generally in the era of flakes it is good idea to read https://nixos.wiki/wiki/Flakes, the whole page.
Also some notes:
textand block```
code
code
```
is
Edit: Fixed wrong example of enabling flakes
Edit 2: verified
$ nix run nix run github:nix-gui/nix-gui#nix-guiworking. However now it spits this text, guess its wayland issue[deleted]
[deleted]
Note that triple backticks are a "new reddit" thing (it's in CommonMark, but Reddit didn't initially use CommonMark and still doesn't support all features) and several mobile clients can't render them. Indenting code by 4 spaces is the backwards-compatible way.