diff --git a/flake.lock b/flake.lock index b6e33bb..1a5f76f 100644 --- a/flake.lock +++ b/flake.lock @@ -74,6 +74,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -216,6 +232,29 @@ "type": "github" } }, + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1723340593, + "narHash": "sha256-SYrNboypGpiFlE6g3UWdfqJeMihR0dBJPAwTwO6T64A=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "94a1e5a4888ab0cb5ad0fe602d03d867a320348b", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1722421184, @@ -232,6 +271,22 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1722987190, + "narHash": "sha256-68hmex5efCiM2aZlAAEcQgmFI4ZwWt8a80vOeB/5w3A=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "21cc704b5e918c5fbf4f9fff22b4ac2681706d90", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1722813957, @@ -248,22 +303,6 @@ "type": "github" } }, - "nixpkgs_3": { - "locked": { - "lastModified": 1713128889, - "narHash": "sha256-aB90ZqzosyRDpBh+rILIcyP5lao8SKz8Sr2PSWvZrzk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "2748d22b45a99fb2deafa5f11c7531c212b2cefa", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "locked": { "lastModified": 1722934043, @@ -314,50 +353,32 @@ "nekowinston-nur": "nekowinston-nur", "nix-index-database": "nix-index-database", "nix-vscode-extensions": "nix-vscode-extensions", + "nixos-cosmic": "nixos-cosmic", "nixpkgs": "nixpkgs_2", "nur": "nur", "pre-commit-hooks": "pre-commit-hooks", - "swayfx": "swayfx", "vscode-server": "vscode-server", "wsl": "wsl" } }, - "scenefx": { - "inputs": { - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1715160751, - "narHash": "sha256-S8m7phTU7QYgAq4B0hjH5WdtTjHDcNVhYfPFdhbty+A=", - "owner": "wlrfx", - "repo": "scenefx", - "rev": "2ec3505248e819191c37cb831197629f373326fb", - "type": "github" - }, - "original": { - "owner": "wlrfx", - "repo": "scenefx", - "type": "github" - } - }, - "swayfx": { + "rust-overlay": { "inputs": { "nixpkgs": [ + "nixos-cosmic", "nixpkgs" - ], - "scenefx": "scenefx" + ] }, "locked": { - "lastModified": 1722269591, - "narHash": "sha256-uqRVQmhtswgbM9bp4bIkQhS1J2fYqOuLo/Rt9ZpLT7I=", - "owner": "willpower3309", - "repo": "swayfx", - "rev": "4d7ca7d975fb6d8ccae9830765986d5812fd011d", + "lastModified": 1723256423, + "narHash": "sha256-9iDTrfVM+mbcad31a47oqW8t8tfSA4C/si6F8F2DO/w=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "615cfd85b4d9c51811a8d875374268fab5bd4089", "type": "github" }, "original": { - "owner": "willpower3309", - "repo": "swayfx", + "owner": "oxalica", + "repo": "rust-overlay", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 0f2559a..63dcedb 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ system = "x86_64-linux"; username = "winston"; isGraphical = true; + extraModules = [ inputs.nixos-cosmic.nixosModules.default ]; } { host = "yuba"; @@ -110,12 +111,14 @@ nixConfig = { extra-substituters = [ "https://nix-community.cachix.org" + "https://cosmic.cachix.org" "https://pre-commit-hooks.cachix.org" "https://nekowinston.cachix.org" "https://mic92.cachix.org" ]; extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" "nekowinston.cachix.org-1:lucpmaO+JwtoZj16HCO1p1fOv68s/RL1gumpVzRHRDs=" "mic92.cachix.org-1:gi8IhgiT3CYZnJsaW7fxznzTkMUOn1RY4GmXdT/nXYQ=" @@ -159,10 +162,6 @@ inputs.flake-utils.follows = "flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; }; - swayfx = { - url = "github:willpower3309/swayfx"; - inputs.nixpkgs.follows = "nixpkgs"; - }; vscode-server = { url = "github:nix-community/nixos-vscode-server"; inputs.flake-utils.follows = "flake-utils"; @@ -180,5 +179,10 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs-stable.follows = "nixpkgs"; }; + + nixos-cosmic = { + url = "github:lilyinstarlight/nixos-cosmic"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; } diff --git a/home/apps/browsers.nix b/home/apps/browsers.nix index 96815c3..b12c650 100644 --- a/home/apps/browsers.nix +++ b/home/apps/browsers.nix @@ -15,7 +15,7 @@ in }; programs.firefox = { - enable = isLinux; + enable = false; profiles.default = { search.default = "DuckDuckGo"; search.force = true; diff --git a/home/apps/gnome.nix b/home/apps/gnome.nix index 0dd2774..0915fe3 100644 --- a/home/apps/gnome.nix +++ b/home/apps/gnome.nix @@ -11,70 +11,68 @@ let wallpaper-uri = "file://${../wallpapers/dhm_1610.png}"; in { - config = - lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "gnome")) - { - home.packages = with pkgs.gnomeExtensions; [ - appindicator - blur-my-shell - mullvad-indicator - native-window-placement - noannoyance-fork - pop-shell - user-themes - pkgs.pop-launcher - ]; + config = lib.mkIf (osConfig.dotfiles.desktop == "gnome") { + home.packages = with pkgs.gnomeExtensions; [ + appindicator + blur-my-shell + mullvad-indicator + native-window-placement + noannoyance-fork + pop-shell + user-themes + pkgs.pop-launcher + ]; - dconf.settings = with lib.hm.gvariant; { - # input - "org/gnome/desktop/wm/preferences" = { - resize-with-right-button = true; - }; - "org/gnome/desktop/input-sources" = { - sources = [ - (mkTuple [ - "xkb" - "us" - ]) - ]; - xkb-options = [ "caps:ctrl_modifier" ]; - }; - - # rice - "org/gnome/shell" = { - disable-user-extensions = false; - enabled-extensions = [ - "appindicatorsupport@rgcjonas.gmail.com" - "blur-my-shell@aunetx" - "drive-menu@gnome-shell-extensions.gcampax.github.com" - "mullvadindicator@pobega.github.com" - "noannoyance-fork@vrba.dev" - "user-theme@gnome-shell-extensions.gcampax.github.com" - ]; - favorite-apps = [ - "org.gnome.Nautilus.desktop" - "chromium-browser.desktop" - "org.wezfurlong.wezterm.desktop" - ]; - }; - "org/gnome/shell/extensions/user-theme" = { - name = "WhiteSur-Light"; - }; - - # wallpaper - "org/gnome/desktop/background" = { - color-shading-type = "solid"; - picture-options = "zoom"; - picture-uri = wallpaper-uri; - picture-uri-dark = wallpaper-uri; - inherit primary-color secondary-color; - }; - "org/gnome/desktop/screensaver" = { - color-shading-type = "solid"; - picture-options = "zoom"; - picture-uri = wallpaper-uri; - inherit primary-color secondary-color; - }; - }; + dconf.settings = with lib.hm.gvariant; { + # input + "org/gnome/desktop/wm/preferences" = { + resize-with-right-button = true; }; + "org/gnome/desktop/input-sources" = { + sources = [ + (mkTuple [ + "xkb" + "us" + ]) + ]; + xkb-options = [ "caps:ctrl_modifier" ]; + }; + + # rice + "org/gnome/shell" = { + disable-user-extensions = false; + enabled-extensions = [ + "appindicatorsupport@rgcjonas.gmail.com" + "blur-my-shell@aunetx" + "drive-menu@gnome-shell-extensions.gcampax.github.com" + "mullvadindicator@pobega.github.com" + "noannoyance-fork@vrba.dev" + "user-theme@gnome-shell-extensions.gcampax.github.com" + ]; + favorite-apps = [ + "org.gnome.Nautilus.desktop" + "chromium-browser.desktop" + "org.wezfurlong.wezterm.desktop" + ]; + }; + "org/gnome/shell/extensions/user-theme" = { + name = "WhiteSur-Light"; + }; + + # wallpaper + "org/gnome/desktop/background" = { + color-shading-type = "solid"; + picture-options = "zoom"; + picture-uri = wallpaper-uri; + picture-uri-dark = wallpaper-uri; + inherit primary-color secondary-color; + }; + "org/gnome/desktop/screensaver" = { + color-shading-type = "solid"; + picture-options = "zoom"; + picture-uri = wallpaper-uri; + inherit primary-color secondary-color; + }; + }; + }; } diff --git a/home/apps/gtk.nix b/home/apps/gtk.nix index 079f303..9a46eaa 100644 --- a/home/apps/gtk.nix +++ b/home/apps/gtk.nix @@ -11,7 +11,7 @@ in config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux) { home.pointerCursor = { name = "macOS-Monterey"; - package = pkgs.nur.repos.nekowinston.apple-cursor; + package = pkgs.apple-cursor; size = 24; }; diff --git a/home/apps/hyprland.nix b/home/apps/hyprland.nix index e703f48..6a017e7 100644 --- a/home/apps/hyprland.nix +++ b/home/apps/hyprland.nix @@ -6,143 +6,141 @@ ... }: { - config = - lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "sway")) - { - home = { - packages = with pkgs; [ - blueberry - grimblast - hyprpicker - kooha - libnotify - pavucontrol - swaybg - swayosd - wl-clipboard - ]; - }; + config = lib.mkIf (osConfig.dotfiles.desktop == "hyprland") { + home = { + packages = with pkgs; [ + blueberry + grimblast + hyprpicker + kooha + libnotify + pavucontrol + swaybg + swayosd + wl-clipboard + ]; + }; - services = { - clipman.enable = true; - gnome-keyring = { - enable = true; - components = [ "secrets" ]; - }; - wlsunset = { - enable = true; - latitude = toString config.location.latitude; - longitude = toString config.location.longitude; - }; - udiskie.enable = true; - }; - - wayland.windowManager.hyprland = - let - mod = "SUPER"; - modFocus = "${mod}_CTRL"; - modMove = "${mod}_SHIFT"; - hyper = "SUPER_CTRL_SHIFT_ALT"; - swayosd = pkgs.swayosd + "/bin/swayosd-client"; - playerctl = "${pkgs.playerctl}/bin/playerctl"; - in - { - enable = true; - settings = { - monitor = ",preferred,auto,2"; - input.follow_mouse = 1; - env = [ - "MOZ_ENABLE_WAYLAND, 1" - "NIXOS_OZONE_WL, 1" - "QT_QPA_PLATFORM, wayland" - "QT_QPA_PLATFORMTHEME, qt5ct" - "SDL_VIDEODRIVER, wayland" - "GDK_SCALE, 2" - "XCURSOR_SIZE, 24" - "XDG_CURRENT_DESKTOP, hyprland" - "XDG_SESSION_DESKTOP, hyprland" - "XDG_SESSION_TYPE, wayland" - "_JAVA_AWT_WM_NONREPARENTING, 1" - ]; - xwayland.force_zero_scaling = true; - general = { - gaps_in = 2; - gaps_out = 5; - border_size = 2; - "col.active_border" = "0xfff5c2e7"; - "col.inactive_border" = "0x80cba6f7"; - }; - misc = { - disable_hyprland_logo = true; - disable_splash_rendering = true; - }; - decoration.rounding = 5; - dwindle.preserve_split = true; - windowrulev2 = [ "suppressevent maximize, class:.*" ]; - bind = [ - "${modMove}, return, exec, kitty" - "${modMove}, q, killactive," - "${modMove}, m, exit," - "${modMove}, d, togglefloating," - "${mod}, space, exec, rofi -show drun" - "${modMove}, space, exec, 1password --quick-access" - "${hyper}, p, exec, grimblast --notify --freeze copy area" - "${modMove}, p, exec, hyprpicker -a" - - "${modFocus}, h, movefocus, l" - "${modFocus}, j, movefocus, d" - "${modFocus}, k, movefocus, u" - "${modFocus}, l, movefocus, r" - "${modMove}, h, movewindow, l" - "${modMove}, j, movewindow, u" - "${modMove}, k, movewindow, d" - "${modMove}, l, movewindow, r" - - "${modFocus}, 1, workspace, 1" - "${modFocus}, 2, workspace, 2" - "${modFocus}, 3, workspace, 3" - "${modFocus}, 4, workspace, 4" - "${modFocus}, 5, workspace, 5" - "${modFocus}, 6, workspace, 6" - "${modFocus}, 7, workspace, 7" - "${modFocus}, 8, workspace, 8" - "${modFocus}, 9, workspace, 9" - "${modFocus}, 0, workspace, 10" - - "${modMove}, 1, movetoworkspace, 1" - "${modMove}, 2, movetoworkspace, 2" - "${modMove}, 3, movetoworkspace, 3" - "${modMove}, 4, movetoworkspace, 4" - "${modMove}, 5, movetoworkspace, 5" - "${modMove}, 6, movetoworkspace, 6" - "${modMove}, 7, movetoworkspace, 7" - "${modMove}, 8, movetoworkspace, 8" - "${modMove}, 9, movetoworkspace, 9" - "${modMove}, 0, movetoworkspace, 10" - "${mod}, tab, togglespecialworkspace, magic" - "${modMove}, tab, movetoworkspace, special:magic" - - ", XF86AudioMute, exec, ${swayosd} --output-volume mute-toggle" - ", XF86AudioNext, exec, ${playerctl} next" - ", XF86AudioPrev, exec, ${playerctl} previous" - ", XF86AudioPause, exec, ${playerctl} play-pause" - ]; - binde = [ - ", XF86AudioRaiseVolume, exec, ${swayosd} --output-volume 5" - ", XF86AudioLowerVolume, exec, ${swayosd} --output-volume -5" - ]; - bindm = [ - "SUPER, mouse:272, movewindow" - "SUPER, mouse:273, resizewindow" - ]; - exec = [ - "${pkgs.swayosd}/bin/swayosd-server" - "${pkgs.swaybg}/bin/swaybg -o '*' -m fill -i ${../wallpapers/dhm_1610.png}" - ]; - exec-once = [ "${config.programs.waybar.package}/bin/waybar -b hyprland" ]; - plugin.hy3.autotile.enable = true; - }; - plugins = [ pkgs.hyprlandPlugins.hy3 ]; - }; + services = { + clipman.enable = true; + gnome-keyring = { + enable = true; + components = [ "secrets" ]; }; + wlsunset = { + enable = true; + latitude = toString config.location.latitude; + longitude = toString config.location.longitude; + }; + udiskie.enable = true; + }; + + wayland.windowManager.hyprland = + let + mod = "SUPER"; + modFocus = "${mod}_CTRL"; + modMove = "${mod}_SHIFT"; + hyper = "SUPER_CTRL_SHIFT_ALT"; + swayosd = pkgs.swayosd + "/bin/swayosd-client"; + playerctl = "${pkgs.playerctl}/bin/playerctl"; + in + { + enable = true; + settings = { + monitor = ",preferred,auto,2"; + input.follow_mouse = 1; + env = [ + "MOZ_ENABLE_WAYLAND, 1" + "NIXOS_OZONE_WL, 1" + "QT_QPA_PLATFORM, wayland" + "QT_QPA_PLATFORMTHEME, qt5ct" + "SDL_VIDEODRIVER, wayland" + "GDK_SCALE, 2" + "XCURSOR_SIZE, 24" + "XDG_CURRENT_DESKTOP, hyprland" + "XDG_SESSION_DESKTOP, hyprland" + "XDG_SESSION_TYPE, wayland" + "_JAVA_AWT_WM_NONREPARENTING, 1" + ]; + xwayland.force_zero_scaling = true; + general = { + gaps_in = 2; + gaps_out = 5; + border_size = 2; + "col.active_border" = "0xfff5c2e7"; + "col.inactive_border" = "0x80cba6f7"; + }; + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + decoration.rounding = 5; + dwindle.preserve_split = true; + windowrulev2 = [ "suppressevent maximize, class:.*" ]; + bind = [ + "${modMove}, return, exec, kitty" + "${modMove}, q, killactive," + "${modMove}, m, exit," + "${modMove}, d, togglefloating," + "${mod}, space, exec, rofi -show drun" + "${modMove}, space, exec, 1password --quick-access" + "${hyper}, p, exec, grimblast --notify --freeze copy area" + "${modMove}, p, exec, hyprpicker -a" + + "${modFocus}, h, movefocus, l" + "${modFocus}, j, movefocus, d" + "${modFocus}, k, movefocus, u" + "${modFocus}, l, movefocus, r" + "${modMove}, h, movewindow, l" + "${modMove}, j, movewindow, u" + "${modMove}, k, movewindow, d" + "${modMove}, l, movewindow, r" + + "${modFocus}, 1, workspace, 1" + "${modFocus}, 2, workspace, 2" + "${modFocus}, 3, workspace, 3" + "${modFocus}, 4, workspace, 4" + "${modFocus}, 5, workspace, 5" + "${modFocus}, 6, workspace, 6" + "${modFocus}, 7, workspace, 7" + "${modFocus}, 8, workspace, 8" + "${modFocus}, 9, workspace, 9" + "${modFocus}, 0, workspace, 10" + + "${modMove}, 1, movetoworkspace, 1" + "${modMove}, 2, movetoworkspace, 2" + "${modMove}, 3, movetoworkspace, 3" + "${modMove}, 4, movetoworkspace, 4" + "${modMove}, 5, movetoworkspace, 5" + "${modMove}, 6, movetoworkspace, 6" + "${modMove}, 7, movetoworkspace, 7" + "${modMove}, 8, movetoworkspace, 8" + "${modMove}, 9, movetoworkspace, 9" + "${modMove}, 0, movetoworkspace, 10" + "${mod}, tab, togglespecialworkspace, magic" + "${modMove}, tab, movetoworkspace, special:magic" + + ", XF86AudioMute, exec, ${swayosd} --output-volume mute-toggle" + ", XF86AudioNext, exec, ${playerctl} next" + ", XF86AudioPrev, exec, ${playerctl} previous" + ", XF86AudioPause, exec, ${playerctl} play-pause" + ]; + binde = [ + ", XF86AudioRaiseVolume, exec, ${swayosd} --output-volume 5" + ", XF86AudioLowerVolume, exec, ${swayosd} --output-volume -5" + ]; + bindm = [ + "SUPER, mouse:272, movewindow" + "SUPER, mouse:273, resizewindow" + ]; + exec = [ + "${pkgs.swayosd}/bin/swayosd-server" + "${pkgs.swaybg}/bin/swaybg -o '*' -m fill -i ${../wallpapers/dhm_1610.png}" + ]; + exec-once = [ "${config.programs.waybar.package}/bin/waybar -b hyprland" ]; + plugin.hy3.autotile.enable = true; + }; + plugins = [ pkgs.hyprlandPlugins.hy3 ]; + }; + }; } diff --git a/home/apps/sway.nix b/home/apps/sway.nix index 4a021be..d9cd494 100644 --- a/home/apps/sway.nix +++ b/home/apps/sway.nix @@ -23,342 +23,340 @@ let }; in { - config = - lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux && (osConfig.dotfiles.desktop == "sway")) - { - fonts.fontconfig.enable = true; + config = lib.mkIf (osConfig.dotfiles.desktop == "sway") { + fonts.fontconfig.enable = true; - home = { - packages = with pkgs; [ - blueberry - kooha - libnotify - pavucontrol - sway-contrib.grimshot - swaynotificationcenter - swayosd - wl-clipboard + home = { + packages = with pkgs; [ + blueberry + kooha + libnotify + pavucontrol + sway-contrib.grimshot + swaynotificationcenter + swayosd + wl-clipboard + ]; + }; + + services = { + clipman.enable = true; + gnome-keyring = { + enable = true; + components = [ "secrets" ]; + }; + wlsunset = { + enable = true; + latitude = toString config.location.latitude; + longitude = toString config.location.longitude; + }; + udiskie.enable = true; + }; + + wayland.windowManager.sway = + let + modifier = "Mod4"; + in + { + enable = true; + package = null; + checkConfig = false; + config = rec { + inherit modifier; + focus.wrapping = "no"; + focus.mouseWarping = "container"; + startup = [ + { + command = "${pkgs.autotiling}/bin/autotiling -l2"; + always = true; + } + { command = "1password --silent"; } + { + command = '' + swayidle -w \ + timeout 180 'swaylock -f' \ + timeout 360 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f' + ''; + always = true; + } + { + command = "${pkgs.swayosd}/bin/swayosd-server"; + always = true; + } + { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } + ]; + workspaceAutoBackAndForth = true; + terminal = "${config.programs.wezterm.package}/bin/wezterm"; + menu = "${config.programs.rofi.package}/bin/rofi"; + defaultWorkspace = "workspace number 1"; + input."type:keyboard".xkb_options = "ctrl:nocaps,compose:ralt"; + output."*" = { + scale = "2"; + bg = "${../wallpapers/dhm_1610.png} fill #171320"; + }; + keybindings = + let + mod = modifier; + modMove = "${mod}+Shift"; + modFocus = "${mod}+Ctrl"; + hyper = "Mod4+Mod1+Shift+Ctrl"; + + filebrowser = "${pkgs.nautilus}/bin/nautilus"; + screenshot = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; + playerctl = "${pkgs.playerctl}/bin/playerctl"; + swayosd = pkgs.swayosd + "/bin/swayosd-client"; + in + { + "${mod}+Shift+b" = "border none"; + "${mod}+b" = "border pixel 2"; + "${mod}+n" = "border normal"; + # reload the configuration file + "${mod}+Shift+r" = "reload"; + # kill focused window + "${mod}+Shift+q" = "kill"; + # Start Applications + "${mod}+Shift+Return" = "exec ${terminal}"; + "${mod}+e" = "exec --no-startup-id ${filebrowser}"; + "${hyper}+p" = "exec --no-startup-id ${screenshot}"; + + # change focus + "${modFocus}+h" = "focus left"; + "${modFocus}+j" = "focus down"; + "${modFocus}+k" = "focus up"; + "${modFocus}+l" = "focus right"; + "${modFocus}+Left" = "focus left"; + "${modFocus}+Down" = "focus down"; + "${modFocus}+Up" = "focus up"; + "${modFocus}+Right" = "focus right"; + # move focus + "${modMove}+h" = "move left"; + "${modMove}+j" = "move down"; + "${modMove}+k" = "move up"; + "${modMove}+l" = "move right"; + "${modMove}+Left" = "move left"; + "${modMove}+Down" = "move down"; + "${modMove}+Up" = "move up"; + "${modMove}+Right" = "move right"; + + # move workspaces across monitors + "${modMove}+greater" = "move workspace to output right"; + "${modMove}+less" = "move workspace to output left"; + + # split orientation + "${mod}+q" = "split toggle"; + + # toggle fullscreen mode for the focused container + "${mod}+f" = "fullscreen toggle"; + + # change container layout (stacked, tabbed, toggle split) + "${mod}+s" = "layout toggle"; + + # toggle tiling / floating + "${mod}+Shift+d" = "floating toggle"; + # change focus between tiling / floating windows + "${mod}+d" = "focus mode_toggle"; + + # toggle sticky + "${mod}+Shift+s" = "sticky toggle"; + + # focus the parent container + "${mod}+a" = "focus parent"; + + # move the currently focused window to the scratchpad + "${mod}+Shift+Tab" = "move scratchpad"; + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + "${mod}+Tab" = "scratchpad show"; + "${mod}+m" = "[class=\"discord\"] scratchpad show"; + + # switch to workspace + "${modFocus}+1" = "workspace 1"; + "${modFocus}+2" = "workspace 2"; + "${modFocus}+3" = "workspace 3"; + "${modFocus}+4" = "workspace 4"; + "${modFocus}+5" = "workspace 5"; + "${modFocus}+6" = "workspace 6"; + "${modFocus}+7" = "workspace 7"; + "${modFocus}+8" = "workspace 8"; + "${modFocus}+9" = "workspace 9"; + "${modFocus}+0" = "workspace 10"; + # Move to workspace with focused container + "${modMove}+1" = "move container to workspace 1; workspace 1"; + "${modMove}+2" = "move container to workspace 2; workspace 2"; + "${modMove}+3" = "move container to workspace 3; workspace 3"; + "${modMove}+4" = "move container to workspace 4; workspace 4"; + "${modMove}+5" = "move container to workspace 5; workspace 5"; + "${modMove}+6" = "move container to workspace 6; workspace 6"; + "${modMove}+7" = "move container to workspace 7; workspace 7"; + "${modMove}+8" = "move container to workspace 8; workspace 8"; + "${modMove}+9" = "move container to workspace 9; workspace 9"; + "${modMove}+0" = "move container to workspace 10; workspace 10"; + # rofi instead of drun + "${mod}+space" = "exec --no-startup-id ${menu} -show drun -dpi $dpi"; + # 1password + "${mod}+Shift+space" = "exec ${pkgs._1password-gui}/bin/1password --quick-access"; + + # audio + "XF86AudioRaiseVolume" = "exec ${swayosd} --output-volume 5"; + "XF86AudioLowerVolume" = "exec ${swayosd} --output-volume -5"; + "XF86AudioMute" = "exec ${swayosd} --output-volume mute-toggle"; + "XF86AudioNext" = "exec --no-startup-id ${playerctl} next"; + "XF86AudioPrev" = "exec --no-startup-id ${playerctl} previous"; + "XF86AudioPlay" = "exec --no-startup-id ${playerctl} play-pause"; + + # modes + "${mod}+r" = "mode \"resize\""; + "${mod}+p" = "mode \"power: (l)ock, (e)xit, (r)eboot, (s)uspend, (h)ibernate, (S)hut off\""; + }; + modes = { + "power: (l)ock, (e)xit, (r)eboot, (s)uspend, (h)ibernate, (S)hut off" = { + l = "exec --no-startup-id swaylock --color 000000, mode \"default\""; + e = "exec --no-startup-id swaymsg exit, mode \"default\""; + r = "exec --no-startup-id systemctl reboot, mode \"default\""; + s = "exec --no-startup-id systemctl suspend, mode \"default\""; + h = "exec --no-startup-id systemctl hibernate, mode \"default\""; + "Shift+s" = "exec --no-startup-id systemctl poweroff, mode \"default\""; + Escape = "mode default"; + Return = "mode default"; + }; + resize = { + Escape = "mode default"; + Return = "mode default"; + h = "resize shrink width 10 px or 10 ppt"; + j = "resize grow height 10 px or 10 ppt"; + k = "resize shrink height 10 px or 10 ppt"; + l = "resize grow width 10 px or 10 ppt"; + R = "resize set 50 ppt 50 ppt"; + }; + }; + inherit fonts; + colors = rec { + focused = { + background = ctp.base; + border = ctp.pink; + childBorder = ctp.pink; + indicator = ctp.pink; + inherit (ctp) text; + }; + urgent = { + background = ctp.base; + border = ctp.red; + childBorder = ctp.red; + indicator = ctp.red; + inherit (ctp) text; + }; + unfocused = { + background = ctp.base; + border = ctp.mauve; + childBorder = ctp.mauve; + indicator = ctp.mauve; + inherit (ctp) text; + }; + focusedInactive = unfocused; + placeholder = unfocused; + }; + window = { + titlebar = false; + hideEdgeBorders = "none"; + border = 2; + }; + gaps = { + inner = 5; + outer = 2; + }; + bars = [ + { + inherit fonts; + mode = "hide"; + position = "top"; + statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs ~/.config/i3status-rust/config-top.toml"; + } ]; }; - services = { - clipman.enable = true; - gnome-keyring = { - enable = true; - components = [ "secrets" ]; - }; - wlsunset = { - enable = true; - latitude = toString config.location.latitude; - longitude = toString config.location.longitude; - }; - udiskie.enable = true; + extraConfig = '' + for_window [floating] border pixel 2 + + # floating sticky + for_window [class="1Password"] floating enable sticky enable + for_window [window_role="PictureInPicture"] floating enable sticky enable + + # floating + for_window [class="GParted"] floating enable + for_window [title="(?i)SteamTinkerLaunch"] floating enable + for_window [title="Blender Render"] floating enable + + # general WM role settings + for_window [title="splash"] floating enable + for_window [urgent=latest] focus + for_window [window_role="pop-up"] floating enable + for_window [window_role="task_dialog"] floating enable + + # apps + for_window [class="Pavucontrol"] floating enable + for_window [class="Yad" title="Authentication"] floating enable + for_window [class="jetbrains*" title="Welcome*"] floating enable + for_window [title="File Transfer*"] floating enable + for_window [title="Steam Guard*"] floating enable + + # keep apps in scratchpad + for_window [class="discord"] move scratchpad sticky + + set $mode_gaps Gaps: (o)uter, (i)nner + set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) + set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) + bindsym ${modifier}+Shift+g mode "$mode_gaps" + + mode "$mode_gaps" { + bindsym o mode "$mode_gaps_outer" + bindsym i mode "$mode_gaps_inner" + bindsym Return mode "$mode_gaps" + bindsym Escape mode "default" + } + mode "$mode_gaps_outer" { + bindsym plus gaps outer current plus 5 + bindsym minus gaps outer current minus 5 + bindsym 0 gaps outer current set 0 + + bindsym Shift+plus gaps outer all plus 5 + bindsym Shift+minus gaps outer all minus 5 + bindsym Shift+0 gaps outer all set 0 + + bindsym Return mode "$mode_gaps" + bindsym Escape mode "default" + } + mode "$mode_gaps_inner" { + bindsym plus gaps inner current plus 5 + bindsym minus gaps inner current minus 5 + bindsym 0 gaps inner current set 0 + + bindsym Shift+plus gaps inner all plus 5 + bindsym Shift+minus gaps inner all minus 5 + bindsym Shift+0 gaps inner all set 0 + + bindsym Return mode "$mode_gaps" + bindsym Escape mode "default" + } + + shadows enable + shadow_color #11111b99 + shadow_blur_radius 20 + + corner_radius 5 + smart_corner_radius enable + + blur enable + blur_passes 2 + blur_radius 4 + + layer_effects "swaync-notification-window" blur enable; shadows enable; corner_radius 5; + ''; + systemd = { + enable = true; + xdgAutostart = true; }; - - wayland.windowManager.sway = - let - modifier = "Mod4"; - in - { - enable = true; - package = null; - checkConfig = false; - config = rec { - inherit modifier; - focus.wrapping = "no"; - focus.mouseWarping = "container"; - startup = [ - { - command = "${pkgs.autotiling}/bin/autotiling -l2"; - always = true; - } - { command = "1password --silent"; } - { - command = '' - swayidle -w \ - timeout 180 'swaylock -f' \ - timeout 360 'swaymsg "output * dpms off"' \ - resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock -f' - ''; - always = true; - } - { - command = "${pkgs.swayosd}/bin/swayosd-server"; - always = true; - } - { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } - ]; - workspaceAutoBackAndForth = true; - terminal = "${config.programs.wezterm.package}/bin/wezterm"; - menu = "${config.programs.rofi.package}/bin/rofi"; - defaultWorkspace = "workspace number 1"; - input."type:keyboard".xkb_options = "ctrl:nocaps,compose:ralt"; - output."*" = { - scale = "2"; - bg = "${../wallpapers/dhm_1610.png} fill #171320"; - }; - keybindings = - let - mod = modifier; - modMove = "${mod}+Shift"; - modFocus = "${mod}+Ctrl"; - hyper = "Mod4+Mod1+Shift+Ctrl"; - - filebrowser = "${pkgs.nautilus}/bin/nautilus"; - screenshot = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; - playerctl = "${pkgs.playerctl}/bin/playerctl"; - swayosd = pkgs.swayosd + "/bin/swayosd-client"; - in - { - "${mod}+Shift+b" = "border none"; - "${mod}+b" = "border pixel 2"; - "${mod}+n" = "border normal"; - # reload the configuration file - "${mod}+Shift+r" = "reload"; - # kill focused window - "${mod}+Shift+q" = "kill"; - # Start Applications - "${mod}+Shift+Return" = "exec ${terminal}"; - "${mod}+e" = "exec --no-startup-id ${filebrowser}"; - "${hyper}+p" = "exec --no-startup-id ${screenshot}"; - - # change focus - "${modFocus}+h" = "focus left"; - "${modFocus}+j" = "focus down"; - "${modFocus}+k" = "focus up"; - "${modFocus}+l" = "focus right"; - "${modFocus}+Left" = "focus left"; - "${modFocus}+Down" = "focus down"; - "${modFocus}+Up" = "focus up"; - "${modFocus}+Right" = "focus right"; - # move focus - "${modMove}+h" = "move left"; - "${modMove}+j" = "move down"; - "${modMove}+k" = "move up"; - "${modMove}+l" = "move right"; - "${modMove}+Left" = "move left"; - "${modMove}+Down" = "move down"; - "${modMove}+Up" = "move up"; - "${modMove}+Right" = "move right"; - - # move workspaces across monitors - "${modMove}+greater" = "move workspace to output right"; - "${modMove}+less" = "move workspace to output left"; - - # split orientation - "${mod}+q" = "split toggle"; - - # toggle fullscreen mode for the focused container - "${mod}+f" = "fullscreen toggle"; - - # change container layout (stacked, tabbed, toggle split) - "${mod}+s" = "layout toggle"; - - # toggle tiling / floating - "${mod}+Shift+d" = "floating toggle"; - # change focus between tiling / floating windows - "${mod}+d" = "focus mode_toggle"; - - # toggle sticky - "${mod}+Shift+s" = "sticky toggle"; - - # focus the parent container - "${mod}+a" = "focus parent"; - - # move the currently focused window to the scratchpad - "${mod}+Shift+Tab" = "move scratchpad"; - # Show the next scratchpad window or hide the focused scratchpad window. - # If there are multiple scratchpad windows, this command cycles through them. - "${mod}+Tab" = "scratchpad show"; - "${mod}+m" = "[class=\"discord\"] scratchpad show"; - - # switch to workspace - "${modFocus}+1" = "workspace 1"; - "${modFocus}+2" = "workspace 2"; - "${modFocus}+3" = "workspace 3"; - "${modFocus}+4" = "workspace 4"; - "${modFocus}+5" = "workspace 5"; - "${modFocus}+6" = "workspace 6"; - "${modFocus}+7" = "workspace 7"; - "${modFocus}+8" = "workspace 8"; - "${modFocus}+9" = "workspace 9"; - "${modFocus}+0" = "workspace 10"; - # Move to workspace with focused container - "${modMove}+1" = "move container to workspace 1; workspace 1"; - "${modMove}+2" = "move container to workspace 2; workspace 2"; - "${modMove}+3" = "move container to workspace 3; workspace 3"; - "${modMove}+4" = "move container to workspace 4; workspace 4"; - "${modMove}+5" = "move container to workspace 5; workspace 5"; - "${modMove}+6" = "move container to workspace 6; workspace 6"; - "${modMove}+7" = "move container to workspace 7; workspace 7"; - "${modMove}+8" = "move container to workspace 8; workspace 8"; - "${modMove}+9" = "move container to workspace 9; workspace 9"; - "${modMove}+0" = "move container to workspace 10; workspace 10"; - # rofi instead of drun - "${mod}+space" = "exec --no-startup-id ${menu} -show drun -dpi $dpi"; - # 1password - "${mod}+Shift+space" = "exec ${pkgs._1password-gui}/bin/1password --quick-access"; - - # audio - "XF86AudioRaiseVolume" = "exec ${swayosd} --output-volume 5"; - "XF86AudioLowerVolume" = "exec ${swayosd} --output-volume -5"; - "XF86AudioMute" = "exec ${swayosd} --output-volume mute-toggle"; - "XF86AudioNext" = "exec --no-startup-id ${playerctl} next"; - "XF86AudioPrev" = "exec --no-startup-id ${playerctl} previous"; - "XF86AudioPlay" = "exec --no-startup-id ${playerctl} play-pause"; - - # modes - "${mod}+r" = "mode \"resize\""; - "${mod}+p" = "mode \"power: (l)ock, (e)xit, (r)eboot, (s)uspend, (h)ibernate, (S)hut off\""; - }; - modes = { - "power: (l)ock, (e)xit, (r)eboot, (s)uspend, (h)ibernate, (S)hut off" = { - l = "exec --no-startup-id swaylock --color 000000, mode \"default\""; - e = "exec --no-startup-id swaymsg exit, mode \"default\""; - r = "exec --no-startup-id systemctl reboot, mode \"default\""; - s = "exec --no-startup-id systemctl suspend, mode \"default\""; - h = "exec --no-startup-id systemctl hibernate, mode \"default\""; - "Shift+s" = "exec --no-startup-id systemctl poweroff, mode \"default\""; - Escape = "mode default"; - Return = "mode default"; - }; - resize = { - Escape = "mode default"; - Return = "mode default"; - h = "resize shrink width 10 px or 10 ppt"; - j = "resize grow height 10 px or 10 ppt"; - k = "resize shrink height 10 px or 10 ppt"; - l = "resize grow width 10 px or 10 ppt"; - R = "resize set 50 ppt 50 ppt"; - }; - }; - inherit fonts; - colors = rec { - focused = { - background = ctp.base; - border = ctp.pink; - childBorder = ctp.pink; - indicator = ctp.pink; - inherit (ctp) text; - }; - urgent = { - background = ctp.base; - border = ctp.red; - childBorder = ctp.red; - indicator = ctp.red; - inherit (ctp) text; - }; - unfocused = { - background = ctp.base; - border = ctp.mauve; - childBorder = ctp.mauve; - indicator = ctp.mauve; - inherit (ctp) text; - }; - focusedInactive = unfocused; - placeholder = unfocused; - }; - window = { - titlebar = false; - hideEdgeBorders = "none"; - border = 2; - }; - gaps = { - inner = 5; - outer = 2; - }; - bars = [ - { - inherit fonts; - mode = "hide"; - position = "top"; - statusCommand = "${config.programs.i3status-rust.package}/bin/i3status-rs ~/.config/i3status-rust/config-top.toml"; - } - ]; - }; - - extraConfig = '' - for_window [floating] border pixel 2 - - # floating sticky - for_window [class="1Password"] floating enable sticky enable - for_window [window_role="PictureInPicture"] floating enable sticky enable - - # floating - for_window [class="GParted"] floating enable - for_window [title="(?i)SteamTinkerLaunch"] floating enable - for_window [title="Blender Render"] floating enable - - # general WM role settings - for_window [title="splash"] floating enable - for_window [urgent=latest] focus - for_window [window_role="pop-up"] floating enable - for_window [window_role="task_dialog"] floating enable - - # apps - for_window [class="Pavucontrol"] floating enable - for_window [class="Yad" title="Authentication"] floating enable - for_window [class="jetbrains*" title="Welcome*"] floating enable - for_window [title="File Transfer*"] floating enable - for_window [title="Steam Guard*"] floating enable - - # keep apps in scratchpad - for_window [class="discord"] move scratchpad sticky - - set $mode_gaps Gaps: (o)uter, (i)nner - set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) - set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) - bindsym ${modifier}+Shift+g mode "$mode_gaps" - - mode "$mode_gaps" { - bindsym o mode "$mode_gaps_outer" - bindsym i mode "$mode_gaps_inner" - bindsym Return mode "$mode_gaps" - bindsym Escape mode "default" - } - mode "$mode_gaps_outer" { - bindsym plus gaps outer current plus 5 - bindsym minus gaps outer current minus 5 - bindsym 0 gaps outer current set 0 - - bindsym Shift+plus gaps outer all plus 5 - bindsym Shift+minus gaps outer all minus 5 - bindsym Shift+0 gaps outer all set 0 - - bindsym Return mode "$mode_gaps" - bindsym Escape mode "default" - } - mode "$mode_gaps_inner" { - bindsym plus gaps inner current plus 5 - bindsym minus gaps inner current minus 5 - bindsym 0 gaps inner current set 0 - - bindsym Shift+plus gaps inner all plus 5 - bindsym Shift+minus gaps inner all minus 5 - bindsym Shift+0 gaps inner all set 0 - - bindsym Return mode "$mode_gaps" - bindsym Escape mode "default" - } - - shadows enable - shadow_color #11111b99 - shadow_blur_radius 20 - - corner_radius 5 - smart_corner_radius enable - - blur enable - blur_passes 2 - blur_radius 4 - - layer_effects "swaync-notification-window" blur enable; shadows enable; corner_radius 5; - ''; - systemd = { - enable = true; - xdgAutostart = true; - }; - }; }; + }; } diff --git a/machines/common/linux/cosmic.nix b/machines/common/linux/cosmic.nix new file mode 100644 index 0000000..72562f3 --- /dev/null +++ b/machines/common/linux/cosmic.nix @@ -0,0 +1,11 @@ +{ lib, config, ... }: +{ + config = lib.mkIf (config.dotfiles.desktop == "cosmic") { + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + services = { + desktopManager.cosmic.enable = true; + displayManager.cosmic-greeter.enable = true; + }; + }; +} diff --git a/machines/common/linux/default.nix b/machines/common/linux/default.nix index e4e26e8..5932165 100644 --- a/machines/common/linux/default.nix +++ b/machines/common/linux/default.nix @@ -2,6 +2,7 @@ { imports = [ ./boot.nix + ./cosmic.nix ./gnome.nix ./greeter.nix ./input.nix diff --git a/machines/futomaki/default.nix b/machines/futomaki/default.nix index 0c2e9e2..b99aa5a 100644 --- a/machines/futomaki/default.nix +++ b/machines/futomaki/default.nix @@ -34,9 +34,9 @@ environment.systemPackages = with pkgs; [ cabextract + discover-overlay lutris-free mangohud - nur.repos.nekowinston.discover-overlay virt-manager wineWowPackages.staging winetricks diff --git a/machines/lib.nix b/machines/lib.nix index f4fb77c..6e75c72 100644 --- a/machines/lib.nix +++ b/machines/lib.nix @@ -54,34 +54,38 @@ rec { ${target}."${host}" = builder { inherit system; modules = [ - { - options = { - dotfiles = { - username = mkOption { - type = types.str; - default = username; - description = "The username of the user"; + ( + { config, ... }: + { + options = { + dotfiles = { + username = mkOption { + type = types.str; + default = username; + description = "The username of the user"; + }; + desktop = mkOption { + type = types.nullOr ( + types.enum [ + "cosmic" + "gnome" + "hyprland" + "sway" + ] + ); + default = if (pkgs.stdenv.isLinux && config.dotfiles.isGraphical) then "sway" else null; + description = "The desktop environment to use"; + }; }; - desktop = mkOption { - type = types.nullOr ( - types.enum [ - "gnome" - "sway" - ] - ); - default = "sway"; - description = "The desktop environment to use"; + isGraphical = mkOption { + type = types.bool; + default = isGraphical; + description = "Whether the system is a graphical target"; }; }; - isGraphical = mkOption { - type = types.bool; - default = isGraphical; - description = "Whether the system is a graphical target"; - }; - }; - config.dotfiles.desktop = pkgs.lib.mkIf (!isGraphical) null; - config.networking.hostName = host; - } + config.networking.hostName = host; + } + ) ./common/shared ./common/${hostPlatform} ./${host} diff --git a/pkgs/overlays.nix b/pkgs/overlays.nix index 3b461ca..8af9cbc 100644 --- a/pkgs/overlays.nix +++ b/pkgs/overlays.nix @@ -7,7 +7,6 @@ srcs = prev.callPackages ../_sources/generated.nix { }; in { - inherit (inputs.swayfx.packages.${prev.system}) swayfx-unwrapped; nushellPlugins = (prev.nushellPlugins or { }) // { clipboard = prev.callPackage ./nu_plugin_clipboard.nix { }; };