Add custom overlay

Fixes #20
pull/30/head
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, ... }:
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.sbruder = {
@ -81,6 +97,7 @@
nixPath = [
"/var/src" # pinned nixpkgs and configuration
"nixpkgs=/var/src/nixpkgs" # for nix run
"nixpkgs-overlays=${overlaysCompat}"
];
# Make sudoers trusted nix users
trustedUsers = [ "@wheel" ];
@ -103,8 +120,13 @@
packageOverrides = pkgs: {
unstable = import (import ../nix/sources.nix).nixpkgs-unstable {
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: { }