From 37c54887b99a525d72a1f49a2406d52484b5fe75 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Thu, 7 Jan 2021 17:07:28 +0100 Subject: [PATCH] Add custom overlay Fixes #20 --- modules/default.nix | 24 +++++++++++++++++++++++- pkgs/default.nix | 1 + 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 pkgs/default.nix diff --git a/modules/default.nix b/modules/default.nix index b9db496..f7977d3 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -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 { }).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) + ]; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..ddb4f23 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1 @@ +self: super: { }