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;
}

View file

@ -1,8 +1,13 @@
{
pkgs,
lib,
config,
...
}: {
}: let
grosshack = config.customPkgs.pam-fprint-grosshack;
grosshackSo = "${grosshack}/lib/security/pam_fprintd_grosshack.so";
gnomeSo = "${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so";
in {
services.fprintd.enable = true;
# https://www.reddit.com/r/NixOS/comments/z7i83r/fingertip_tip_start_fprintd_at_boot_for_a_quick/
@ -28,7 +33,7 @@
sudo.text = ''
# Account management.
auth sufficient ${pkgs.pam-fprint-grosshack}/lib/security/pam_fprintd_grosshack.so
auth sufficient ${grosshackSo}
auth sufficient pam_unix.so try_first_pass nullok
account required pam_unix.so
@ -48,15 +53,15 @@
account required pam_unix.so
# Authentication management.
auth sufficient ${pkgs.pam-fprint-grosshack}/lib/security/pam_fprintd_grosshack.so
auth sufficient ${grosshackSo}
auth optional pam_unix.so nullok likeauth
auth optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so
auth optional ${gnomeSo}
auth sufficient pam_unix.so try_first_pass nullok
auth required pam_deny.so
# Password management.
password sufficient pam_unix.so nullok yescrypt
password optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so use_authtok
password optional ${gnomeSo} use_authtok
# Session management.
session required pam_env.so conffile=/etc/pam/environment readenv=0
@ -64,7 +69,7 @@
session required pam_loginuid.so
session required ${pkgs.pam}/lib/security/pam_lastlog.so silent
session optional ${pkgs.systemd}/lib/security/pam_systemd.so
session optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start
session optional ${gnomeSo} auto_start
'';
polkit-1.text = ''
@ -72,7 +77,7 @@
account required pam_unix.so
# Authentication management.
auth sufficient ${pkgs.pam-fprint-grosshack}/lib/security/pam_fprintd_grosshack.so
auth sufficient ${grosshackSo}
auth sufficient pam_unix.so try_first_pass nullok
auth required pam_deny.so

View file

@ -8,7 +8,6 @@
...
}: let
# Nix utils
symlink = config.lib.file.mkOutOfStoreSymlink;
optionals = lib.lists.optionals;
# Config stuff
@ -26,11 +25,6 @@ in {
../wofi
];
xdg.configFile = with lib;
mkIf (pathExists confPath) {
"hypr/main.conf".source = symlink confPath;
};
wayland.windowManager.hyprland = {
enable = true;
package = hyprland.packages.x86_64-linux.default;
@ -182,11 +176,7 @@ in {
vfr = true;
};
source =
[]
++ optionals (lib.pathExists confPath) [
"~/.config/hypr/main.conf"
];
source = [confPath];
};
};

View file

@ -27,24 +27,24 @@ in {
extraPackages = [pkgs.libgudev];
};
home.packages = with pkgs;
[
home.packages =
[config.customPkgs.coloryou]
++ (with pkgs; [
# ags
sassc
coloryou
playerctl
## gui
pavucontrol # TODO: replace with ags widget
networkmanagerapplet # TODO: replace with ags widget
]
++ (optionals isTouchscreen [
])
++ (optionals isTouchscreen (with pkgs; [
# touchscreen
lisgd
squeekboard
ydotool
blueberry
]);
]));
})
];
}