Using overrides with nix-env

I am trying to use nix to install vivaldi on a non-nixos system.

On nixos, I would just do this:

vivaldi.override { proprietaryCodecs = true; enableWidevine = true; }

Is there a way to do something similar with nix-env?

I tried putting this in ~/.config/nixpkgs/overlays.nix but it resulted in a syntax error so I am guessing I did it wrong. :woozy_face:

{
import pkgs.path { overlays = [ (self: super: {
  vivaldi = super.vivaldi.override { proprietaryCodecs = true; enableWidevine = true; };
  })]};
}

OK, well…I didn’t solve that mystery but I realized I could do this in confix.nix.

{
  allowUnfree = true;
  packageOverrides = pkgs: with pkgs; {
    nixList = pkgs.buildEnv {
      name = "nix-list";
      paths = [
        (vivaldi.override { proprietaryCodecs = true; enableWidevine = true; })
      ];
    };
  };
}

This actually seems better than what I was trying to do in the first place.

Isn’t overlays.nix supposed to return a list of overlays?

So shouldn’t it look like this:

[
  (self: super: {
    vivaldi = super.vivaldi.override {
      proprietaryCodecs = true;
      enableWidevine = true;
    };
  })
]
1 Like

Apparently it is. :sweat_smile:

That worked, thanks!

PS. I see you couldn’t handle the terrible formatting on my hastily assembled example :cowboy_hat_face: