From 219975f9ccfe0e44fec7fa876eff677507a4511e Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Sun, 2 Aug 2020 21:26:00 -0600 Subject: [PATCH] packages: export overlays as packages --- flake.nix | 13 +++++++++++-- overlays/qute.nix | 6 ------ overlays/{retroarch.nix => retroarchBare.nix} | 0 profiles/graphical/qutebrowser/default.nix | 9 +++++++++ 4 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 overlays/qute.nix rename overlays/{retroarch.nix => retroarchBare.nix} (100%) diff --git a/flake.nix b/flake.nix index e46eba6..6bf6cdc 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ let inherit (builtins) attrNames attrValues readDir; inherit (nixos) lib; - inherit (lib) removeSuffix recursiveUpdate; + inherit (lib) removeSuffix recursiveUpdate genAttrs filterAttrs; inherit (utils) pathsToImportedAttrs; utils = import ./lib/utils.nix { inherit lib; }; @@ -54,7 +54,16 @@ in pathsToImportedAttrs overlayPaths; - packages."${system}" = (self.overlay osPkgs osPkgs); + packages."${system}" = + let + packages = self.overlay osPkgs osPkgs; + overlays = lib.filterAttrs (n: v: n != "pkgs") self.overlays; + overlayPkgs = + genAttrs + (attrNames overlays) + (name: (overlays."${name}" osPkgs osPkgs)."${name}"); + in + recursiveUpdate packages overlayPkgs; nixosModules = let diff --git a/overlays/qute.nix b/overlays/qute.nix deleted file mode 100644 index d85cabc..0000000 --- a/overlays/qute.nix +++ /dev/null @@ -1,6 +0,0 @@ -final: prev: { - # wrapper to specify config file - qute = prev.writeShellScriptBin "qute" '' - QT_QPA_PLATFORMTHEME= exec ${prev.qutebrowser}/bin/qutebrowser -C /etc/xdg/qutebrowser/config.py "$@" - ''; -} diff --git a/overlays/retroarch.nix b/overlays/retroarchBare.nix similarity index 100% rename from overlays/retroarch.nix rename to overlays/retroarchBare.nix diff --git a/profiles/graphical/qutebrowser/default.nix b/profiles/graphical/qutebrowser/default.nix index c6ec9d4..33baa4d 100644 --- a/profiles/graphical/qutebrowser/default.nix +++ b/profiles/graphical/qutebrowser/default.nix @@ -19,4 +19,13 @@ in systemPackages = with pkgs; [ qute qutebrowser mpv youtubeDL ]; }; + + nixpkgs.overlays = [ + (final: prev: { + # wrapper to specify config file + qute = prev.writeShellScriptBin "qute" '' + QT_QPA_PLATFORMTHEME= exec ${prev.qutebrowser}/bin/qutebrowser -C /etc/xdg/qutebrowser/config.py "$@" + ''; + }) + ]; }