From d6a28baef6549996d5e6bd9c31f77ad508c9f6c9 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 30 May 2024 16:02:56 +0200 Subject: hyperland --- home.nix | 267 ++++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 206 insertions(+), 61 deletions(-) (limited to 'home.nix') diff --git a/home.nix b/home.nix index f62bd4c..71e8cfe 100644 --- a/home.nix +++ b/home.nix @@ -1,67 +1,55 @@ { config, - lib, nixvim, + lib, pkgs, ... }: let - vars = { - BEMENU_OPTS = - "--fn 'Hermit 12' --line-height 25 " - + "--hb #a1b56c --hf #f8f8f8 --nf #b8b8b8 --af #b8b8b8 " - + "--tf #f8f8f8 --fbf #f8f8f8 --ff #f8f8f8 --cf #f8f8f8 " - + "--sf #f8f8f8 --scf #f8f8f8 --hp 10"; - }; + black = "#000000"; + white = "#FFFFFF"; + red = "#880000"; + cyan = "#AAFFEE"; + magenta = "#CC44CC"; + green = "#00CC55"; + blue = "#0088FF"; + yellow = "#EEEE77"; + grey = "#333333"; + font = "Hermit"; + primary = green; in { home = { username = "tom"; - homeDirectory = "/home/tom"; + homeDirectory = "/home/${config.home.username}"; stateVersion = "23.11"; - packages = with pkgs; [ - acpi - bemenu - binutils - brave - feh - file - firefox - ghc - gimp - haskellPackages.fourmolu - htop - jq - ncdu - ncmpcpp + packages = [ nixvim.packages.x86_64-linux.default - nmap - pavucontrol - python3Packages.ipython - scrot - tmux - tree - unzip - vim - xautolock - xmobar + (pkgs.writeShellScriptBin + "passfi" + (builtins.readFile ./passfi)) + pkgs.acpi + pkgs.binutils + pkgs.brave + pkgs.feh + pkgs.file + pkgs.firefox + pkgs.gimp + pkgs.htop + pkgs.jq + pkgs.ncdu + pkgs.ncmpcpp + pkgs.nmap + pkgs.pavucontrol + pkgs.python3Packages.ipython + pkgs.tmux + pkgs.tree + pkgs.unzip + pkgs.vim + pkgs.wl-clipboard ]; - sessionVariables = - vars - // { - LESS = "-R -F"; - EDITOR = "vim"; - }; - - file.".xinitrc".text = '' - xmonad - ''; - # todo find better solution for - # restarting without nixos switch - file.".config/xmonad/xmonad.hs".source = - config.lib.file.mkOutOfStoreSymlink - "${config.home.homeDirectory}/src/nixos/xmonad.hs"; - file.".xmobarrc".source = - config.lib.file.mkOutOfStoreSymlink - "${config.home.homeDirectory}/src/nixos/xmobarrc"; + sessionVariables = { + LESS = "-R -F"; + EDITOR = "vim"; + }; }; programs = { home-manager.enable = true; @@ -70,11 +58,11 @@ in { settings = { env.TERM = "xterm-256color"; font = { - bold.family = "Hermit"; - bold_italic.family = "Hermit"; - italic.family = "Hermit"; - normal.family = "Hermit"; - size = 10; + bold.family = font; + bold_italic.family = font; + italic.family = font; + normal.family = font; + size = 12; }; keyboard.bindings = [ { @@ -88,6 +76,22 @@ in { action = "DecreaseFontSize"; } ]; + colors = { + primary = { + background = "#222222"; + foreground = "${white}"; + }; + normal = { + black = "${black}"; + red = "${red}"; + green = "${green}"; + yellow = "${yellow}"; + blue = "${blue}"; + magenta = "${magenta}"; + cyan = "${cyan}"; + white = "${white}"; + }; + }; }; }; git = { @@ -105,6 +109,77 @@ in { enable = true; package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); }; + waybar = { + enable = true; + settings = { + main = { + layer = "top"; + position = "top"; + height = 25; + modules-left = ["hyprland/workspaces"]; + modules-right = ["battery" "clock"]; + "hyprland/workspaces" = { + persistent-workspaces = { + "*" = 9; + }; + }; + }; + }; + style = '' + * { + font-family: ${font}; + font-size: 16px; + border-radius: 0; + } + window#waybar { + background-color: ${primary}; + } + .modules-right { + background-color: ${grey}; + color: ${white}; + } + .modules-left { + background-color: ${grey}; + } + #workspaces button { + padding: 0px 5px 0px 5px; + color: ${primary}; + } + #workspaces button.empty { + background-color: ${grey}; + color: ${white}; + } + #workspaces button.active { + background-color: ${primary}; + color: ${white}; + } + ''; + }; + wofi = { + enable = true; + settings = { + hide_scroll = true; + insensitive = true; + }; + style = '' + * { + font-family: ${font}; + padding: 0px 0px 0px 0px; + border-radius: 0; + color: ${white}; + } + window { + background-color: ${grey}; + } + #input { + background-color: ${grey}; + border: 0px; + } + #entry:selected { + background-color: ${primary}; + } + ''; + }; zsh = { enable = true; autosuggestion.enable = true; @@ -112,16 +187,86 @@ in { autocd = true; }; }; - systemd.user.settings.Manager.DefaultEnvironment = vars; - xsession.windowManager.xmonad = { + wayland.windowManager.hyprland = { enable = true; - enableContribAndExtras = true; + /* + package = pkgs.hyprland.override { + legacyRenderer = true; + }; + */ + xwayland.enable = true; + settings = { + general = { + layout = "master"; + gaps_in = 3; + gaps_out = 6; + border_size = 2; + "col.active_border" = + "rgb(" + lib.strings.removePrefix "#" primary + ")"; + "col.inactive_border" = + "rgb(" + lib.strings.removePrefix "#" grey + ")"; + }; + cursor.no_warps = true; + bind = [ + "ALT, Return, exec, alacritty" + "ALT, Q, killactive" + "ALT, D, exec, wofi --show run" + "ALT, C, exec, passfi" + "ALT, X, exec, passfi otp" + "ALT_SHIFT, E, exit" + "ALT, J, cyclenext" + "ALT, K, cyclenext, prev" + "ALT, H, layoutmsg, mfact -0.05" + "ALT, L, layoutmsg, mfact +0.05" + "ALT, U, layoutmsg, removemaster" + "ALT, I, layoutmsg, addmaster" + "ALT_SHIFT, Return, layoutmsg, swapwithmaster" + "ALT_SHIFT, SPACE, togglefloating" + "ALT, F, fullscreen" + "ALT, T, fullscreen" + "ALT, M, fullscreen" + "ALT, TAB, workspace, previous" + "ALT, 1, workspace, 1" + "ALT, 2, workspace, 2" + "ALT, 3, workspace, 3" + "ALT, 4, workspace, 4" + "ALT, 5, workspace, 5" + "ALT, 6, workspace, 6" + "ALT, 7, workspace, 7" + "ALT, 8, workspace, 8" + "ALT, 9, workspace, 9" + "ALT_SHIFT, 1, movetoworkspacesilent, 1" + "ALT_SHIFT, 2, movetoworkspacesilent, 2" + "ALT_SHIFT, 3, movetoworkspacesilent, 3" + "ALT_SHIFT, 4, movetoworkspacesilent, 4" + "ALT_SHIFT, 5, movetoworkspacesilent, 5" + "ALT_SHIFT, 6, movetoworkspacesilent, 6" + "ALT_SHIFT, 7, movetoworkspacesilent, 7" + "ALT_SHIFT, 8, movetoworkspacesilent, 8" + "ALT_SHIFT, 9, movetoworkspacesilent, 9" + ]; + bindm = [ + "ALT, mouse:272, movewindow" + "ALT, mouse:273, resizewindow" + ]; + decoration = { + blur.enabled = false; + drop_shadow = false; + }; + animations.enabled = false; + exec-once = "waybar"; + misc = { + disable_hyprland_logo = true; + background_color = + "rgb(" + lib.strings.removePrefix "#" black + ")"; + }; + }; }; services = { gpg-agent = { enable = true; enableSshSupport = true; - pinentryPackage = pkgs.pinentry-bemenu; + pinentryPackage = pkgs.pinentry-curses; # from gpg --list-secret-keys --with-keygrip ([A] keygrip) sshKeys = [""]; }; -- cgit v1.2.3