Add custom overlay

Fixes #20
This commit is contained in:
Simon Bruder 2021-01-07 17:07:28 +01:00
parent a44f1fd1ac
commit 37c54887b9
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 24 additions and 1 deletions

View file

@ -1,5 +1,21 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
# Taken from https://nixos.wiki/wiki/Overlays
overlaysCompat = pkgs.writeTextFile {
name = "overlays-compat";
destination = "/overlays.nix";
text = ''
self: super:
with super.lib;
let
# Load the system config and get the `nixpkgs.overlays` option
overlays = (import <nixpkgs/nixos> { }).config.nixpkgs.overlays;
in
# Apply all overlays to the input of the current "main" overlay
foldl' (flip extends) (_: super) overlays self
'';
};
in
{ {
# Options that affect multiple modules # Options that affect multiple modules
options.sbruder = { options.sbruder = {
@ -81,6 +97,7 @@
nixPath = [ nixPath = [
"/var/src" # pinned nixpkgs and configuration "/var/src" # pinned nixpkgs and configuration
"nixpkgs=/var/src/nixpkgs" # for nix run "nixpkgs=/var/src/nixpkgs" # for nix run
"nixpkgs-overlays=${overlaysCompat}"
]; ];
# Make sudoers trusted nix users # Make sudoers trusted nix users
trustedUsers = [ "@wheel" ]; trustedUsers = [ "@wheel" ];
@ -103,8 +120,13 @@
packageOverrides = pkgs: { packageOverrides = pkgs: {
unstable = import (import ../nix/sources.nix).nixpkgs-unstable { unstable = import (import ../nix/sources.nix).nixpkgs-unstable {
config = config.nixpkgs.config; config = config.nixpkgs.config;
overlays = config.nixpkgs.overlays;
}; };
}; };
}; };
nixpkgs.overlays = [
(import ../pkgs)
];
}; };
} }

1
pkgs/default.nix Normal file
View file

@ -0,0 +1 @@
self: super: { }