local.packages convenience option

This commit is contained in:
Gerg-L 2025-01-13 13:23:44 -05:00
parent 4ecebe8210
commit 99f42f5841
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
5 changed files with 109 additions and 106 deletions

View file

@ -25,6 +25,37 @@
"steam-unwrapped" "steam-unwrapped"
"steam-run" "steam-run"
]; ];
packages = {
inherit (pkgs)
bitwarden-desktop # store stuff
qbittorrent # steal stuff
pavucontrol # gui volume control
pcmanfm # file manager
vlc # play stuff
ripgrep
fd
jq
wget
xautoclick
prismlauncher
deadnix
statix
#element-desktop
vesktop
gh
nixfmt-rfc-style
prusa-slicer # 3D printer slicer
# QMK configuration
#via
#qmk
;
inherit (nvim-flake.packages) neovim;
inherit (self'.packages) lint;
librewolf = pkgs.librewolf.override { cfg.speechSynthesisSupport = false; };
nixpkgs-review = pkgs.nixpkgs-review.override { nix = config.nix.package; };
};
}; };
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
@ -88,42 +119,9 @@
}; };
sops.secrets.github_token = { }; sops.secrets.github_token = { };
environment = { environment.etc = {
systemPackages = builtins.attrValues { "jdks/17".source = "${pkgs.openjdk17}/bin";
inherit (pkgs) "jdks/8".source = "${pkgs.openjdk8}/bin";
bitwarden-desktop # store stuff
qbittorrent # steal stuff
pavucontrol # gui volume control
pcmanfm # file manager
vlc # play stuff
ripgrep
fd
jq
wget
xautoclick
prismlauncher
deadnix
statix
#element-desktop
vesktop
gh
nixfmt-rfc-style
prusa-slicer # 3D printer slicer
# QMK configuration
#via
#qmk
;
inherit (nvim-flake.packages) neovim;
inherit (self'.packages) lint;
librewolf = pkgs.librewolf.override { cfg.speechSynthesisSupport = false; };
nixpkgs-review = pkgs.nixpkgs-review.override { nix = config.nix.package; };
};
etc = {
"jdks/17".source = "${pkgs.openjdk17}/bin";
"jdks/8".source = "${pkgs.openjdk8}/bin";
};
}; };
services.udev.packages = [ services.udev.packages = [

View file

@ -17,16 +17,16 @@
enable = true; enable = true;
kmscon.enable = true; kmscon.enable = true;
}; };
packages = {
inherit (pkgs)
vlc
pavucontrol # gui volume control
chromium
;
inherit (nvim-flake.packages) neovim;
};
}; };
environment.systemPackages = builtins.attrValues {
inherit (pkgs)
vlc
pavucontrol # gui volume control
chromium
;
inherit (nvim-flake.packages) neovim;
};
services.xserver.videoDrivers = [ "modesetting" ]; services.xserver.videoDrivers = [ "modesetting" ];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;

View file

@ -9,6 +9,31 @@
options.local.DE.dwm.enable = lib.mkEnableOption ""; options.local.DE.dwm.enable = lib.mkEnableOption "";
config = lib.mkIf config.local.DE.dwm.enable { config = lib.mkIf config.local.DE.dwm.enable {
local.packages = {
inherit (suckless.packages) dmenu dwm st;
inherit (pkgs)
maim
playerctl
xclip
feh
numlockx
picom
sxhkd
xscreensaver
;
xsecurelock = pkgs.writeShellScriptBin "xsecurelock" ''
export XSECURELOCK_BLANK_TIMEOUT="30"
export XSECURELOCK_AUTH_TIMEOUT="30"
export XSECURELOCK_BLANK_DPMS_STATE="off"
export XSECURELOCK_BACKGROUND_COLOR="#000000"
export XSECURELOCK_AUTH_BACKGROUND_COLOR="#080808"
export XSECURELOCK_AUTH_FOREGROUND_COLOR="#bdbdbd"
export XSECURELOCK_FONT="Overpass"
export XSECURELOCK_SHOW_DATETIME="1"
${lib.getExe pkgs.xsecurelock}
'';
};
systemd.user.services = { systemd.user.services = {
sxhkd = { sxhkd = {
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
@ -67,64 +92,36 @@
]; ];
}; };
}; };
environment = {
systemPackages = builtins.attrValues {
inherit (suckless.packages) dmenu dwm st;
inherit (pkgs)
maim
playerctl
xclip
feh
numlockx
picom
sxhkd
xscreensaver
;
xsecurelock = pkgs.writeShellScriptBin "xsecurelock" '' environment.etc."sxhkd/sxhkdrc".text = ''
export XSECURELOCK_BLANK_TIMEOUT="30" XF86AudioPlay
export XSECURELOCK_AUTH_TIMEOUT="30" playerctl play-pause
export XSECURELOCK_BLANK_DPMS_STATE="off" XF86AudioPause
export XSECURELOCK_BACKGROUND_COLOR="#000000" playerctl play-pause
export XSECURELOCK_AUTH_BACKGROUND_COLOR="#080808" XF86AudioStop
export XSECURELOCK_AUTH_FOREGROUND_COLOR="#bdbdbd" playerctl stop
export XSECURELOCK_FONT="Overpass" XF86AudioNext
export XSECURELOCK_SHOW_DATETIME="1" playerctl next
${lib.getExe pkgs.xsecurelock} XF86AudioPrev
''; playerctl previous
}; XF86AudioRaiseVolume
etc = { wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+
"sxhkd/sxhkdrc".text = '' XF86AudioLowerVolume
XF86AudioPlay wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-
playerctl play-pause XF86AudioMute
XF86AudioPause wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
playerctl play-pause Print
XF86AudioStop maim $HOME/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
playerctl stop Print + shift
XF86AudioNext maim | xclip -selection clipboard -t image/png
playerctl next super + Print
XF86AudioPrev maim -s $HOME/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
playerctl previous super + Print + shift
XF86AudioRaiseVolume maim -s | xclip -selection clipboard -t image/png
wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ super + ctrl + r
XF86AudioLowerVolume pkill -usr1 -x sxhkd
wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- super + ctrl + l
XF86AudioMute xsecurelock
wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle '';
Print
maim $HOME/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
Print + shift
maim | xclip -selection clipboard -t image/png
super + Print
maim -s $HOME/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg
super + Print + shift
maim -s | xclip -selection clipboard -t image/png
super + ctrl + r
pkill -usr1 -x sxhkd
super + ctrl + l
xsecurelock
'';
};
};
}; };
} }

8
modules/packages.nix Normal file
View file

@ -0,0 +1,8 @@
{ lib, config }:
{
options.local.packages = lib.mkOption {
type = lib.types.attrsOf lib.types.package;
default = { };
};
config.environment.systemPackages = builtins.attrValues config.local.packages;
}

View file

@ -3,11 +3,11 @@
pkgs, pkgs,
}: }:
{ {
local.packages = {
inherit (pkgs) eza fzf;
inherit (fetch-rs.packages) fetch-rs;
};
environment = { environment = {
systemPackages = builtins.attrValues {
inherit (pkgs) eza fzf;
inherit (fetch-rs.packages) fetch-rs;
};
variables = { variables = {
EDITOR = "nvim"; EDITOR = "nvim";
VISUAL = "nvim"; VISUAL = "nvim";