diff --git a/hosts/Earthmover/default.nix b/hosts/Earthmover/default.nix index 599cc50..ca754b2 100755 --- a/hosts/Earthmover/default.nix +++ b/hosts/Earthmover/default.nix @@ -7,6 +7,16 @@ ../../modules/common ../../modules/nixos + + ../../modules/nixos/system/colors.nix + ../../modules/nixos/system/console-colors.nix + ../../modules/nixos/system/desktop.nix + ../../modules/nixos/system/fonts.nix + ../../modules/nixos/system/home-manager.nix + ../../modules/nixos/system/scx.nix + ../../modules/nixos/system/swap.nix + ../../modules/nixos/system/yubikey.nix + ../../modules/nixos/system/zswap.nix ]; fileSystems = { diff --git a/hosts/Swordsmachine/default.nix b/hosts/Swordsmachine/default.nix index f4ec615..2a47517 100755 --- a/hosts/Swordsmachine/default.nix +++ b/hosts/Swordsmachine/default.nix @@ -7,7 +7,6 @@ ../../modules/common ../../modules/nixos/programs - ../../modules/nixos/programs/desktop/kde ../../modules/nixos/programs/desktop/niri ../../modules/nixos/programs/desktop/niri/niri/window-rules/single-monitor.nix ../../modules/nixos/programs/desktop/niri/niri/workspaces/single-monitor.nix @@ -73,6 +72,19 @@ X-KDE-SubstituteUID=false X-KDE-Username= ''; + + ".local/share/applications/vesktop.desktop".text = '' + [Desktop Entry] + Categories=Network;InstantMessaging;Chat + Exec=nvidia-offload vesktop %U + GenericName=Internet Messenger + Icon=vesktop + Keywords=discord;vencord;electron;chat + Name=Vesktop + StartupWMClass=Vesktop + Type=Application + Version=1.4 + ''; }; home.stateVersion = "25.05"; diff --git a/modules/home/kitty.nix b/modules/home/kitty.nix index 645d040..d568100 100755 --- a/modules/home/kitty.nix +++ b/modules/home/kitty.nix @@ -1,71 +1,73 @@ -{ config, ... }: +{ config, osConfig, ... }: { programs.kitty = { enable = true; - settings = { + settings = + let + colors = osConfig.custom.colors; + in { tab_bar_style = "powerline"; tab_powerline_style = "round"; confirm_os_window_close = -1; - font_size = 12; + font_size = 10; # The basic colors - background = "#1a1b26"; - foreground = "#a9b1d6"; - selection_background = "#444b6a"; - selection_foreground = "#a9b1d6"; + background = colors.base00; + foreground = colors.base05; + selection_background = colors.base03; + selection_foreground = colors.base05; # Cursor colors - cursor = "#a9b1d6"; - cursor_text_color = "#1a1b26"; + cursor = colors.base05; + cursor_text_color = colors.base00; # URL underline color when hovering with mouse - url_color = "#787c99"; + url_color = colors.base04; # Kitty window border colors - active_border_color = "#444b6a"; - inactive_border_color = "#16161e"; + active_border_color = colors.base03; + inactive_border_color = colors.base01; # OS Window titlebar colors - wayland_titlebar_color = "#1a1b26"; - macos_titlebar_color = "#1a1b26"; + wayland_titlebar_color = colors.base00; # Tab bar colors - active_tab_background = "#1a1b26"; - active_tab_foreground = "#a9b1d6"; - inactive_tab_background = "#16161e"; - inactive_tab_foreground = "#787c99"; - tab_bar_background = "#16161e"; + active_tab_background = colors.base00; + active_tab_foreground = colors.base05; + inactive_tab_background = colors.base01; + inactive_tab_foreground = colors.base04; + tab_bar_background = colors.base01; # The 16 terminal colors # normal - color0 = "#1a1b26"; - color1 = "#c0caf5"; - color2 = "#9ece6a"; - color3 = "#0db9d7"; - color4 = "#2ac3de"; - color5 = "#bb9af7"; - color6 = "#b4f9f8"; - color7 = "#a9b1d6"; + color0 = colors.base00; + color1 = colors.base08; + color2 = colors.base0B; + color3 = colors.base0A; + color4 = colors.base0D; + color5 = colors.base0E; + color6 = colors.base0C; + color7 = colors.base05; # bright - color8 = "#2f3549"; - color9 = "#c0caf5"; - color10 = "#9ece6a"; - color11 = "#0db9d7"; - color12 = "#2ac3de"; - color13 = "#bb9af7"; - color14 = "#b4f9f8"; - color15 = "#d5d6db"; + color8 = colors.base02; + color9 = colors.base08; + color10 = colors.base0B; + color11 = colors.base0A; + color12 = colors.base0D; + color13 = colors.base0E; + color14 = colors.base0C; + color15 = colors.base07; # extended base16 colors - color16 = "#a9b1d6"; - color17 = "#f7768e"; - color18 = "#16161e"; - color19 = "#2f3549"; - color20 = "#787c99"; - color21 = "#cbccd1"; + color16 = colors.base09; + color17 = colors.base0F; + color18 = colors.base01; + color19 = colors.base02; + color20 = colors.base04; + color21 = colors.base06; }; }; } \ No newline at end of file diff --git a/modules/nixos/programs/default.nix b/modules/nixos/programs/default.nix index 1e9c1c1..49e93ec 100644 --- a/modules/nixos/programs/default.nix +++ b/modules/nixos/programs/default.nix @@ -5,7 +5,6 @@ ./bash.nix ./gaming.nix ./git.nix - ./kde.nix ./ssh.nix ]; } \ No newline at end of file diff --git a/modules/nixos/programs/kde.nix b/modules/nixos/programs/desktop/kde/default.nix similarity index 73% rename from modules/nixos/programs/kde.nix rename to modules/nixos/programs/desktop/kde/default.nix index 105814a..105da61 100755 --- a/modules/nixos/programs/kde.nix +++ b/modules/nixos/programs/desktop/kde/default.nix @@ -19,5 +19,13 @@ konsole khelpcenter krdp + xwaylandvideobridge + plasma-browser-integration + baloo-widgets + ffmpegthumbs + dolphin-plugins + kate + okular + gwenview ]; } \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/default.nix b/modules/nixos/programs/desktop/niri/default.nix new file mode 100644 index 0000000..b2c8e4a --- /dev/null +++ b/modules/nixos/programs/desktop/niri/default.nix @@ -0,0 +1,16 @@ +{ config, ... }: + +{ + imports = [ + ./niri + ./waybar + ./flameshot.nix + ./fuzzel.nix + ./hypridle.nix + ./hyprlock.nix + ./mako.nix + ./swaybg.nix + ./tuigreet.nix + ./yazi.nix + ]; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/flameshot.nix b/modules/nixos/programs/desktop/niri/flameshot.nix new file mode 100644 index 0000000..68ed492 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/flameshot.nix @@ -0,0 +1,22 @@ +{ inputs, config, pkgs, ... }: + +{ + home-manager.users.wo2w.services.flameshot = { + enable = true; + # FIXME use unstable version for 13.0.0 update + package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.flameshot; + + settings.General = { + useGrimAdapter = true; + disabledGrimWarning = true; + + savePath = "/home/wo2w/Pictures/Screenshots"; + savePathFixed = true; + + startupLaunch = false; + showStartupLaunchMessage = false; + autoCloseIdleDaemon = true; + disabledTrayIcon = true; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/fuzzel.nix b/modules/nixos/programs/desktop/niri/fuzzel.nix new file mode 100644 index 0000000..8fbf9ed --- /dev/null +++ b/modules/nixos/programs/desktop/niri/fuzzel.nix @@ -0,0 +1,30 @@ +{ config, pkgs, lib, ... }: + +{ + home-manager.users.wo2w.programs.fuzzel = { + enable = true; + settings = + let + toRgba = color: "${lib.removePrefix "#" color}ff"; + + colors = config.custom.colors; + in { + main.placeholder = "type something already..."; + + border.width = 5; + colors = { + background = toRgba colors.base00; + text = toRgba colors.base05; + prompt = toRgba colors.base05; + placeholder = toRgba colors.base03; + input = toRgba colors.base05; + match = toRgba colors.base0C; + selection = toRgba colors.base03; + selection-text = toRgba colors.base05; + selection-match = toRgba colors.base0C; + counter = toRgba colors.base03; + border = toRgba colors.base0D; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/hypridle.nix b/modules/nixos/programs/desktop/niri/hypridle.nix new file mode 100644 index 0000000..972b1d3 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/hypridle.nix @@ -0,0 +1,24 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.services.hypridle = { + enable = true; + settings = { + general = { + lock_cmd = "hyprlock"; + before_sleep_cmd = "hyprlock"; + }; + + listener = [ + { + timeout = 300; + on-timeout = "hyprlock"; + } + { + timeout = 900; + on-timeout = "systemctl sleep"; + } + ]; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/hyprlock.nix b/modules/nixos/programs/desktop/niri/hyprlock.nix new file mode 100644 index 0000000..3b32eab --- /dev/null +++ b/modules/nixos/programs/desktop/niri/hyprlock.nix @@ -0,0 +1,49 @@ +{ config, lib, ... }: + +{ + home-manager.users.wo2w.programs.hyprlock = { + enable = true; + settings = + let + toHyprClr = color: "rgb(${lib.removePrefix "#" color})"; + + colors = config.custom.colors; + in { + general.grace = 5; + + background = { + path = "/home/wo2w/Pictures/Wallpapers/oneshot1.png"; + blur_passes = 2; + }; + + label = [ + { + valign = "top"; + position = "0, -400"; + font_size = 128; + text = "$TIME"; + } + { + position = "0, 250"; + font_size = 64; + text = "$DESC"; + } + ]; + + input-field = { + position = "0, -80"; + size = "400, 100"; + outline_thickness = 8; + + outer_color = toHyprClr colors.base0D; + inner_color = toHyprClr colors.base00; + font_color = toHyprClr colors.base05; + check_color = toHyprClr colors.base0E; + fail_color = toHyprClr colors.base0C; + capslock_color = toHyprClr colors.base08; + numlock_color = toHyprClr colors.base08; + bothlock_color = toHyprClr colors.base08; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/mako.nix b/modules/nixos/programs/desktop/niri/mako.nix new file mode 100644 index 0000000..a6e75ed --- /dev/null +++ b/modules/nixos/programs/desktop/niri/mako.nix @@ -0,0 +1,24 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.services.mako = { + enable = true; + settings = + let + colors = config.custom.colors; + in { + max-history = 10; + default-timeout = 5000; + anchor = "bottom-right"; + + on-button-middle = "dismiss-group"; + + border-size = 4; + + background-color = colors.base00; + text-color = colors.base05; + border-color = colors.base0E; + progress-color = "over ${colors.base0C}"; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/niri/binds.nix b/modules/nixos/programs/desktop/niri/niri/binds.nix new file mode 100644 index 0000000..1c1a19d --- /dev/null +++ b/modules/nixos/programs/desktop/niri/niri/binds.nix @@ -0,0 +1,231 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.programs.niri.settings.binds = { + # custom binds + "Mod+Space".action.spawn = [ "fuzzel" ]; + "Print".action.screenshot = {}; + "Alt+Print".action.screenshot-window = {}; + "Ctrl+Print".action.screenshot-screen = {}; + "Mod+T".action.spawn = "kitty"; + + "Super+Alt+L".action.spawn = "hyprlock"; + "Super+Alt+S".action.spawn = [ "systemctl" "sleep" ]; + "Super+Alt+E".action.quit = {}; + "Super+Alt+Shift+S".action.spawn = "poweroff"; + "Super+Alt+Shift+R".action.spawn = "reboot"; + + "Mod+O".action.open-overview = {}; + "Mod+V".action.toggle-window-floating = {}; + "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = {}; + + + # default binds + + # Mod-Shift-/, which is usually the same as Mod-?, + # shows a list of important hotkeys. + "Mod+Shift+Slash".action.show-hotkey-overlay = {}; + + # You can also use a shell. Do this if you need pipes, multiple commands, etc. + # Note: the entire command goes as a single argument in the end. + # Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } + + # Example volume keys mappings for PipeWire & WirePlumber. + # The allow-when-locked=true property makes them work even when the session is locked. + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" ]; + }; + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"]; + }; + "XF86AudioMute" = { + allow-when-locked = true; + action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ]; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle" ]; + }; + + "Mod+Q".action.close-window = {}; + + "Mod+Left".action.focus-column-left = {}; + "Mod+Down".action.focus-window-down = {}; + "Mod+Up".action.focus-window-up = {}; + "Mod+Right".action.focus-column-right = {}; + + "Mod+Ctrl+Left".action.move-column-left = {}; + "Mod+Ctrl+Down".action.move-window-down = {}; + "Mod+Ctrl+Up".action.move-window-up = {}; + "Mod+Ctrl+Right".action.move-column-right = {}; + + # Alternative commands that move across workspaces when reaching + # the first or last window in a column. + # Mod+J { focus-window-or-workspace-down; } + # Mod+K { focus-window-or-workspace-up; } + # Mod+Ctrl+J { move-window-down-or-to-workspace-down; } + # Mod+Ctrl+K { move-window-up-or-to-workspace-up; } + + "Mod+Home".action.focus-column-first = {}; + "Mod+End".action.focus-column-last = {}; + "Mod+Ctrl+Home".action.move-column-to-first = {}; + "Mod+Ctrl+End".action.move-column-to-last = {}; + "Super+Alt+Left".action.focus-column-first = {}; + "Super+Alt+Right".action.focus-column-last = {}; + "Super+Alt+Shift+Left".action.move-column-to-first = {}; + "Super+Alt+Shift+Right".action.move-column-to-last = {}; + + "Mod+Shift+Left".action.focus-monitor-left = {}; + "Mod+Shift+Down".action.focus-monitor-down = {}; + "Mod+Shift+Up".action.focus-monitor-up = {}; + "Mod+Shift+Right".action.focus-monitor-right = {}; + + "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {}; + "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {}; + "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {}; + "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {}; + + # Alternatively, there are commands to move just a single window: + # Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } + # ... + + # And you can also move a whole workspace to another monitor: + # Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } + # ... + + "Mod+Page_Down".action.focus-workspace-down = {}; + "Mod+Page_Up".action.focus-workspace-up = {}; + "Super+Alt+Down".action.focus-workspace-down = {}; + "Super+Alt+Up".action.focus-workspace-up = {}; + "Mod+U".action.focus-workspace-down = {}; + "Mod+I".action.focus-workspace-up = {}; + "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {}; + "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {}; + "Super+Alt+Ctrl+Down".action.move-column-to-workspace-down = {}; + "Super+Alt+Ctrl+Up".action.move-column-to-workspace-up = {}; + "Mod+Ctrl+U".action.move-column-to-workspace-down = {}; + "Mod+Ctrl+I".action.move-column-to-workspace-up = {}; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+Page_Down { move-window-to-workspace-down; } + # ... + + "Mod+Shift+Page_Down".action.move-workspace-down = {}; + "Mod+Shift+Page_Up".action.move-workspace-up = {}; + "Super+Alt+Shift+Down".action.move-workspace-down = {}; + "Super+Alt+Shift+Up".action.move-workspace-up = {}; + "Mod+Shift+U".action.move-workspace-down = {}; + "Mod+Shift+I".action.move-workspace-up = {}; + + # You can bind mouse wheel scroll ticks using the following syntax. + # These binds will change direction based on the natural-scroll setting. + # + # To avoid scrolling through workspaces really fast, you can use + # the cooldown-ms property. The bind will be rate-limited to this value. + # You can set a cooldown on any bind, but it's most useful for the wheel. + "Mod+WheelScrollDown" = { + cooldown-ms = 150; + action.focus-workspace-down = {}; + }; + "Mod+WheelScrollUp" = { + cooldown-ms = 150; + action.focus-workspace-up = {}; + }; + "Mod+Ctrl+WheelScrollDown" = { + cooldown-ms = 150; + action.move-column-to-workspace-down = {}; + }; + "Mod+Ctrl+WheelScrollUp" = { + cooldown-ms = 150; + action.move-column-to-workspace-up = {}; + }; + + "Mod+WheelScrollRight".action.focus-column-right = {}; + "Mod+WheelScrollLeft".action.focus-column-left = {}; + "Mod+Ctrl+WheelScrollRight".action.move-column-right = {}; + "Mod+Ctrl+WheelScrollLeft".action.move-column-left = {}; + + # Usually scrolling up and down with Shift in applications results in + # horizontal scrolling; these binds replicate that. + "Mod+Shift+WheelScrollDown".action.focus-column-right = {}; + "Mod+Shift+WheelScrollUp".action.focus-column-left = {}; + "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {}; + "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {}; + + # Similarly, you can bind touchpad scroll "ticks". + # Touchpad scrolling is continuous, so for these binds it is split into + # discrete intervals. + # These binds are also affected by touchpad's natural-scroll, so these + # example binds are "inverted", since we have natural-scroll enabled for + # touchpads by default. + # Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } + # Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } + + # You can refer to workspaces by index. However, keep in mind that + # niri is a dynamic workspace system, so these commands are kind of + # "best effort". Trying to refer to a workspace index bigger than + # the current workspace count will instead refer to the bottommost + # (empty) workspace. + # + # For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on + # will all refer to the 3rd workspace. + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+Ctrl+1".action.move-column-to-workspace = 1; + "Mod+Ctrl+2".action.move-column-to-workspace = 2; + "Mod+Ctrl+3".action.move-column-to-workspace = 3; + "Mod+Ctrl+4".action.move-column-to-workspace = 4; + "Mod+Ctrl+5".action.move-column-to-workspace = 5; + "Mod+Ctrl+6".action.move-column-to-workspace = 6; + "Mod+Ctrl+7".action.move-column-to-workspace = 7; + "Mod+Ctrl+8".action.move-column-to-workspace = 8; + "Mod+Ctrl+9".action.move-column-to-workspace = 9; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+1 { move-window-to-workspace 1; } + + # Switches focus between the current and the previous workspace. + # Mod+Tab { focus-workspace-previous; } + + "Mod+Comma".action.consume-window-into-column = {}; + "Mod+Period".action.expel-window-from-column = {}; + + # There are also commands that consume or expel a single window to the side. + "Mod+BracketLeft".action.consume-or-expel-window-left = {}; + "Mod+BracketRight".action.consume-or-expel-window-right = {}; + + "Mod+R".action.switch-preset-column-width = {}; + "Mod+Shift+R".action.reset-window-height = {}; + "Mod+F".action.maximize-column = {}; + "Mod+Shift+F".action.fullscreen-window = {}; + "Mod+C".action.center-column = {}; + + # Finer width adjustments. + # This command can also: + # * set width in pixels: "1000" + # * adjust width in pixels: "-5" or "+5" + # * set width as a percentage of screen width: "25%" + # * adjust width as a percentage of screen width: "-10%" or "+10%" + # Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, + # set-column-width "100" will make the column occupy 200 physical screen pixels. + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + + # Finer height adjustments when in column with other windows. + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + + # Powers off the monitors. To turn them back on, do any input like + # moving the mouse or pressing any other key. + "Mod+Shift+P".action.power-off-monitors = {}; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/niri/default.nix b/modules/nixos/programs/desktop/niri/niri/default.nix new file mode 100644 index 0000000..b53633b --- /dev/null +++ b/modules/nixos/programs/desktop/niri/niri/default.nix @@ -0,0 +1,60 @@ +{ inputs, config, pkgs, ... }: + +{ + imports = [ + ./window-rules + ./binds.nix + + inputs.niri.nixosModules.niri + ]; + + # compositor: niri + # bar: waybar + # wallpaper: swaybg + # application launcher: rofi + # idle daemon: hypridle + # screen locker: hyprlock + # notification daemon: mako + # screenshot tool: flameshot + # file manager: yazi + + programs.niri.enable = true; + + environment.systemPackages = [ + pkgs.xwayland-satellite # necessary for xwayland on niri + pkgs.bibata-cursors + ]; + + xdg.portal.config.niri = { + default = "gtk"; + "org.freedesktop.impl.portal.ScreenCast" = "gnome"; + "org.freedesktop.impl.portal.Secret" = "gnome-keyring"; + }; + + home-manager.users.wo2w.programs.niri.settings = { + hotkey-overlay.skip-at-startup = true; + prefer-no-csd = true; + + gestures.hot-corners.enable = false; + input.touchpad.natural-scroll = false; + + cursor = { + theme = "Bibata-Modern-Classic"; + size = 24; + }; + + layout.focus-ring = { + active.color = config.custom.colors.base0D; + inactive.color = config.custom.colors.base0E; + }; + + screenshot-path = "~/Pictures/Screenshots/%F_%H-%M-%S"; + + outputs = { + "Sharp Corporation 0x148D Unknown".scale = 2.25; # Laptop builtin screen + }; + + # fix screen tearing in games + debug.wait-for-frame-completion-before-queueing = {}; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/niri/window-rules/default.nix b/modules/nixos/programs/desktop/niri/niri/window-rules/default.nix new file mode 100644 index 0000000..03be6f9 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/niri/window-rules/default.nix @@ -0,0 +1,64 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.programs.niri.settings.window-rules = [ + # block sensitive applications from capture + { + matches = [{ title = "^Bitwarden$"; }]; + block-out-from = "screen-capture"; + } + { + matches = [{ app-id = "^org.kde.polkit-kde-authentication-agent-1$"; }]; + block-out-from = "screen-capture"; + open-floating = true; + } + + # fix steam notifs + { + matches = [ + { app-id = "steam"; } + { title = "^notificationtoasts_\d+_desktop$"; } + ]; + default-floating-position = { + x = 10; + y = 10; + relative-to = "bottom-right"; + }; + } + + # code + { + matches = [{ app-id = "codium"; }]; + open-on-workspace = "code"; + } + + # gaming + { + matches = [ + { app-id = "steam"; } + { title = "^Steam$"; } + ]; + open-on-workspace = "gaming"; + open-maximized = true; + } + { + matches = [{ app-id = "org.prismlauncher.PrismLauncher"; }]; + open-on-workspace = "gaming"; + } + + # fullscreen + { + matches = [ + { app-id = "librewolf"; } + { title = "^LibreWolf$"; } + ]; + open-on-workspace = "fullscreen"; + open-maximized = true; + } + { + matches = [{ app-id = "spotify"; }]; + open-on-workspace = "fullscreen"; + open-maximized = true; + } + ]; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/niri/window-rules/dual-monitor.nix b/modules/nixos/programs/desktop/niri/niri/window-rules/dual-monitor.nix new file mode 100644 index 0000000..3804ae4 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/niri/window-rules/dual-monitor.nix @@ -0,0 +1,10 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.programs.niri.settings.window-rules = [ + { + matches = [{ app-id = "vesktop"; }]; + open-on-workspace = "vesktop"; + } + ]; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/niri/window-rules/single-monitor.nix b/modules/nixos/programs/desktop/niri/niri/window-rules/single-monitor.nix new file mode 100644 index 0000000..119c609 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/niri/window-rules/single-monitor.nix @@ -0,0 +1,10 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.programs.niri.settings.window-rules = [ + { + matches = [{ app-id = "vesktop"; }]; + open-on-workspace = "fullscreen"; + } + ]; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/niri/workspaces/dual-monitor.nix b/modules/nixos/programs/desktop/niri/niri/workspaces/dual-monitor.nix new file mode 100644 index 0000000..1d8cf4b --- /dev/null +++ b/modules/nixos/programs/desktop/niri/niri/workspaces/dual-monitor.nix @@ -0,0 +1,22 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.programs.niri.settings.workspaces = { + "01-DP-1-code" = { + name = "code"; + open-on-output = "DP-1"; + }; + "02-DP-1-vesktop" = { + name = "vesktop"; + open-on-output = "DP-1"; + }; + "03-DP-1-gaming" = { + name = "gaming"; + open-on-output = "DP-1"; + }; + "04-DP-2-fullscreen" = { + name = "fullscreen"; + open-on-output = "DP-2"; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/niri/workspaces/single-monitor.nix b/modules/nixos/programs/desktop/niri/niri/workspaces/single-monitor.nix new file mode 100644 index 0000000..f807335 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/niri/workspaces/single-monitor.nix @@ -0,0 +1,9 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.programs.niri.settings.workspaces = { + "01-code".name = "code"; + "02-fullscreen".name = "fullscreen"; + "03-gaming".name = "gaming"; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/swaybg.nix b/modules/nixos/programs/desktop/niri/swaybg.nix new file mode 100644 index 0000000..abbee54 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/swaybg.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, ... }: + +{ + home-manager.users.wo2w = { + home.packages = [ pkgs.swaybg ]; + + systemd.user.services.swaybg = { + Install.WantedBy = [ "graphical-session.target" ]; + + Service = { + ExecStart = '' + ${lib.getExe pkgs.swaybg} -o eDP-1 -i /home/wo2w/Pictures/Wallpapers/oneshot1.png -m fill \ + -o DP-1 -i /home/wo2w/Pictures/Wallpapers/oneshot1.png -m fill \ + -o DP-2 -i /home/wo2w/Pictures/Wallpapers/oneshot2.png -m fill + ''; + Restart = "always"; + }; + + Unit = { + Description = "Custom user service for swaybg"; + After = [ "graphical-session.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/tuigreet.nix b/modules/nixos/programs/desktop/niri/tuigreet.nix new file mode 100644 index 0000000..6fd69b7 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/tuigreet.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + services = { + displayManager.sddm = { + enable = lib.mkForce false; + wayland.enable = lib.mkForce false; + }; + + greetd = { + enable = true; + settings.default_session = { + command = '' + ${lib.getExe pkgs.greetd.tuigreet} \ + --cmd niri-session \ + --power-shutdown poweroff \ + --power-reboot reboot \ + --remember \ + --asterisks \ + --time \ + --greeting "${config.networking.hostName} | Collect my sessions..." + ''; + user = "greeter"; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/waybar/default.nix b/modules/nixos/programs/desktop/niri/waybar/default.nix new file mode 100644 index 0000000..4aef04f --- /dev/null +++ b/modules/nixos/programs/desktop/niri/waybar/default.nix @@ -0,0 +1,172 @@ +{ config, pkgs, ... }: + +{ + fonts.packages = [ pkgs.font-awesome ]; + + home-manager.users.wo2w.programs.waybar = { + enable = true; + systemd.enable = true; + + style = + let + colors = config.custom.colors; + in '' + @define-color base00 ${colors.base00}; + @define-color base05 ${colors.base05}; + @define-color base03 ${colors.base03}; + @define-color base0E ${colors.base0E}; + + '' + builtins.readFile ./style.css; + settings = { + main = { + output = [ + "eDP-1" + "DP-1" + ]; + layer = "top"; + position = "top"; + height = 35; + + modules-left = [ + "niri/workspaces" + "niri/window" + ]; + modules-center = [ + "clock" + ]; + modules-right = [ + "group/cpu-temp" + "memory" + "battery" + "power-profiles-daemon" + "backlight" + "network" + "pulseaudio" + "tray" + ]; + + "group/cpu-temp" = { + orientation = "inherit"; + modules = [ + "temperature" + "cpu" + ]; + }; + + "niri/workspaces" = { + format = "{icon}"; + format-icons = { + code = ""; + fullscreen = ""; + gaming = ""; + vesktop = ""; + }; + all-outputs = true; + }; + + "niri/window" = { + max-length = 50; + tooltip = false; + }; + + clock = { + interval = 1; + timezone = "America/New_York"; + format = "{:%T}"; + tooltip-format = "{:%Y %B}\n{calendar}"; + format-alt = "{:%Y-%m-%d}"; + actions = { + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + on-click-middle = "shift_reset"; + }; + }; + + temperature = { + thermal-zone = 9; + critical-threshold = 90; + format = "{temperatureC}°C {icon}"; + format-icons = [ "" "" "" ]; + tooltip = false; + }; + + cpu = { + format = "{usage}% "; + tooltip = false; + }; + + memory = { + interval = 10; + format = "{used:0.1f}G "; + format-alt = "{percentage}% "; + tooltip-format = "{swapUsed}G "; + }; + + battery = { + states = { + warning = 40; + critical = 15; + }; + format = "{capacity}% {icon}"; + format-full = "{capacity}% {icon}"; + format-charging = "{capacity}% "; + format-plugged = "{capacity}% "; + format-alt = "{time} {icon}"; + format-icons = [ "" "" "" "" "" ]; + }; + + power-profiles-daemon = { + format = "{icon}"; + tooltip-format = "Power profile: {profile}"; + tooltip = true; + format-icons = { + default = ""; + performance = ""; + balanced = ""; + power-saver = ""; + }; + }; + + backlight = { + format = "{percent}% {icon}"; + format-icons = [ "" "" "" "" "" "" "" "" "" ]; + tooltip = false; + }; + + network = { + format-wifi = "{ipaddr} "; + format-ethernet = "{ipaddr} "; + # long ugly ass string because indented strings insert an extra newline (i do not know how to resolve this) + tooltip-format-wifi = "{essid} ({frequency} GHz)\n\n{ipaddr}/{cidr}\n{ifname} via {gwaddr}\nstrength: {signalStrength}%\nup: {bandwidthUpBytes} down: {bandwidthDownBytes}"; + tooltip-format-ethernet = "{ipaddr}/{cidr}\n{ifname} via {gwaddr}\nup: {bandwidthUpBytes} down: {bandwidthDownBytes}"; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; + + pulseaudio = { + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = "{volume}% "; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = [ "" "" "" ]; + }; + }; + + tray = { + icon-size = 18; + spacing = 10; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/waybar/style.css b/modules/nixos/programs/desktop/niri/waybar/style.css new file mode 100644 index 0000000..a080499 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/waybar/style.css @@ -0,0 +1,160 @@ +* { + font-family: FontAwesome, "Hack Nerd Font"; + font-size: 11pt; +} + +window#waybar { + background: transparent; + color: @base05; +} + +tooltip { + color: @base05; + border-color: @base0E; +} + +tooltip label { + color: @base05; +} + +#workspaces, +#window, +#clock, +#cpu-temp, +#memory, +#battery, +#power-profiles-daemon, +#backlight, +#network, +#pulseaudio, +#tray + +#workspaces { + margin-right: 4px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#workspaces button { + padding-right: 8px; + color: @base05; +} + +#workspaces button.focused, +#workspaces button.active { + border-bottom: 3px solid @base03; + border-radius: 6px; +} + +#window { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#clock { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#cpu-temp { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#temperature { + padding-right: 12px; +} + +#cpu { + padding-right: 5px; +} + +#memory { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#battery { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#power-profiles-daemon { + margin: 0 4px 0 4px; + padding-left: 12px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#backlight { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#network { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#pulseaudio { + margin: 0 4px 0 4px; + padding-left: 15px; + padding-right: 15px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +#tray { + margin-left: 4px; + padding-left: 10px; + padding-right: 10px; + border: 2px solid @base0E; + border-radius: 12px; + background: @base00; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* remove right margin if pulseaudio is on the right */ +.modules-right > widget:last-child > #pulseaudio { + margin-right: 0; +} \ No newline at end of file diff --git a/modules/nixos/programs/desktop/niri/yazi.nix b/modules/nixos/programs/desktop/niri/yazi.nix new file mode 100644 index 0000000..826ea81 --- /dev/null +++ b/modules/nixos/programs/desktop/niri/yazi.nix @@ -0,0 +1,8 @@ +{ config, ... }: + +{ + home-manager.users.wo2w.programs.yazi = { + enable = true; + enableBashIntegration = true; + }; +} \ No newline at end of file diff --git a/modules/nixos/programs/niri.nix b/modules/nixos/programs/niri.nix deleted file mode 100755 index 11a57d4..0000000 --- a/modules/nixos/programs/niri.nix +++ /dev/null @@ -1,539 +0,0 @@ -{ hostName, inputs, config, lib, pkgs, ... }: - -{ - # compositor: niri - # bar: waybar - # application launcher: rofi - # idle daemon: hypridle - # screen locker: hyprlock - # wallpaper daemon: wpaperd - # notification daemon: mako - # screenshot tool: flameshot - - - imports = [ inputs.niri.nixosModules.niri ]; - nixpkgs.overlays = [ inputs.niri.overlays.niri ]; - - programs.niri.enable = true; - - environment.systemPackages = with pkgs; [ - wpaperd # wallpaper daemon (higher memory usage than average, could replace) - xwayland-satellite # necessary for xwayland on niri - (flameshot.override { enableWlrSupport = true; }) # screenshot program - ]; - - xdg.portal.config = { - niri = { - default = "gtk"; - "org.freedesktop.impl.portal.ScreenCast" = "gnome"; - "org.freedesktop.impl.portal.Secret" = "gnome-keyring"; - }; - }; - - home-manager.users.wo2w = { - xdg.configFile."wpaperd/config.toml".text = '' - [default] - duration = "2h" - mode = "stretch" - path = "/home/wo2w/Pictures/Wallpapers" - initial-transition = false - ''; - - programs = { - niri = { - settings = { - hotkey-overlay.skip-at-startup = true; - prefer-no-csd = true; - - environment.DISPLAY = ":0"; - - screenshot-path = "~/Pictures/Screenshots/%F_%H-%M-%S"; - - outputs = { - "Sharp Corporation 0x148D Unknown".scale = 2.25; # Laptop builtin screen - }; - - binds = { - # custom binds - "Mod+Space".action.spawn = [ "rofi" "-show" "drun" ]; - "Print".action.screenshot-screen = {}; - "Shift+Print".action.screenshot = {}; - "Alt+Print".action.screenshot-window = {}; - "Mod+Print".action.spawn = [ "sh" "-c" "QT_QPA_PLATFORM=xcb" "DISPLAY=:0" "flameshot" "full" ]; - "Mod+T".action.spawn = "kitty"; - - "Super+Alt+L".action.spawn = "hyprlock"; - "Super+Alt+S".action.spawn = [ "systemctl" "sleep" ]; - "Super+Alt+E".action.quit.skip-confirmation = true; - "Super+Alt+Shift+S".action.spawn = "poweroff"; - "Super+Alt+Shift+R".action.spawn = "reboot"; - - "Super+Alt+F".action.fullscreen-window = {}; - - "Mod+O".action.open-overview = {}; - "Mod+V".action.toggle-window-floating = {}; - "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = {}; - - - # default binds - - # Mod-Shift-/, which is usually the same as Mod-?, - # shows a list of important hotkeys. - "Mod+Shift+Slash".action.show-hotkey-overlay = {}; - - # You can also use a shell. Do this if you need pipes, multiple commands, etc. - # Note: the entire command goes as a single argument in the end. - # Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; } - - # Example volume keys mappings for PipeWire & WirePlumber. - # The allow-when-locked=true property makes them work even when the session is locked. - "XF86AudioRaiseVolume" = { - allow-when-locked = true; - action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" ]; - }; - "XF86AudioLowerVolume" = { - allow-when-locked = true; - action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"]; - }; - "XF86AudioMute" = { - allow-when-locked = true; - action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ]; - }; - "XF86AudioMicMute" = { - allow-when-locked = true; - action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle" ]; - }; - - "Mod+Q".action.close-window = {}; - - "Mod+Left".action.focus-column-left = {}; - "Mod+Down".action.focus-window-down = {}; - "Mod+Up".action.focus-window-up = {}; - "Mod+Right".action.focus-column-right = {}; - "Mod+H".action.focus-column-left = {}; - "Mod+J".action.focus-window-down = {}; - "Mod+K".action.focus-window-up = {}; - "Mod+L".action.focus-column-right = {}; - - "Mod+Ctrl+Left".action.move-column-left = {}; - "Mod+Ctrl+Down".action.move-window-down = {}; - "Mod+Ctrl+Up".action.move-window-up = {}; - "Mod+Ctrl+Right".action.move-column-right = {}; - "Mod+Ctrl+H".action.move-column-left = {}; - "Mod+Ctrl+J".action.move-window-down = {}; - "Mod+Ctrl+K".action.move-window-up = {}; - "Mod+Ctrl+L".action.move-column-right = {}; - - # Alternative commands that move across workspaces when reaching - # the first or last window in a column. - # Mod+J { focus-window-or-workspace-down; } - # Mod+K { focus-window-or-workspace-up; } - # Mod+Ctrl+J { move-window-down-or-to-workspace-down; } - # Mod+Ctrl+K { move-window-up-or-to-workspace-up; } - - "Mod+Home".action.focus-column-first = {}; - "Mod+End".action.focus-column-last = {}; - "Mod+Ctrl+Home".action.move-column-to-first = {}; - "Mod+Ctrl+End".action.move-column-to-last = {}; - - "Mod+Shift+Left".action.focus-monitor-left = {}; - "Mod+Shift+Down".action.focus-monitor-down = {}; - "Mod+Shift+Up".action.focus-monitor-up = {}; - "Mod+Shift+Right".action.focus-monitor-right = {}; - "Mod+Shift+H".action.focus-monitor-left = {}; - "Mod+Shift+J".action.focus-monitor-down = {}; - "Mod+Shift+K".action.focus-monitor-up = {}; - "Mod+Shift+L".action.focus-monitor-right = {}; - - "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {}; - "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {}; - "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {}; - "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {}; - "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {}; - "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {}; - "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {}; - "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = {}; - - # Alternatively, there are commands to move just a single window: - # Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } - # ... - - # And you can also move a whole workspace to another monitor: - # Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } - # ... - - "Mod+Page_Down".action.focus-workspace-down = {}; - "Mod+Page_Up".action.focus-workspace-up = {}; - "Mod+U".action.focus-workspace-down = {}; - "Mod+I".action.focus-workspace-up = {}; - "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {}; - "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {}; - "Mod+Ctrl+U".action.move-column-to-workspace-down = {}; - "Mod+Ctrl+I".action.move-column-to-workspace-up = {}; - - # Alternatively, there are commands to move just a single window: - # Mod+Ctrl+Page_Down { move-window-to-workspace-down; } - # ... - - "Mod+Shift+Page_Down".action.move-workspace-down = {}; - "Mod+Shift+Page_Up".action.move-workspace-up = {}; - "Mod+Shift+U".action.move-workspace-down = {}; - "Mod+Shift+I".action.move-workspace-up = {}; - - # You can bind mouse wheel scroll ticks using the following syntax. - # These binds will change direction based on the natural-scroll setting. - # - # To avoid scrolling through workspaces really fast, you can use - # the cooldown-ms property. The bind will be rate-limited to this value. - # You can set a cooldown on any bind, but it's most useful for the wheel. - "Mod+WheelScrollDown" = { - cooldown-ms = 150; - action.focus-workspace-down = {}; - }; - "Mod+WheelScrollUp" = { - cooldown-ms = 150; - action.focus-workspace-up = {}; - }; - "Mod+Ctrl+WheelScrollDown" = { - cooldown-ms = 150; - action.move-column-to-workspace-down = {}; - }; - "Mod+Ctrl+WheelScrollUp" = { - cooldown-ms = 150; - action.move-column-to-workspace-up = {}; - }; - - "Mod+WheelScrollRight".action.focus-column-right = {}; - "Mod+WheelScrollLeft".action.focus-column-left = {}; - "Mod+Ctrl+WheelScrollRight".action.move-column-right = {}; - "Mod+Ctrl+WheelScrollLeft".action.move-column-left = {}; - - # Usually scrolling up and down with Shift in applications results in - # horizontal scrolling; these binds replicate that. - "Mod+Shift+WheelScrollDown".action.focus-column-right = {}; - "Mod+Shift+WheelScrollUp".action.focus-column-left = {}; - "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {}; - "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {}; - - # Similarly, you can bind touchpad scroll "ticks". - # Touchpad scrolling is continuous, so for these binds it is split into - # discrete intervals. - # These binds are also affected by touchpad's natural-scroll, so these - # example binds are "inverted", since we have natural-scroll enabled for - # touchpads by default. - # Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } - # Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } - - # You can refer to workspaces by index. However, keep in mind that - # niri is a dynamic workspace system, so these commands are kind of - # "best effort". Trying to refer to a workspace index bigger than - # the current workspace count will instead refer to the bottommost - # (empty) workspace. - # - # For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on - # will all refer to the 3rd workspace. - "Mod+1".action.focus-workspace = 1; - "Mod+2".action.focus-workspace = 2; - "Mod+3".action.focus-workspace = 3; - "Mod+4".action.focus-workspace = 4; - "Mod+5".action.focus-workspace = 5; - "Mod+6".action.focus-workspace = 6; - "Mod+7".action.focus-workspace = 7; - "Mod+8".action.focus-workspace = 8; - "Mod+9".action.focus-workspace = 9; - "Mod+Ctrl+1".action.move-column-to-workspace = 1; - "Mod+Ctrl+2".action.move-column-to-workspace = 2; - "Mod+Ctrl+3".action.move-column-to-workspace = 3; - "Mod+Ctrl+4".action.move-column-to-workspace = 4; - "Mod+Ctrl+5".action.move-column-to-workspace = 5; - "Mod+Ctrl+6".action.move-column-to-workspace = 6; - "Mod+Ctrl+7".action.move-column-to-workspace = 7; - "Mod+Ctrl+8".action.move-column-to-workspace = 8; - "Mod+Ctrl+9".action.move-column-to-workspace = 9; - - # Alternatively, there are commands to move just a single window: - # Mod+Ctrl+1 { move-window-to-workspace 1; } - - # Switches focus between the current and the previous workspace. - # Mod+Tab { focus-workspace-previous; } - - "Mod+Comma".action.consume-window-into-column = {}; - "Mod+Period".action.expel-window-from-column = {}; - - # There are also commands that consume or expel a single window to the side. - "Mod+BracketLeft".action.consume-or-expel-window-left = {}; - "Mod+BracketRight".action.consume-or-expel-window-right = {}; - - "Mod+R".action.switch-preset-column-width = {}; - "Mod+Shift+R".action.reset-window-height = {}; - "Mod+F".action.maximize-column = {}; - "Mod+Shift+F".action.fullscreen-window = {}; - "Mod+C".action.center-column = {}; - - # Finer width adjustments. - # This command can also: - # * set width in pixels: "1000" - # * adjust width in pixels: "-5" or "+5" - # * set width as a percentage of screen width: "25%" - # * adjust width as a percentage of screen width: "-10%" or "+10%" - # Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, - # set-column-width "100" will make the column occupy 200 physical screen pixels. - "Mod+Minus".action.set-column-width = "-10%"; - "Mod+Equal".action.set-column-width = "+10%"; - - # Finer height adjustments when in column with other windows. - "Mod+Shift+Minus".action.set-window-height = "-10%"; - "Mod+Shift+Equal".action.set-window-height = "+10%"; - - "Ctrl+Print".action.screenshot-screen = {}; - "Alt+Print".action.screenshot-window = {}; - - # Powers off the monitors. To turn them back on, do any input like - # moving the mouse or pressing any other key. - "Mod+Shift+P".action.power-off-monitors = {}; - }; - - spawn-at-startup = [ - { command = [ "xwayland-satellite" ]; } - { command = [ "wpaperd" "-d" ]; } - ]; - - workspaces = if "${hostName}" == "Earthmover" then { - "01-DP-1-misc" = { - name = "Miscellaneous"; - open-on-output = "DP-1"; - }; - "02-DP-1-game" = { - name = "Gaming"; - open-on-output = "DP-1"; - }; - "03-DP-2-fullscreen" = { - name = "Fullscreen"; - open-on-output = "DP-2"; - }; - "04-DP-2-misc" = { - name = "Miscellaneous 2"; - open-on-output = "DP-2"; - }; - } - else if "${hostName}" == "Swordsmachine" then { - "01-misc".name = "Miscellaneous"; - "02-fullscreen".name = "Fullscreen"; - "03-game".name = "Gaming"; - } - else {}; - - window-rules = if "${hostName}" == "Earthmover" then [ - { - matches = [{ title = "^Bitwarden$"; }]; - block-out-from = "screen-capture"; - } - { - matches = [{ app-id = "^org.kde.polkit-kde-authentication-agent-1$"; }]; - block-out-from = "screen-capture"; - open-floating = true; - } - # put steam notifications in the bottom right - { - matches = [ - { app-id = "steam"; } - { title = "^notificationtoasts_\d+_desktop$"; } - ]; - default-floating-position = { - x = 10; - y = 10; - relative-to = "bottom-right"; - }; - } - # Gaming (DP-1) - { - matches = [ - { app-id = "steam"; } - { title = "^Steam$"; } - ]; - open-on-workspace = "Gaming"; - open-maximized = true; - } - { - matches = [{ app-id = "heroic"; }]; - open-on-workspace = "Gaming"; - open-maximized = true; - } - { - matches = [{ app-id = "org.prismlauncher.PrismLauncher"; }]; - open-on-workspace = "Gaming"; - } - { - matches = [{ app-id = "vesktop"; }]; - open-on-workspace = "Gaming"; - open-maximized = true; - } - # Fullscreen (DP-2) - { - matches = [{ app-id = "librewolf"; }]; - open-on-workspace = "Fullscreen"; - open-maximized = true; - } - { - matches = [{ app-id = "spotify"; }]; - open-on-workspace = "Fullscreen"; - open-maximized = true; - } - # Miscellaneous 2 (DP-2) - { - matches = [{ app-id = "com.dec05eba.gpu_screen_recorder"; }]; - open-on-workspace = "Miscellaneous 2"; - } - ] - else if "${hostName}" == "Swordsmachine" then [ - { - matches = [{ title = "^Bitwarden$"; }]; - block-out-from = "screen-capture"; - } - { - matches = [{ app-id = "^org.kde.polkit-kde-authentication-agent-1$"; }]; - block-out-from = "screen-capture"; - open-floating = true; - } - # put steam notifications in the bottom right - { - matches = [ - { app-id = "steam"; } - { title = "^notificationtoasts_\d+_desktop$"; } - ]; - default-floating-position = { - x = 10; - y = 10; - relative-to = "bottom-right"; - }; - } - # Miscellaneous - { - matches = [{ app-id = "com.dec05eba.gpu_screen_recorder"; }]; - open-on-workspace = "Miscellaneous"; - open-floating = false; - } - # Gaming - { - matches = [ - { app-id = "steam"; } - { title = "^Steam$"; } - ]; - open-on-workspace = "Gaming"; - open-maximized = true; - } - { - matches = [{ app-id = "heroic"; }]; - open-on-workspace = "Gaming"; - open-maximized = true; - } - { - matches = [{ app-id = "org.prismlauncher.PrismLauncher"; }]; - open-on-workspace = "Gaming"; - } - { - matches = [{ app-id = "vesktop"; }]; - open-on-workspace = "Gaming"; - open-maximized = true; - } - # Fullscreen - { - matches = [{ app-id = "librewolf"; }]; - open-on-workspace = "Fullscreen"; - open-maximized = true; - } - { - matches = [{ app-id = "spotify"; }]; - open-on-workspace = "Fullscreen"; - open-maximized = true; - } - { - matches = [{ app-id = "org.kde.okular"; }]; - open-on-workspace = "Fullscreen"; - open-maximized = true; - } - ] - else []; - }; - }; - - waybar = { - enable = true; - systemd.enable = true; - }; - - rofi = { - enable = true; - package = pkgs.rofi-wayland; - plugins = with pkgs; [ - rofi-calc - ]; - }; - - hyprlock = { - enable = true; - settings = { - general.grace = 5; - - background = { - path = "/home/wo2w/Pictures/uni1.jpg"; - blur_passes = 3; - }; - - label = [ - { - valign = "top"; - position = "0, -400"; - font_size = 128; - text = "$TIME"; - } - { - position = "0, 180"; - font_size = 64; - text = "$DESC"; - } - ]; - - input-field = { - position = "0, -80"; - size = "400, 100"; - }; - }; - }; - }; - - services = { - # notif daemon - mako = { - enable = true; - settings = { - max-history = 10; - default-timeout = 5000; - anchor = "bottom-right"; - }; - }; - - hypridle = { - enable = true; - settings = { - general = { - lock_cmd = "hyprlock"; - before_sleep_cmd = "hyprlock"; - after_sleep_cmd = "hyprlock"; - }; - - listener = [ - { - timeout = 300; - on-timeout = "hyprlock"; - } - { - timeout = 900; - on-timeout = "systemctl sleep"; - } - ]; - }; - }; - }; - }; -} \ No newline at end of file diff --git a/modules/nixos/system/colors.nix b/modules/nixos/system/colors.nix new file mode 100644 index 0000000..bf89e4d --- /dev/null +++ b/modules/nixos/system/colors.nix @@ -0,0 +1,29 @@ +{ config, lib, ... }: + +let + mkVar = + color: + lib.mkOption { + type = lib.types.str; + default = color; + }; +in { + options.custom.colors = { + base00 = mkVar "#17031A"; + base01 = mkVar "#392551"; + base02 = mkVar "#5A496E"; + base03 = mkVar "#7B6D8B"; + base04 = mkVar "#9C92A8"; + base05 = mkVar "#BDB6C5"; + base06 = mkVar "#DEDAE2"; + base07 = mkVar "#FEFFFF"; + base08 = mkVar "#27D9D5"; + base09 = mkVar "#5BA2B6"; + base0A = mkVar "#8F6C97"; + base0B = mkVar "#C33678"; + base0C = mkVar "#F80059"; + base0D = mkVar "#BD0152"; + base0E = mkVar "#82034C"; + base0F = mkVar "#470546"; + }; +} \ No newline at end of file diff --git a/modules/nixos/system/console-colors.nix b/modules/nixos/system/console-colors.nix new file mode 100644 index 0000000..9e4631a --- /dev/null +++ b/modules/nixos/system/console-colors.nix @@ -0,0 +1,27 @@ +{ config, lib, ... }: + +{ + console.colors = + let + toRgb = color: lib.removePrefix "#" color; + + colors = config.custom.colors; + in [ + (toRgb colors.base00) + (toRgb colors.base08) + (toRgb colors.base0C) + "b58900" + "268bd2" + "d33682" + "2aa198" + (toRgb colors.base05) + (toRgb colors.base0D) + (toRgb colors.base08) + (toRgb colors.base0C) + "657b83" + "839496" + "6c71c4" + "93a1a1" + (toRgb colors.base07) + ]; +} \ No newline at end of file diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix index 874fdf4..5b84704 100644 --- a/modules/nixos/system/default.nix +++ b/modules/nixos/system/default.nix @@ -2,11 +2,15 @@ { imports = [ + ./colors.nix + ./console-colors.nix ./desktop.nix ./fonts.nix ./home-manager.nix + ./laptop.nix ./scx.nix ./swap.nix ./yubikey.nix + ./zswap.nix ]; } \ No newline at end of file diff --git a/modules/nixos/system/home-manager.nix b/modules/nixos/system/home-manager.nix index 9711511..8d8fd67 100755 --- a/modules/nixos/system/home-manager.nix +++ b/modules/nixos/system/home-manager.nix @@ -8,11 +8,9 @@ useUserPackages = true; backupFileExtension = "bak"; extraSpecialArgs = { inherit inputs; }; - users.wo2w = { - home = { - username = "wo2w"; - homeDirectory = "/home/wo2w"; - }; + users.wo2w.home = { + username = "wo2w"; + homeDirectory = "/home/wo2w"; }; }; } \ No newline at end of file