Re:NixOS – Purely Functional Linux Distribution
by lilyball on Friday November 02, 2018 @08:26PM
(#18367865)
I haven't ever tried this myself, but I was under the impression that the `--arg` and `--argstr` arguments to nix-env were supposed to let you change build options. So could you not say `nix-env -iA nixpkgs.ffmpeg-full --arg nonfreeLicensing true --arg fdkaacExtlib true --arg ffplayProgram false --arg qtFaststartProgram false`?
Re:NixOS – Purely Functional Linux Distribution
by gmfawcett on Friday November 02, 2018 @08:41PM
(#18367935)
You may well be right. In my first attempts, I did try various combinations of `--arg` and `--argstr`, but I never succeeded in getting a proper build. That's why I ended up using the override approach instead. I understand a little bit more (very little!) about Nix now, so perhaps I should give it another try.
Re:NixOS – Purely Functional Linux Distribution
by kreetx on Friday November 02, 2018 @04:02PM
(#18366242)
You are ahead of me! Thank you for the example :)
Re:NixOS – Purely Functional Linux Distribution
by gmfawcett on Friday November 02, 2018 @04:23PM
(#18366400)
You're welcome!
One last tip... If you build this way, it will write everything to /nix/store, but it won't install it into your local profile. However, the 'nix-build' process creates a 'result' symlink in your project directory which points at the package you just built. So Calling 'nix-env -i ./result' ought to install it into your profile as well.
Re:NixOS – Purely Functional Linux Distribution
by Nullabillity on Friday November 02, 2018 @04:59PM
(#18366700)
You can also just call `nix-env -i .` to build and install in one go.
Re:NixOS – Purely Functional Linux Distribution
by gmfawcett on Friday November 02, 2018 @08:42PM
(#18367942)
Ah! thanks for that.
A simple example: I wanted to build FFMPEG, but with non-free libraries enabled (which is not the default). Rather than edit "ffmpeg-full" in the nixpkgs repo, I just overrode it: