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 nur.hmModules.nur
./home ./home
./pkgs
# Make the vars be the same on Nix and HM # Make the vars be the same on Nix and HM
./vars.nix ./vars.nix

View file

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

View file

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

View file

@ -1,12 +1,21 @@
{...}: let {lib, pkgs, ...}: let
mkPackage = name: (final: prev: { mkPackage = name: v: {
${name} = final.callPackage ./${name} {}; ${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 { in {
nixpkgs.overlays = [ imports = [{
(mkPackage "coloryou") options.customPkgs = lib.mkOption {
(mkPackage "input-emulator") type = lib.types.attrs;
(mkPackage "pam-fprint-grosshack") };
(mkPackage "spotifywm") }];
];
customPkgs = pkgSet;
} }

View file

@ -1,8 +1,13 @@
{ {
pkgs, pkgs,
lib, 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; services.fprintd.enable = true;
# https://www.reddit.com/r/NixOS/comments/z7i83r/fingertip_tip_start_fprintd_at_boot_for_a_quick/ # https://www.reddit.com/r/NixOS/comments/z7i83r/fingertip_tip_start_fprintd_at_boot_for_a_quick/
@ -28,7 +33,7 @@
sudo.text = '' sudo.text = ''
# Account management. # 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 auth sufficient pam_unix.so try_first_pass nullok
account required pam_unix.so account required pam_unix.so
@ -48,15 +53,15 @@
account required pam_unix.so account required pam_unix.so
# Authentication management. # 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 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 sufficient pam_unix.so try_first_pass nullok
auth required pam_deny.so auth required pam_deny.so
# Password management. # Password management.
password sufficient pam_unix.so nullok yescrypt 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 management.
session required pam_env.so conffile=/etc/pam/environment readenv=0 session required pam_env.so conffile=/etc/pam/environment readenv=0
@ -64,7 +69,7 @@
session required pam_loginuid.so session required pam_loginuid.so
session required ${pkgs.pam}/lib/security/pam_lastlog.so silent session required ${pkgs.pam}/lib/security/pam_lastlog.so silent
session optional ${pkgs.systemd}/lib/security/pam_systemd.so 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 = '' polkit-1.text = ''
@ -72,7 +77,7 @@
account required pam_unix.so account required pam_unix.so
# Authentication management. # 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 sufficient pam_unix.so try_first_pass nullok
auth required pam_deny.so auth required pam_deny.so

View file

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

View file

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