Some tricks for managing packages with Nix
Created
August 12, 2021 03:14
-
-
Save QuantumGhost/b737737c591d8704fd2475f6e2f5d036 to your computer and use it in GitHub Desktop.
Nix tricks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save this file to ~/.config/nixpkgs/config.nix to allow packages with Business Software License. | |
{ pkgs }: | |
with pkgs; | |
{ | |
allowlistedLicenses = with lib.licenses; [ bsl11 ]; | |
# You may also use allowUnfreePredicate to allow specified pacakges, check | |
# https://nixos.org/manual/nixpkgs/stable/#sec-allow-unfree | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use nix-env -irf packages.nix to install packages | |
let | |
priorityOverlay = self: super: { | |
linuxPackages = super.linuxPackages // { bcc = super.lowPrio super.linuxPackages.bcc; }; | |
}; | |
packageList = | |
pkgs: | |
with pkgs; | |
{ | |
inherit nix cacert curl; | |
bcc = linuxPackages.bcc; | |
bpftrace = linuxPackages.bpftrace; | |
}; | |
in | |
{}: packageList (import <nixpkgs> { overlays = [ priorityOverlay ]; }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment