[Overlays] Add global overlays configuration

This commit is contained in:
Antoine Viallon 2022-01-25 12:16:31 +01:00
parent 26d812779f
commit 08515ffd95
Signed by: aviallon
GPG key ID: 186FC35EDEB25716
2 changed files with 31 additions and 1 deletions

View file

@ -12,7 +12,7 @@
./hardening.nix
./hardware.nix
./laptop.nix
# ./overlays.nix
./overlays.nix
./non-persistence.nix
];
}

30
overlays.nix Normal file
View file

@ -0,0 +1,30 @@
{config, pkgs, options, lib, ...}:
with lib;
let
cfg = config.aviallon.overlays;
in
{
options.aviallon.overlays = {
enable = mkOption {
default = true;
type = types.bool;
};
};
config = mkIf cfg.enable {
nix.nixPath =
# Prepend default nixPath values.
options.nix.nixPath.default ++
# Append our nixpkgs-overlays.
[ "nixpkgs-overlays=/etc/nixos/overlays-compat/" ]
;
nixpkgs.overlays = [
# (self: super: {
# nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") {
# inherit pkgs;
# };
# })
];
};
}