Skip to content

Instantly share code, notes, and snippets.

@lheckemann
Created November 16, 2021 20:22
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 lheckemann/f531d738966908850cfa22c311409c62 to your computer and use it in GitHub Desktop.
Save lheckemann/f531d738966908850cfa22c311409c62 to your computer and use it in GitHub Desktop.
{ config, pkgs, lib, ... }: {
options.copy-nixpkgs = lib.mkEnableOption "copying the nixpkgs used to build the system to it, and placing it in NIX_PATH";
config = lib.mkIf config.copy-nixpkgs {
nix.nixPath = ["nixpkgs=/var/lib/nixpkgs"];
systemd.tmpfiles.rules = ["L+ /var/lib/nixpkgs - - - - ${pkgs.path}"];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment