feat: separate custom pkgs from nixpkgs

This commit is contained in:
matt1432 2023-12-01 16:53:51 -05:00
parent 66e3a03d7d
commit 384fe2a6e1
8 changed files with 43 additions and 34 deletions

View file

@ -64,6 +64,7 @@
nur.hmModules.nur
./home
./pkgs
# Make the vars be the same on Nix and HM
./vars.nix

View file

@ -10,6 +10,7 @@
nixpkgs.overlays = [
(import ./blueberry)
(import ./spotifywm)
(import ./squeekboard)
neovim-flake.overlay

View file

@ -0,0 +1,3 @@
(final: prev: {
spotifywm = final.callPackage ./spotifywm.nix {};
})

View file

@ -1,12 +1,21 @@
{...}: let
mkPackage = name: (final: prev: {
${name} = final.callPackage ./${name} {};
});
{lib, pkgs, ...}: let
mkPackage = name: v: {
${name} = pkgs.callPackage ./${name} {};
};
rmNotPackage = name: value:
value == "directory" &&
builtins.pathExists ./${name}/default.nix;
packages = lib.attrsets.filterAttrs rmNotPackage (builtins.readDir ./.);
pkgSet = lib.attrsets.concatMapAttrs mkPackage packages;
in {
nixpkgs.overlays = [
(mkPackage "coloryou")
(mkPackage "input-emulator")
(mkPackage "pam-fprint-grosshack")
(mkPackage "spotifywm")
];
imports = [{
options.customPkgs = lib.mkOption {
type = lib.types.attrs;
};
}];
customPkgs = pkgSet;
}