From 1ce02a6e14cbb2b3fb19a6e078dbe65b63587346 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Wed, 15 May 2024 17:28:32 +0200 Subject: [PATCH] hyprland working again, spicetify module --- hosts/vali/mars/configuration.nix | 2 + hosts/vali/mars/hyprland/hyprland.nix | 25 ++---- modules/gui/default.nix | 3 +- modules/gui/foot.nix | 117 ++++++++++++++++++++++++++ modules/gui/schizofox.nix | 2 +- modules/gui/spicetify.nix | 22 ++++- modules/other/xdg.nix | 2 +- options/common/gpu/nvidia.nix | 2 +- 8 files changed, 148 insertions(+), 27 deletions(-) create mode 100644 modules/gui/foot.nix diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/mars/configuration.nix index 71dd81a..056a363 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/mars/configuration.nix @@ -42,10 +42,12 @@ kitty.enable = true; hyprland.enable = true; newsboat.enable = true; + # foot.enable = true; fish.enable = true; stylix.enable = true; helix.enable = true; nh.enable = true; + spicetify.enable = true; schizofox.enable = true; anyrun.enable = true; }; diff --git a/hosts/vali/mars/hyprland/hyprland.nix b/hosts/vali/mars/hyprland/hyprland.nix index 52b99f5..8785a4f 100644 --- a/hosts/vali/mars/hyprland/hyprland.nix +++ b/hosts/vali/mars/hyprland/hyprland.nix @@ -180,7 +180,7 @@ in { ]; bind = [ - "$mainMod, RETURN, exec, ${pkgs.kitty}/bin/kitty" + "$mainMod, RETURN, exec, ${pkgs.kitty}/bin/kitty -d ~" "$mainMod, Q, killactive" "$mainMod, F, fullscreen, 0" "$mainMod, D, exec, ${pkgs.procps}/bin/pkill anyrun || ${anyrun}/bin/anyrun" @@ -213,9 +213,9 @@ in { "$mainMod, V, togglespecialworkspace, pipewire" "$mainMod, N, togglespecialworkspace, nixos" "$mainMod, X, togglespecialworkspace, keepassxc" + "$mainMod, R, exec, ${hyprland}/bin/hyprctl reload" "$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${waybar}/bin/waybar" ]; - binde = [ # window focus "$mainMod, H, movefocus, l" @@ -271,37 +271,24 @@ in { exec = [ # kill (almost) everything on special workspaces "${pkgs.procps}/bin/pkill btop" - "${pkgs.procps}/bin/pkill helvum" "${pkgs.procps}/bin/pkill pavucontrol" # and run it all again "[workspace special:btop silent;tile] ${pkgs.kitty}/bin/kitty -e ${pkgs.btop}/bin/btop" - "[workspace special:pipewire silent;tile] ${pkgs.helvum}/bin/helvum" + # "[workspace special:pipewire silent;tile] ${pkgs.helvum}/bin/helvum" "[workspace special:pipewire silent;tile] ${pkgs.pavucontrol}/bin/pavucontrol" - - "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator" + # "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator" ]; plugin = { split-monitor-workspaces = { count = 10; - keep_focused = 0; - enable_notifications = 0; + keep_focused = true; }; }; }; }; }; - hardware = { - opengl.enable = true; - nvidia.modesetting.enable = true; - }; - environment.systemPackages = with pkgs; [ - (waybar.overrideAttrs (oldAttrs: { - mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; - })) - mako - libnotify - ]; + environment.systemPackages = with pkgs; [ mako libnotify ]; }; } diff --git a/modules/gui/default.nix b/modules/gui/default.nix index d15ea05..6c87762 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -2,11 +2,12 @@ _: { imports = [ ./vesktop.nix ./gtk.nix + ./foot.nix ./mpv.nix ./qt.nix ./zathura.nix ./stylix.nix - #./spicetify.nix + ./spicetify.nix ./anyrun ./rofi.nix ./kitty.nix diff --git a/modules/gui/foot.nix b/modules/gui/foot.nix new file mode 100644 index 0000000..bd632c7 --- /dev/null +++ b/modules/gui/foot.nix @@ -0,0 +1,117 @@ +{ config, inputs, lib, pkgs, ... }: +let + cfg = config.modules.programs.foot; + inherit (config.modules.other.system) username; + + inherit (lib) mkEnableOption mkIf; +in { + options.modules.programs.foot = { + enable = mkEnableOption "foot"; + server = mkEnableOption "foot server mode"; + }; + + config = mkIf cfg.enable { + environment.sessionVariables = { TERM = "foot"; }; + home-manager.users.${username} = { + programs.foot = { + enable = true; + package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot; + server.enable = cfg.server; + settings = { + main = { + # term = "foot"; + # app-id = "foot"; + # title = "foot"; + # locked-title = "no"; + + # font = "JetBrains Mono Nerd Font:size=14"; + # line-height = 20; + # letter-spacing = 0; + # horizontal-letter-offset = 0; + # vertical-letter-offset = -0.75; + # box-drawings-uses-font-glyphs = "no"; + # dpi-aware = "no"; + + # initial-window-size-chars = "104x36"; + # initial-window-mode = "windowed"; + # pad = "5x5 center"; + # resize-delay-ms = 100; + + # notify = + # "${pkgs.libnotify}/bin/notify-send -a \${app-id} -i \${app-id} \${title} \${body}"; + + # bold-text-in-bright = "no"; + # word-delimiters = '',│`|:"'()[]{}<>''; + # selection-target = "primary"; + }; + bell = { + urgent = "yes"; + notify = "yes"; + command = "${pkgs.libnotify}/bin/notify-send bell"; + command-focused = "no"; + }; + scrollback = { + lines = 100000; + multiplier = 10.0; + indicator-position = "relative"; + indicator-format = "line"; + }; + url = { + launch = "${pkgs.xdg-utils}/bin/xdg-open \${url}"; + label-letters = "sadfjklewcmpgh"; + osc8-underline = "always"; + protocols = + "http, https, ftp, ftps, file, gemini, gopher, irc, ircs"; + uri-characters = '' + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]''; + }; + cursor = { + style = "block"; + blink = "no"; + }; + mouse = { + hide-when-typing = "yes"; + alternate-scroll-mode = "yes"; + }; + # colors = { + # alpha = 0.85; + # foreground = "cdd6f4"; # Text + # background = "1e1e2e"; # Base + # regular0 = "45475a"; # Surface 1 + # regular1 = "f38ba8"; # red + # regular2 = "a6e3a1"; # green + # regular3 = "f9e2af"; # yellow + # regular4 = "89b4fa"; # blue + # regular5 = "f5c2e7"; # pink + # regular6 = "94e2d5"; # teal + # regular7 = "bac2de"; # Subtext 1 + # bright0 = "585b70"; # Surface 2 + # bright1 = "f38ba8"; # red + # bright2 = "a6e3a1"; # green + # bright3 = "f9e2af"; # yellow + # bright4 = "89b4fa"; # blue + # bright5 = "f5c2e7"; # pink + # bright6 = "94e2d5"; # teal + # bright7 = "a6adc8"; # Subtext 0 + # }; + csd = { preferred = "server"; }; + key-bindings = { + show-urls-launch = "Control+Shift+u"; + unicode-input = "Control+Shift+i"; + }; + mouse-bindings = { + # selection-override-modifiers = "Shift"; + # primary-paste = "BTN_MIDDLE"; + # select-begin = "BTN_LEFT"; + # select-begin-block = "Control+BTN_LEFT"; + # select-extend = "BTN_RIGHT"; + # select-extend-character-wise = "Control+BTN_RIGHT"; + # select-word = "BTN_LEFT-2"; + # select-word-whitespace = "Control+BTN_LEFT-2"; + # #select-row = "BTN_LEFT-3"; + }; + }; + }; + }; + }; +} diff --git a/modules/gui/schizofox.nix b/modules/gui/schizofox.nix index f5e312d..126b4f1 100644 --- a/modules/gui/schizofox.nix +++ b/modules/gui/schizofox.nix @@ -98,7 +98,7 @@ in { }; }; security = { - sanitizeOnShutdown = true; + sanitizeOnShutdown = false; sandbox = true; userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"; diff --git a/modules/gui/spicetify.nix b/modules/gui/spicetify.nix index 2f37b6c..fb95d6d 100644 --- a/modules/gui/spicetify.nix +++ b/modules/gui/spicetify.nix @@ -3,10 +3,24 @@ with lib; let cfg = config.modules.programs.spicetify; username = config.modules.other.system.username; - #inherit (inputs.spicetify-nix.packages.${pkgs.system}.default) spicePkgs; - inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix; + spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; + # inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix; in { options.modules.programs.spicetify.enable = mkEnableOption "spicetify"; - imports = [ spicetify-nix.homeManagerModule ]; - config = mkIf cfg.enable { programs.spicetify = { enable = true; }; }; + config = mkIf cfg.enable { + home-manager.users.${username} = { + imports = [ inputs.spicetify-nix.homeManagerModule ]; + programs.spicetify = { + enable = true; + spotifyPackage = pkgs.spotify; + theme = spicePkgs.themes.catppuccin; + colorScheme = "mocha"; + enabledExtensions = with spicePkgs.extensions; [ + shuffle + hidePodcasts + adblock + ]; + }; + }; + }; } diff --git a/modules/other/xdg.nix b/modules/other/xdg.nix index cb61b4b..a886dda 100644 --- a/modules/other/xdg.nix +++ b/modules/other/xdg.nix @@ -3,7 +3,7 @@ let username = config.modules.other.system.username; hmCfg = config.home-manager.users.${username}; - primary_browser = "librewolf.desktop"; + primary_browser = "firefox-schizo.desktop"; mail_client = "thunderbird.desktop"; file_manager = "pcmanfm.desktop"; media_player = "mpv.desktop"; diff --git a/options/common/gpu/nvidia.nix b/options/common/gpu/nvidia.nix index db36aee..b95dbcd 100644 --- a/options/common/gpu/nvidia.nix +++ b/options/common/gpu/nvidia.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: { +{ config, ... }: { services.xserver.videoDrivers = [ "nvidia" ]; hardware.opengl = { enable = true;