From a589e07a6c23a34c180e7697f50c097aad3f7e25 Mon Sep 17 00:00:00 2001 From: Jimbo Date: Fri, 6 Dec 2024 04:03:03 -0500 Subject: [PATCH] Define imv keys, switch to btop, put stateful data in per-system config --- hosts/tower/default.nix | 2 + hosts/tower/users/default.nix | 4 ++ hosts/tower/users/jimbo/default.nix | 1 + modules/home/default.nix | 2 + modules/home/files/default.nix | 3 -- modules/home/programs/gui/default.nix | 1 + modules/home/programs/gui/imv/default.nix | 12 ++++++ .../home/programs/misc/avtools/default.nix | 1 + .../misc/gaming/emulators/default.nix | 2 +- .../programs/misc/gaming/games/default.nix | 5 +-- .../home/programs/misc/general/default.nix | 2 - .../home/programs/misc/headless/default.nix | 1 - .../home/programs/terminal/btop/default.nix | 11 ++++++ modules/home/programs/terminal/default.nix | 1 + modules/home/settings/cursor/default.nix | 9 +++++ modules/home/settings/default.nix | 2 +- .../home/settings/gtk/bookmarks/default.nix | 11 ++++++ modules/home/settings/gtk/css/default.nix | 20 ++++++++++ modules/home/settings/gtk/default.nix | 36 +++-------------- modules/home/settings/nix/default.nix | 5 --- modules/home/wms/niri/hotkeys/default.nix | 7 +++- modules/home/wms/sway/autostart/default.nix | 2 +- modules/home/wms/sway/hotkeys/default.nix | 2 +- modules/home/wms/sway/rules/default.nix | 22 +++++------ modules/system/default.nix | 2 - modules/system/services/general/default.nix | 2 +- .../general/displaymanager/default.nix | 14 +++++++ .../services/general/greetd/default.nix | 39 ------------------- modules/system/settings/nix/default.nix | 14 +++---- 29 files changed, 121 insertions(+), 114 deletions(-) create mode 100644 hosts/tower/users/default.nix create mode 100644 modules/home/programs/gui/imv/default.nix create mode 100644 modules/home/programs/terminal/btop/default.nix create mode 100644 modules/home/settings/cursor/default.nix create mode 100644 modules/home/settings/gtk/bookmarks/default.nix create mode 100644 modules/home/settings/gtk/css/default.nix delete mode 100644 modules/home/settings/nix/default.nix create mode 100644 modules/system/services/general/displaymanager/default.nix delete mode 100644 modules/system/services/general/greetd/default.nix diff --git a/hosts/tower/default.nix b/hosts/tower/default.nix index ae25af7..9e61861 100644 --- a/hosts/tower/default.nix +++ b/hosts/tower/default.nix @@ -6,6 +6,7 @@ ./filesystems ./firewall ./hardware + ./users ../../modules/system ]; @@ -17,4 +18,5 @@ environment.sessionVariables.NIXOS_OZONE_WL = "1"; networking.hostName = "tower"; + system.stateVersion = "24.05"; } diff --git a/hosts/tower/users/default.nix b/hosts/tower/users/default.nix new file mode 100644 index 0000000..a0f4778 --- /dev/null +++ b/hosts/tower/users/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./jimbo ]; +} diff --git a/hosts/tower/users/jimbo/default.nix b/hosts/tower/users/jimbo/default.nix index 2ba733f..dc383bc 100644 --- a/hosts/tower/users/jimbo/default.nix +++ b/hosts/tower/users/jimbo/default.nix @@ -1,5 +1,6 @@ { ... }: { home-manager.users.jimbo = { + home.stateVersion = "24.05"; }; } diff --git a/modules/home/default.nix b/modules/home/default.nix index 26fd29b..143c4e1 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -13,4 +13,6 @@ # Imports nur.nixosModules.nur ]; + + nixpkgs.config.allowUnfree = true; } diff --git a/modules/home/files/default.nix b/modules/home/files/default.nix index 652029d..8b9e5df 100644 --- a/modules/home/files/default.nix +++ b/modules/home/files/default.nix @@ -9,9 +9,6 @@ ".assets/lockscreen" = { source = ./assets/lockscreen; }; - ".icons/default" = { - source = "${pkgs.simp1e-cursors}/share/icons/Simp1e-Dark"; - }; ".alsoftrc" = { text = ''drivers=pulse''; }; diff --git a/modules/home/programs/gui/default.nix b/modules/home/programs/gui/default.nix index b8d20ab..06dc69f 100644 --- a/modules/home/programs/gui/default.nix +++ b/modules/home/programs/gui/default.nix @@ -3,6 +3,7 @@ imports = [ ./easyeffects ./foot + ./imv ./librewolf ./mangohud ./mpv diff --git a/modules/home/programs/gui/imv/default.nix b/modules/home/programs/gui/imv/default.nix new file mode 100644 index 0000000..ef8d0cb --- /dev/null +++ b/modules/home/programs/gui/imv/default.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + programs.imv = { + enable = true; + settings.binds = { + h = "prev"; + j = "zoom -5"; + k = "zoom 5"; + l = "next"; + }; + }; +} diff --git a/modules/home/programs/misc/avtools/default.nix b/modules/home/programs/misc/avtools/default.nix index 6e09c51..8ed60a4 100644 --- a/modules/home/programs/misc/avtools/default.nix +++ b/modules/home/programs/misc/avtools/default.nix @@ -7,6 +7,7 @@ home.packages = with pkgs; [ ffmpeg + ffmpegthumbnailer puddletag pulsemixer ]; diff --git a/modules/home/programs/misc/gaming/emulators/default.nix b/modules/home/programs/misc/gaming/emulators/default.nix index 758f6ef..c41094a 100644 --- a/modules/home/programs/misc/gaming/emulators/default.nix +++ b/modules/home/programs/misc/gaming/emulators/default.nix @@ -4,8 +4,8 @@ dolphin-emu cemu ryujinx + lime3ds duckstation pcsx2 - lime3ds ]; } diff --git a/modules/home/programs/misc/gaming/games/default.nix b/modules/home/programs/misc/gaming/games/default.nix index 2d0715b..b951409 100644 --- a/modules/home/programs/misc/gaming/games/default.nix +++ b/modules/home/programs/misc/gaming/games/default.nix @@ -1,7 +1,4 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - openarena - xash3d - ]; + home.packages = with pkgs; [ xash3d ]; } diff --git a/modules/home/programs/misc/general/default.nix b/modules/home/programs/misc/general/default.nix index 826d3de..70762d8 100644 --- a/modules/home/programs/misc/general/default.nix +++ b/modules/home/programs/misc/general/default.nix @@ -2,8 +2,6 @@ { home.packages = with pkgs; [ libreoffice - ffmpegthumbnailer - imv bc ]; } diff --git a/modules/home/programs/misc/headless/default.nix b/modules/home/programs/misc/headless/default.nix index 250734c..9349e1e 100644 --- a/modules/home/programs/misc/headless/default.nix +++ b/modules/home/programs/misc/headless/default.nix @@ -1,7 +1,6 @@ { pkgs, ... }: { home.packages = with pkgs; [ - gotop p7zip vimv dua diff --git a/modules/home/programs/terminal/btop/default.nix b/modules/home/programs/terminal/btop/default.nix new file mode 100644 index 0000000..3b478a3 --- /dev/null +++ b/modules/home/programs/terminal/btop/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + programs.btop = { + enable = true; + settings = { + vim_keys = true; + rounded_corners = false; + theme_background = false; + }; + }; +} diff --git a/modules/home/programs/terminal/default.nix b/modules/home/programs/terminal/default.nix index 680d658..12d76ac 100644 --- a/modules/home/programs/terminal/default.nix +++ b/modules/home/programs/terminal/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./btop ./fastfetch ./git ./ncmpcpp diff --git a/modules/home/settings/cursor/default.nix b/modules/home/settings/cursor/default.nix new file mode 100644 index 0000000..1920cbb --- /dev/null +++ b/modules/home/settings/cursor/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + home.pointerCursor = { + gtk.enable = true; + name = "Simp1e-Dark"; + package = pkgs.simp1e-cursors; + size = 24; + }; +} diff --git a/modules/home/settings/default.nix b/modules/home/settings/default.nix index 7e86920..91ac0a4 100644 --- a/modules/home/settings/default.nix +++ b/modules/home/settings/default.nix @@ -1,10 +1,10 @@ { ... }: { imports = [ + ./cursor ./dconf ./fonts ./gtk - ./nix ./xdg ]; } diff --git a/modules/home/settings/gtk/bookmarks/default.nix b/modules/home/settings/gtk/bookmarks/default.nix new file mode 100644 index 0000000..368f329 --- /dev/null +++ b/modules/home/settings/gtk/bookmarks/default.nix @@ -0,0 +1,11 @@ +{ pkgs, config, ... }: +{ + gtk.gtk3.bookmarks = [ + "file:///home/${config.home.username}/Keepers" + "file:///home/${config.home.username}/Downloads" + "file:///home/${config.home.username}/Documents" + "file:///home/${config.home.username}/Videos" + "file:///home/${config.home.username}/Pictures/Screenshots" + "file:///etc/nixos" + ]; +} diff --git a/modules/home/settings/gtk/css/default.nix b/modules/home/settings/gtk/css/default.nix new file mode 100644 index 0000000..717f916 --- /dev/null +++ b/modules/home/settings/gtk/css/default.nix @@ -0,0 +1,20 @@ +{ ... }: +{ + gtk = { + # Disable shadows + gtk3.extraCss = '' + * { outline-width: 0px; } + decoration { box-shadow: none; } + ''; + + # Prevent GTK4 rounding + gtk4.extraCss = '' + window { + border-top-left-radius:0; + border-top-right-radius:0; + border-bottom-left-radius:0; + border-bottom-right-radius:0; + } + ''; + }; +} diff --git a/modules/home/settings/gtk/default.nix b/modules/home/settings/gtk/default.nix index 9fe0937..33df00a 100644 --- a/modules/home/settings/gtk/default.nix +++ b/modules/home/settings/gtk/default.nix @@ -1,5 +1,10 @@ { pkgs, config, ... }: { + imports = [ + ./bookmarks + ./css + ]; + gtk = { enable = true; font = { @@ -25,36 +30,5 @@ color = "${config.look.colors.folder}"; }; }; - cursorTheme = { - package = pkgs.simp1e-cursors; - name = "Simp1e-Dark"; - }; - - gtk3 = { - bookmarks = [ - "file:///home/jimbo/Keepers" - "file:///home/jimbo/Downloads" - "file:///home/jimbo/Documents" - "file:///home/jimbo/Videos" - "file:///home/jimbo/Pictures/Screenshots" - "file:///etc/nixos" - ]; - - # Disable shadows - extraCss = '' - * { outline-width: 0px; } - decoration { box-shadow: none; } - ''; - }; - - # Stop gtk4 from being rounded - gtk4.extraCss = '' - window { - border-top-left-radius:0; - border-top-right-radius:0; - border-bottom-left-radius:0; - border-bottom-right-radius:0; - } - ''; }; } diff --git a/modules/home/settings/nix/default.nix b/modules/home/settings/nix/default.nix deleted file mode 100644 index 17c5f66..0000000 --- a/modules/home/settings/nix/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: -{ - nixpkgs.config.allowUnfree = true; - home.stateVersion = "24.05"; -} diff --git a/modules/home/wms/niri/hotkeys/default.nix b/modules/home/wms/niri/hotkeys/default.nix index ef010cb..4c974e4 100644 --- a/modules/home/wms/niri/hotkeys/default.nix +++ b/modules/home/wms/niri/hotkeys/default.nix @@ -143,10 +143,15 @@ ${primeMod}+f { maximize-column; } ${primeMod}+Shift+f { fullscreen-window; } - // Niri specific + // Column functions ${primeMod}+r { switch-preset-column-width; } ${primeMod}+Shift+r { reset-window-height; } ${primeMod}+Shift+c { center-column; } + + // Move these into scratchpads if or when they get supported + ${primeMod}+Shift+Backslash { spawn "sh" "-c" "foot btop"; } + ${primeMod}+Shift+m { spawn "sh" "-c" "foot ncmpcpp"; } + ${primeMod}+Shift+v { spawn "sh" "-c" "foot pulsemixer"; } } ''; } diff --git a/modules/home/wms/sway/autostart/default.nix b/modules/home/wms/sway/autostart/default.nix index a0fb69b..becb8ad 100644 --- a/modules/home/wms/sway/autostart/default.nix +++ b/modules/home/wms/sway/autostart/default.nix @@ -5,7 +5,7 @@ startup = [ # Scratchpads - { command = "foot -a gotop -T Gotop gotop"; } + { command = "foot -a btop -T Gotop btop"; } { command = "foot -a music -T Music ncmpcpp"; } { command = "foot -a sound -T Sound pulsemixer"; } diff --git a/modules/home/wms/sway/hotkeys/default.nix b/modules/home/wms/sway/hotkeys/default.nix index 91485b5..1aa4d0a 100644 --- a/modules/home/wms/sway/hotkeys/default.nix +++ b/modules/home/wms/sway/hotkeys/default.nix @@ -160,7 +160,7 @@ "${primeMod}+shift+a" = ''focus child''; # Scratchpads - "Shift+Ctrl+Backslash" = ''[app_id="gotop"] scratchpad show, move position center, resize set 1216 888''; + "${primeMod}+Shift+Backslash" = ''[app_id="btop"] scratchpad show, move position center, resize set 1216 888''; "${primeMod}+Shift+m" = ''[app_id="music"] scratchpad show, move position center, resize set 1006 657''; "${primeMod}+Shift+v" = ''[app_id="sound"] scratchpad show, move position center, resize set 1000 800''; }; diff --git a/modules/home/wms/sway/rules/default.nix b/modules/home/wms/sway/rules/default.nix index 9c89d64..b37195f 100644 --- a/modules/home/wms/sway/rules/default.nix +++ b/modules/home/wms/sway/rules/default.nix @@ -10,10 +10,10 @@ # Scratchpads { criteria = { con_mark = "scratchpad"; }; - command = ''floating enable, sticky enable, move scratchpad, mark borderless''; + command = ''floating enable, sticky enable, move scratchpad, mark giveborder''; } { - criteria = { app_id = "gotop"; }; + criteria = { app_id = "btop"; }; command = ''mark scratchpad''; } { @@ -27,35 +27,31 @@ # Give apps that don't have them borders { - criteria = { con_mark = "borderless"; }; + criteria = { con_mark = "giveborder"; }; command = ''border pixel ${config.look.border.string}''; } { criteria = { app_id = "com.github.wwmm.easyeffects"; }; - command = ''mark borderless''; + command = ''mark giveborder''; } { criteria = { class = "steam"; }; - command = ''mark borderless''; + command = ''mark giveborder''; } { criteria = { app_id = "swappy"; }; - command = ''mark borderless''; + command = ''mark giveborder''; } { criteria = { app_id = "virt-manager"; }; - command = ''mark borderless''; + command = ''mark giveborder''; } { criteria = { window_role = "pop-up"; }; - command = ''mark borderless''; + command = ''mark giveborder''; } - # Floating or fullscreen rules - { - criteria = { app_id = "float"; }; - command = ''floating enable''; - } + # Misc { criteria = { title = "^GlobalShot"; }; command = ''floating enable, fullscreen enable global''; diff --git a/modules/system/default.nix b/modules/system/default.nix index 3502e88..736cae0 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -9,6 +9,4 @@ ./settings ../extras ]; - - system.stateVersion = "24.05"; } diff --git a/modules/system/services/general/default.nix b/modules/system/services/general/default.nix index 165a34a..b919c34 100644 --- a/modules/system/services/general/default.nix +++ b/modules/system/services/general/default.nix @@ -1,8 +1,8 @@ { ... }: { imports = [ + ./displaymanager ./gnome-keyring - ./greetd ./gvfs ./keyd ./libvirtd diff --git a/modules/system/services/general/displaymanager/default.nix b/modules/system/services/general/displaymanager/default.nix new file mode 100644 index 0000000..d4d5232 --- /dev/null +++ b/modules/system/services/general/displaymanager/default.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: +{ + services.greetd = { + enable = config.system.desktop.enable; + restart = true; + settings = { + terminal = { + vt = 2; + switch = true; + }; + default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet"; + }; + }; +} diff --git a/modules/system/services/general/greetd/default.nix b/modules/system/services/general/greetd/default.nix deleted file mode 100644 index 7327775..0000000 --- a/modules/system/services/general/greetd/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, pkgs, ... }: -{ - services.greetd = { - enable = config.system.desktop.enable; - restart = true; - settings = { - terminal = { - vt = 2; - switch = true; - }; - default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet"; - }; - }; - - environment.etc."greetd/environments".text = let - initScript = '' - if ${pkgs.pciutils}/bin/lspci -k | grep "in use: nvidia" &> /dev/null; then - export LIBVA_DRIVER_NAME=nvidia - export GBM_BACKEND=nvidia-drm - export __GLX_VENDOR_LIBRARY_NAME=nvidia - else - : - fi - ''; - in '' - ${pkgs.writeScript "startsway" '' - ${initScript} - export QT_QPA_PLATFORM="wayland;xcb" - export XDG_CURRENT_DESKTOP=sway - sway --unsupported-gpu - ''} - ${pkgs.writeScript "startniri" '' - ${initScript} - export QT_QPA_PLATFORM=wayland - export XDG_CURRENT_DESKTOP=niri - niri-session - ''} - ''; -} diff --git a/modules/system/settings/nix/default.nix b/modules/system/settings/nix/default.nix index 8d444a8..6d8b1d4 100644 --- a/modules/system/settings/nix/default.nix +++ b/modules/system/settings/nix/default.nix @@ -4,14 +4,12 @@ ./autoupgrade ]; - nix = { - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - auto-optimise-store = true; - }; + nix.settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; }; nixpkgs.config.allowUnfree = true;