From 5786716a383254c256f109d38fda1c898456fb60 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 11 Aug 2024 11:13:27 +0200 Subject: sif: hyprland --- accounts/gkleen@sif/default.nix | 222 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 210 insertions(+), 12 deletions(-) (limited to 'accounts/gkleen@sif/default.nix') diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 8e567a4f..5c90808c 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -41,7 +41,6 @@ let wrapElectron = { package, bin ? package.meta.mainProgram or package.pname or (pkgs.lib.strings.nameFromURL package.name "-"), outBin ? bin, sandbox ? true }: pkgs.runCommand "${package.name}-wrapped" { buildInputs = with pkgs; [ makeWrapper ]; } '' mkdir -p "$out/bin" makeWrapper ${package}/bin/${bin} $out/bin/${outBin} \ - --add-flags '--force-device-scale-factor=1.6' \ ${optionalString (!sandbox) "--add-flags '--no-sandbox'"} ''; @@ -158,6 +157,7 @@ in { emacs = { enable = true; + package = pkgs.emacs29-pgtk; extraPackages = epkgs: with epkgs; [ evil evil-dvorak undo-tree magit haskell-mode nix-mode yaml-mode json-mode shakespeare-mode smart-mode-line @@ -166,14 +166,19 @@ in { use-package-ensure-system-package git-gutter emacsScratch edit-server mediawiki editorconfig typescript-mode markdown-mode nftables-mode rustic lsp-mode lsp-ui - direnv company projectile + direnv company projectile tomorrow-night-paradise-theme ]; + overrides = self: super: { + tomorrow-night-paradise-theme = super.trivialBuild { + inherit (sources.tomorrow-night-paradise-theme) pname version src; + }; + }; }; firefox = { enable = true; profiles.default = { settings = { - "layout.css.devPixelsPerPx" = "0.5833"; + # "layout.css.devPixelsPerPx" = "0.5833"; "browser.tabs.drawInTitlebar" = false; "toolkit.legacyUserProfileCustomizations.stylesheets" = true; "dom.security.https_only_mode" = true; @@ -223,7 +228,7 @@ in { docs = "$HOME/documents"; dl = "$HOME/Downloads"; scrot = "$HOME/screenshots"; - flk = "$HOME/config/nixos-flakes"; + flk = "$HOME/projects/machines"; rz = "$HOME/projects/rz"; pro = "$HOME/projects/pro"; }; @@ -240,6 +245,150 @@ in { gitProtocol = "ssh"; }; }; + + kitty = { + enable = true; + font = { + package = pkgs.fira; + name = "FiraMono Nerd Font"; + size = 10; + }; + settings = { + enable_audio_bell = false; + update_check_interval = 0; + strip_trailing_spaces = "smart"; + focus_follows_mouse = true; + visual_bell_duration = "0.1"; + visual_bell_color = "#26240d"; + tab_bar_style = "powerline"; + tab_powerline_style = "slanted"; + notify_on_cmd_finish = "invisible 30.0"; + }; + }; + wofi = { + enable = true; + settings = { + location = "top"; + run-always_parse_args = true; + run-show_all = false; + }; + }; + waybar = { + enable = true; + systemd = { + enable = true; + target = "hyprland-session.target"; + }; + settings.mainBar = { + layer = "top"; + position = "top"; + height = 14; + output = [ "eDP-1" ]; + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ "clock" "tray" "battery" ]; + + clock = { + interval = 1; + timezone = "Europe/Berlin"; + format = "W{:%V-%u %F %H:%M:%S%Ez}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + week-pos = "right"; + on-scroll = 1; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + }; + battery = { + format = "{icon}"; + format-icons = ["" "" "" "" ""]; + tooltip-format = "{capacity}% {timeTo}"; + }; + icon = { + icon-size = 12; + show-passive-items = true; + spacing = 2; + }; + }; + style = '' + * { + border: none; + font-family: "Fira Sans"; + font-size: 10pt; + min-height: 0; + } + + window#waybar { + background-color: rgba(0, 0, 0, 0.5); + color: #ffffff; + } + + label.module { + margin: 0 5px; + } + + #workspaces button.visible { + color: @blue; + } + #workspaces button.active { + color: @green; + } + #workspaces button.urgent { + color: @red; + } + ''; + }; + wpaperd = { + enable = true; + settings.default = { + path = "~/.wallpapers"; + duration = "8h"; + mode = "center"; + }; + }; + hyprlock = { + enable = false; + settings = { + general = { + disable_loading_bar = false; + grace = 60; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + placeholder_text = "'Password...'"; + shadow_passes = 2; + } + ]; + }; + }; }; services = { @@ -265,10 +414,10 @@ in { ''; }; taffybar = { - enable = true; + enable = false; package = import ./taffybar { haskellPackages = deHaskell; }; }; - status-notifier-watcher.enable = true; + # status-notifier-watcher.enable = true; xembed-sni-proxy.enable = true; pasystray.enable = true; udiskie = { @@ -284,7 +433,7 @@ in { }; }; unclutter = { - enable = true; + enable = false; timeout = 5; }; network-manager-applet.enable = true; @@ -324,7 +473,7 @@ in { }; screen-locker = { - enable = true; + enable = false; lockCmd = toString (pkgs.writeShellScript "lock" '' ${pkgs.playerctl}/bin/playerctl -a status | ${pkgs.gnugrep}/bin/grep -q "Playing" && exit 0 @@ -344,6 +493,46 @@ in { enable = true; serverUrl = "https://etesync.yggdrasil.li"; }; + + hypridle = { + enable = false; + settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + before_sleep_cmd = "hyprlock"; + ignore_dbus_inhibit = false; + ignore_systemd_inhibit = false; + lock_cmd = "hyprlock"; + }; + + listener = [ + { + timeout = 300; + on-timeout = "hyprlock"; + } + { + timeout = 600; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; + swayidle = { + enable = true; + events = [ + { event = "before-sleep"; command = "${lib.getExe pkgs.gtklock} -d"; } + { event = "after-resume"; command = "${cfg.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on"; } + { event = "lock"; command = "${lib.getExe pkgs.gtklock} -d"; } + ]; + timeouts = [ + { timeout = 300; + command = "${cfg.wayland.windowManager.hyprland.package}/binhyprctl dispatch dpms off"; + resumeCommand = "${cfg.wayland.windowManager.hyprland.package}/binhyprctl dispatch dpms on"; + } + { timeout = 330; command = "${lib.getExe pkgs.gtklock} -d"; } + ]; + }; }; home.pointerCursor = { @@ -363,7 +552,7 @@ in { font = { package = pkgs.fira; name = "Fira Sans"; - size = 6; + size = 10; }; theme = { package = pkgs.equilux-theme; @@ -402,7 +591,7 @@ in { matrix-synapse-tools.synadm wrappedRocketChatDesktop flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs sieve-connect gimp inkscape udiskie glab scrot nitrokey-app - pynitrokey + pynitrokey gtklock wlrctl ]; file = { @@ -419,8 +608,8 @@ in { }; sessionVariables = { - GDK_SCALE = 96.0 / 282.0; - QT_AUTO_SCREEN_SCALE_FACTOR = 1; + # GDK_SCALE = 96.0 / 282.0; + # QT_AUTO_SCREEN_SCALE_FACTOR = 1; QT_QPA_PLATFORMTHEME = "qt5ct"; LIBVIRT_DEFAULT_URI = "qemu:///system"; STACK_XDG = 1; @@ -451,6 +640,10 @@ in { recommend-stack-upgrade = false; }; }; + "gtklock/config.ini" = { + source = (pkgs.formats.ini {}).generate "config.ini" { + }; + }; }; xdg.dataFile = { @@ -509,6 +702,11 @@ in { color-scheme = "prefer-dark"; }; }; + + wayland.windowManager.hyprland = { + enable = true; + settings = import ./hyprland.nix inputs; + }; }; }; } -- cgit v1.2.3