From 9b5197fae415509d6759b3bbaf7083d064271491 Mon Sep 17 00:00:00 2001 From: Spectre Date: Sat, 8 Jun 2024 01:06:31 +0200 Subject: [PATCH] ff --- flake.nix | 8 ++ home/default.nix | 1 + home/firefox.nix | 68 +++++++++++++++ home/hyprland/default.nix | 173 ++++++++++++++++++++++++++++++++++++++ system/wayland.nix | 9 +- 5 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 home/firefox.nix create mode 100644 home/hyprland/default.nix diff --git a/flake.nix b/flake.nix index 044aa2ce..fd9aa27f 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs-stable.url = "github:NixOS/nixpkgs/release-24.05"; + flake-utils.url = "github:numtide/flake-utils"; home-manager = { @@ -22,6 +23,12 @@ stylix.url = "github:danth/stylix"; helix.url = "github:pascalkuthe/helix/inline-diagnostics"; + + arkenfox = { + url = "github:dwarfmaster/arkenfox-nixos"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; }; outputs = { @@ -31,6 +38,7 @@ home-manager, sops-nix, stylix, + arkenfox, ... } @ inputs: let inherit (nixpkgs) lib; diff --git a/home/default.nix b/home/default.nix index 6ce14fac..a0624855 100644 --- a/home/default.nix +++ b/home/default.nix @@ -5,6 +5,7 @@ ./common.nix ./direnv.nix ./dunst.nix + ./firefox.nix ./fzf.nix ./git.nix ./gpg.nix diff --git a/home/firefox.nix b/home/firefox.nix new file mode 100644 index 00000000..dc04b3f8 --- /dev/null +++ b/home/firefox.nix @@ -0,0 +1,68 @@ +{arkenfox, ...}: { + imports = [arkenfox.hmModules.arkenfox]; + + home.file.".mozilla/firefox/ChatGPT/chrome/userChrome.css".text = '' + #TabsToolbar { visibility: collapse !important; } + #nav-bar { visibility: collapse !important; } + ''; + + programs.firefox = { + enable = true; + + policies = { + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "never"; + SearchBar = "unified"; + DownloadDirectory = "/home/spectre/inbox"; + + ExtensionSettings = { + # uBlock Origin: + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + + "keepassxc-browser@keepassxc.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/keepassxc-browser/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + }; + + arkenfox.enable = true; + arkenfox.version = "master"; + + profiles.Default.arkenfox = { + enable = true; + "0000".enable = true; + "0100".enable = true; + "0200".enable = true; + "0300".enable = true; + "0400".enable = true; + "0600".enable = true; + "0700".enable = true; + "0800".enable = true; + "0900".enable = true; + "1000".enable = true; + "1200".enable = true; + "1600".enable = true; + "1700".enable = true; + "2000".enable = true; + "2400".enable = true; + "2600".enable = true; + "2700".enable = true; + "2800".enable = true; + }; + + profiles.ChatGPT = { + name = "ChatGPT"; + id = 1; + }; + }; +} diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix new file mode 100644 index 00000000..689ab946 --- /dev/null +++ b/home/hyprland/default.nix @@ -0,0 +1,173 @@ +{...}: { + imports = [ + ./hyprgrass.nix + ./utils.nix + ]; + + wayland.windowManager.hyprland = { + enable = true; + + xwayland.enable = true; + + systemd.enable = true; + + settings = { + "$terminal" = "alacritty"; + "$fileManager" = "alacritty -e ranger"; + + monitor = [ + "eDP-1, 1920x1080, 0x0, 1" + ",preferred,auto,1" + ]; + + exec-once = [ + "ssh-agent" + "[workspace special:keepass silent] keepassxc" + ]; + + windowrulev2 = [ + "workspace special:keepass,class:org.keepassxc.KeePassXC,title:^(.*)(KeePassXC)(.*)$" + "workspace unset,class:org.keepassxc.KeePassXC,title:Unlock Database - KeePassXC" + + "workspace special:chatgpt,class:firefox,title:ChatGPT — Mozilla Firefox" + "float,class:firefox,title:ChatGPT — Mozilla Firefox" + ]; + + workspace = [ + "special:keepass,gapsout:25" + "special:magic,gapsout:25" + "special:chatgpt,gapsout:25" + ]; + + input = { + kb_layout = "de"; + + follow_mouse = 1; + + touchpad.natural_scroll = true; + + sensitivity = 0; + + kb_options = "compose:caps"; + }; + + general = { + gaps_in = 5; + gaps_out = 5; + border_size = 2; + "col.active_border" = "rgba(5bcefaee) rgba(f5a9b8ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + + layout = "dwindle"; + + allow_tearing = false; + }; + + decoration = { + rounding = 3; + + blur = { + enabled = true; + size = 2; + passes = 1; + }; + + drop_shadow = true; + shadow_range = 4; + shadow_render_power = 3; + "col.shadow" = "rgba(1a1a1aee)"; + }; + + animations = { + enabled = true; + + bezier = "myBezier, 0.0, 0.8, 0.2, 1.0"; + + animation = [ + "windows, 1, 5, myBezier" + "windowsOut, 1, 5, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 5, myBezier" + "specialWorkspace, 1, 5, myBezier, slidefadevert" + ]; + }; + + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + master = { + new_is_master = true; + }; + + "$mainMod" = "SUPER"; + + bind = [ + "$mainMod, Q, exec, $terminal" + "$mainMod, C, killactive," + "$mainMod, backspace, exit," + "$mainMod, E, exec, $fileManager" + "$mainMod, O, togglefloating," + "$mainMod, R, exec, pkill wofi || wofi --show=drun" + "$mainMod, P, pseudo," + "$mainMod, J, togglesplit," + + "$mainMod, K, togglespecialworkspace, keepass" + "$mainMod, K, exec, if (( $(pgrep keepassxc -c) < 2 )); then keepassxc; fi" + + "$mainMod, M, togglespecialworkspace, chatgpt" + "$mainMod, M, exec, [workspace special:chatgpt] pgrep firefox | xargs ps -fp | grep -- '-P ChatGPT --url chat.openai.com' || firefox -P ChatGPT --url chat.openai.com" + + ", print, exec, grim -g \"$(slurp)\" - | wl-copy && wl-paste > ~/sync/Screenshots/$(date +'%s')_spectre-pad.png && notify-send Area Captured" + "CTRL, print, exec, grim - | wl-copy && wl-paste > ~/sync/Screenshots/$(date +'%s')_spectre-pad.png && notify-send Screen Captured" + + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + + "$mainMod SHIFT, 1, movetoworkspace, 1" + "$mainMod SHIFT, 2, movetoworkspace, 2" + "$mainMod SHIFT, 3, movetoworkspace, 3" + "$mainMod SHIFT, 4, movetoworkspace, 4" + "$mainMod SHIFT, 5, movetoworkspace, 5" + "$mainMod SHIFT, 6, movetoworkspace, 6" + "$mainMod SHIFT, 7, movetoworkspace, 7" + "$mainMod SHIFT, 8, movetoworkspace, 8" + "$mainMod SHIFT, 9, movetoworkspace, 9" + "$mainMod SHIFT, 0, movetoworkspace, 10" + + "$mainMod, S, togglespecialworkspace, magic" + "$mainMod SHIFT, S, movetoworkspace, special:magic" + + "$mainMod, mouse_down, workspace, e+1" + "$mainMod, mouse_up, workspace, e-1" + ]; + + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + binde = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ]; + }; + }; +} diff --git a/system/wayland.nix b/system/wayland.nix index caa24a8e..5708a1c2 100644 --- a/system/wayland.nix +++ b/system/wayland.nix @@ -1,6 +1,5 @@ { pkgs, - config, conf, ... }: { @@ -11,6 +10,12 @@ environment.systemPackages = with pkgs; [ xdg-desktop-portal-hyprland + + hyprcursor + hyprpicker + hyprlock + hypridle + hyprpaper ]; xdg.portal = { @@ -21,6 +26,8 @@ hardware.opengl.enable = true; + programs.hyprland.enable = true; + services.greetd = { enable = true; settings = rec {