How to install/build from a deb package?

I am looking to install a few bleeding edge packages which are only available in deb/RPM format.
Specifically vscode and google-chrome.
When rebuilding Chrome with custom command line flags (override), I could see that it is downloading .deb Chrome package in the backend.

So is it possible to install these from a deb package as a nix user?

There are ways to install programs from .deb packages, but those involve some patching of the binaries. Given the complexity of VSCode and Chrome that would be a lot of patching and fiddling and pain.

You can get nightlies of Chrome with this flake: GitHub - r-k-b/browser-previews: Up-to-date versions of google-chrome-dev and google-chrome-beta for Nix users.
For VSCode it might be possible to create a similar flake.

If you cannot spend the computing power for building these and want to rely on the debs/rpms you should look into DistroBox or Lima

1 Like

How do I add this flake to my configuration?

I am getting this error. Can you atleast tell me where I did wrong?


       … while calling the 'head' builtin

         at /nix/store/ik0xl0cl3gl04dpc1jjk0p2wh838dg71-source/lib/attrsets.nix:922:11:

          921|         || pred here (elemAt values 1) (head values) then
          922|           head values
             |           ^
          923|         else

       … while evaluating the attribute 'value'

         at /nix/store/ik0xl0cl3gl04dpc1jjk0p2wh838dg71-source/lib/modules.nix:807:9:

          806|     in warnDeprecation opt //
          807|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          808|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: getting status of '/nix/store/z21bsaf59ndpp0xgl0yl5gc6yl6jv4p4-source/default.nix': No such file or directory

@r-k-b please assist if possible.

I’m not sure about importing the flake input… here’s how I’m using the browserPreviews flake:

I also haven’t set the allowUnfree stuff in code, so I have to set the NIXPKGS_ALLOW_UNFREE env var, and use the --impure flag on commands like nixos-rebuild switch.