Skip to content

Instantly share code, notes, and snippets.

@QuantumGhost
Created August 12, 2021 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QuantumGhost/b737737c591d8704fd2475f6e2f5d036 to your computer and use it in GitHub Desktop.
Save QuantumGhost/b737737c591d8704fd2475f6e2f5d036 to your computer and use it in GitHub Desktop.
Nix tricks

Some tricks for managing packages with Nix

# 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
}
# 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