Skip to content

Instantly share code, notes, and snippets.

@LnL7
Last active January 15, 2024 18:17
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save LnL7/570349866bb69467d0caf5cb175faa74 to your computer and use it in GitHub Desktop.
Save LnL7/570349866bb69467d0caf5cb175faa74 to your computer and use it in GitHub Desktop.
self: super:
{
# Install overlay:
# $ mkdir -p ~/.config/nixpkgs/overlays
# $ curl https://gist.githubusercontent.com/LnL7/570349866bb69467d0caf5cb175faa74/raw/3f3d53fe8e8713ee321ee894ecf76edbcb0b3711/lnl-overlay.nix -o ~/.config/nixpkgs/overlays/lnl.nix
userPackages = super.userPackages or {} // {
# Example:
hello = self.hello;
# add more packages here...
# Default packages:
# cacert = self.cacert;
# nix = self.nix; # don't enable this on multi-user.
nix-rebuild = super.writeScriptBin "nix-rebuild" ''
#!${super.stdenv.shell}
if ! command -v nix-env &>/dev/null; then
echo "warning: nix-env was not found in PATH, add nix to userPackages" >&2
PATH=${self.nix}/bin:$PATH
fi
exec nix-env -f '<nixpkgs>' -r -iA userPackages "$@"
'';
};
}
@Amir-Ahmad
Copy link

@lilyball It's working now! thanks for the explanation 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment