Hi, being a total NixOS noob, I have no idea where or how to put in this snippet mentioned in here in my /etc/nixos/configuration.nix.
I put it like so
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
(vscode.override { isInsiders = true; }).overrideAttrs (oldAttrs: rec {
src = (builtins.fetchTarball {
url = "https://code.visualstudio.com/sha/download?build=insider&os=linux-x64";
sha256 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
});
version = "latest";
buildInputs = oldAttrs.buildInputs ++ [ pkgs.krb5 ];
})
uhk-udev-rules
emacs
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
aria
ripgrep
...
but only got this
building Nix...
building the system configuration...
error: A definition for option `environment.systemPackages."[definition 1-entry 1]"' is not of type `package'. Definition values:
- In `/etc/nixos/configuration.nix': <function>
(use '--show-trace' to show detailed location information)
And the trace was way too long to be useful, and wasn’t anywhere my Nix code at all.
Mhhm, doesn’t look wrong to me. It will probably tell you that the given sha256 "AAAAA..." doesn’t match the actual sha of the downloaded tarball, and you will have to replace "AAAA..." with the correct sha256 (it should tell you what the sha of the tarball actually was).
Apart from that, maybe try wrapping () around the whole expression?
Ah yeah, judging from the error message that should be it: It detects the first definition as a function, probably overrideAttrs, and detects the following argument list (oldAttrs: ... as an individual package. But that is not what you meant, you want both of them evaluated together, so the brackets around everything should help
Which makes it look a bit cleaner, by pulling the definition out into its own let-binding
I just put the comments in there for clarity, I like keeping those notes around in my config, really a cool part of declaring your system through code: You can add comments
Thanks! The second one I can understand better - but I moved back to Manjaro because I needed things to work asap. Going to try out Nix slowly just for individual projects this time.