chore: stuff

This commit is contained in:
Nydragon 2024-12-15 15:39:25 +01:00
parent 6a53741183
commit 2defd19b2d
Signed by: nydragon
SSH key fingerprint: SHA256:WcjW5NJPQ8Dx4uQDmoIlVPLWE27Od3fxoe0IUvuoPHE
8 changed files with 267 additions and 264 deletions

View file

@ -1,25 +0,0 @@
{
pkgs,
lib,
osConfig,
...
}:
let
cfg = osConfig.modules.services.cliphist;
exec = pkgs.writers.writeBash "rofi-cliphist" {
makeWrapperArgs = [
"--prefix"
"PATH"
":"
"${lib.makeBinPath [ pkgs.cliphist ]}"
];
} "cliphist-rofi-img";
in
{
config = lib.mkIf cfg.enable {
programs.rofi = {
enable = true;
extraConfig.modes = [ "clipboard:${exec}" ];
};
};
}

View file

@ -7,7 +7,6 @@
./gammastep.nix # default because I need to protect my peepers ./gammastep.nix # default because I need to protect my peepers
./swww.nix ./swww.nix
./keepassxc.nix ./keepassxc.nix
./cliphist.nix
./swayidle.nix ./swayidle.nix
./swaylock.nix ./swaylock.nix
]; ];

View file

@ -21,8 +21,8 @@
} -t wipe --transition-fps 144"; } -t wipe --transition-fps 144";
Restart = "on-failure"; Restart = "on-failure";
ProtectHome = "readonly";
BindPaths = "/run/user /home/${config.home.username}/.cache/swww"; BindPaths = "/run/user /home/${config.home.username}/.cache/swww";
TemporaryFileSystem = "/home /run/user /root";
ProtectProc = "noaccess"; ProtectProc = "noaccess";
RestrictNamespaces = true; RestrictNamespaces = true;
CapabilityBoundingSet = ""; CapabilityBoundingSet = "";

View file

@ -5,14 +5,12 @@
osConfig, osConfig,
... ...
}: }:
lib.mkIf config.programs.rofi.enable {
programs.rofi =
let let
conf = "${config.home.homeDirectory}/.config/rofi"; conf = "${config.home.homeDirectory}/.config/rofi";
in in
rec { lib.mkIf config.programs.rofi.enable {
package = pkgs.rofi-wayland.override { inherit plugins; }; programs.rofi = {
plugins = [ pkgs.rofi-calc ]; package = pkgs.rofi-wayland;
theme = "${conf}/themes/rounded-gray-dark.rasi"; theme = "${conf}/themes/rounded-gray-dark.rasi";
terminal = lib.my.getExe osConfig.modules.system.roles.desktop.terminal; terminal = lib.my.getExe osConfig.modules.system.roles.desktop.terminal;
extraConfig = { extraConfig = {
@ -22,8 +20,6 @@ lib.mkIf config.programs.rofi.enable {
"ssh" "ssh"
"drun" "drun"
"run" "run"
# WARNING: ABI version mismatch
# "calc"
"clipboard:${lib.my.getExe' pkgs.cliphist "cliphist-rofi-img"}" "clipboard:${lib.my.getExe' pkgs.cliphist "cliphist-rofi-img"}"
]; ];
matching = "fuzzy"; matching = "fuzzy";

View file

@ -7,22 +7,19 @@
... ...
}: }:
let let
inherit (lib) mapAttrs; inherit (lib) mapAttrs mkIf;
inherit (lib.my) getExe getExe';
desktop = osConfig.modules.system.roles.desktop; desktop = osConfig.modules.system.roles.desktop;
term = lib.my.getExe desktop.terminal; term = lib.my.getExe desktop.terminal;
filemanager = lib.my.getExe desktop.filemanager; filemanager = lib.my.getExe desktop.filemanager;
in cliphistEnabled = osConfig.modules.services.cliphist.enable;
lib.mkIf osConfig.programs.sway.enable {
services.swayidle.enable = true;
programs.hyprlock.enable = true;
wayland.windowManager.sway =
let
colors = { colors = {
lavender = "#babbf1"; lavender = "#babbf1";
black = "#000000"; black = "#000000";
}; };
inputs = { inputs = {
kb = { kb = {
builtin = "1:1:AT_Translated_Set_2_keyboard"; builtin = "1:1:AT_Translated_Set_2_keyboard";
@ -30,9 +27,14 @@ lib.mkIf osConfig.programs.sway.enable {
keychron_bt = "1452:591:Keychron_K4"; keychron_bt = "1452:591:Keychron_K4";
}; };
}; };
mkRegexList = list: "^(${(lib.strings.concatStringsSep "|" list)})$"; mkRegexList = list: "^(${(lib.strings.concatStringsSep "|" list)})$";
in in
{ lib.mkIf osConfig.programs.sway.enable {
services.swayidle.enable = true;
programs.hyprlock.enable = true;
wayland.windowManager.sway = {
enable = true; enable = true;
xwayland = true; xwayland = true;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
@ -71,7 +73,13 @@ lib.mkIf osConfig.programs.sway.enable {
"${mod}+f" = "fullscreen"; "${mod}+f" = "fullscreen";
# Start launcher # Start launcher
"${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel"; "${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel";
"${mod}+s" = "exec rofi -show clipboard -show-icons"; "${mod}+s" =
let
cliphist = getExe pkgs.cliphist;
fuzzel = getExe pkgs.fuzzel;
copy = getExe' pkgs.wl-clipboard "wl-copy";
in
mkIf cliphistEnabled "exec ${cliphist} list | ${fuzzel} --dmenu | ${cliphist} decode | ${copy}";
# Toggle the current focus between tiling and floating mode # Toggle the current focus between tiling and floating mode
"${mod}+Shift+space" = "floating toggle"; "${mod}+Shift+space" = "floating toggle";
"${mod}+Return" = "exec ${term}"; "${mod}+Return" = "exec ${term}";
@ -80,23 +88,20 @@ lib.mkIf osConfig.programs.sway.enable {
"${mod}+Control+Left" = "workspace prev"; "${mod}+Control+Left" = "workspace prev";
"${mod}+Control+Right" = "workspace next"; "${mod}+Control+Right" = "workspace next";
"${mod}+n" = "exec nysh msg dash toggle"; "${mod}+n" = "exec nysh msg dash toggle";
"--locked XF86MonBrightnessUp" = "--locked XF86MonBrightnessUp" = "exec --no-startup-id ${getExe pkgs.brightnessctl} s +10%";
"exec --no-startup-id ${pkgs.brightnessctl}/bin/brightnessctl s +10%"; "--locked XF86MonBrightnessDown" = "exec --no-startup-id ${getExe pkgs.brightnessctl} s 10%-";
"--locked XF86MonBrightnessDown" = "--locked XF86AudioRaiseVolume" = "exec --no-startup-id ${getExe pkgs.pamixer} -i 5";
"exec --no-startup-id ${pkgs.brightnessctl}/bin/brightnessctl s 10%-"; "--locked XF86AudioLowerVolume" = "exec --no-startup-id ${getExe pkgs.pamixer} -d 5";
"--locked XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5"; "--locked XF86AudioMicMute" = "exec --no-startup-id ${getExe pkgs.pamixer} --default-source -m";
"--locked XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5";
"--locked XF86AudioMicMute" =
"exec --no-startup-id ${pkgs.pamixer}/bin/pamixer --default-source -m";
"--locked XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t"; "--locked XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t";
"--locked XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "--locked XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"--locked XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "--locked XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"--locked XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; "--locked XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; "--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"${mod}+u" = "${mod}+u" =
"exec ${pkgs.hyprshot}/bin/hyprshot -o ${config.xdg.userDirs.pictures}/screenshots -m region"; "exec ${getExe pkgs.hyprshot} -o ${config.xdg.userDirs.pictures}/screenshots -m region";
"${mod}+Shift+u" = "${mod}+Shift+u" =
"exec ${pkgs.hyprshot}/bin/hyprshot --raw -m region | ${pkgs.satty}/bin/satty -f - --fullscreen"; "exec ${getExe pkgs.hyprshot} --raw -m region | ${getExe pkgs.satty} -f - --fullscreen";
#: Workspace movement {{{ #: Workspace movement {{{
"--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1"; "--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1";

View file

@ -15,6 +15,7 @@
modules = { modules = {
media.enableAll = true; media.enableAll = true;
fs.nfsEnable = true;
system = { system = {
roles.desktop.enable = true; roles.desktop.enable = true;
@ -179,6 +180,10 @@
xdg-utils xdg-utils
brightnessctl brightnessctl
pop-icon-theme pop-icon-theme
bottles
wine64
ghidra
]; ];
system.stateVersion = "24.11"; system.stateVersion = "24.11";

View file

@ -1,6 +1,7 @@
{ {
imports = [ imports = [
./media.nix ./media.nix
./fs.nix
./services ./services
./system ./system

22
options/fs.nix Normal file
View file

@ -0,0 +1,22 @@
{
config,
pkgs,
lib,
...
}:
let
inherit (lib) mkIf mkEnableOption optional;
cfg = config.modules.fs;
in
{
options.modules.fs = {
nfsEnable = mkEnableOption "nfs";
};
config = {
services.rpcbind.enable = mkIf cfg.nfsEnable true;
environment.systemPackages = optional cfg.nfsEnable pkgs.nfs-utils;
};
}