diff --git a/hosts/chmura/default.nix b/hosts/chmura/default.nix index 215af8c0..272de922 100644 --- a/hosts/chmura/default.nix +++ b/hosts/chmura/default.nix @@ -11,8 +11,8 @@ _: { ./hardware-configuration.nix ./home-manager.nix ./i2pd.nix - #./maddy.nix ./ntfy-sh.nix + ./stalwart.nix #./qbittorrent.nix ]; } diff --git a/hosts/chmura/maddy.nix b/hosts/chmura/maddy.nix deleted file mode 100644 index 5bcb26e4..00000000 --- a/hosts/chmura/maddy.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - ... -}: { - services.maddy = { - enable = true; - }; -} diff --git a/hosts/chmura/stalwart.nix b/hosts/chmura/stalwart.nix new file mode 100644 index 00000000..608ee5d9 --- /dev/null +++ b/hosts/chmura/stalwart.nix @@ -0,0 +1,30 @@ +_: { + services.stalwart-mail = { + enable = true; + settings = { + server = { + hostname = "mail.jacekpoz.pl"; + run-as = { + user = "stalwart"; + group = "stalwart"; + }; + listener = { + smtp = { + bind = [ "0.0.0.0:9900" ]; + }; + }; + }; + global = { + thread-pool = 4; + shared-map = { + shard = 32; + capacity = 10; + }; + tracing = { + method = "journal"; + level = "warn"; + }; + }; + }; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix index e684b46a..2c492d80 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -12,11 +12,11 @@ in { config' = { hostname = "niks"; username = "jacek"; - gtk-theme = "Catppuccin-Mocha-Standard-Green-Dark"; }; }; modules = [ ./niks + ../modules inputs.home-manager.nixosModules.home-manager inputs.agenix.nixosModules.default ]; @@ -28,11 +28,11 @@ in { config' = { hostname = "hape"; username = "jacek"; - gtk-theme = "Catppuccin-Mocha-Standard-Green-Dark"; }; }; modules = [ ./hape + ../modules inputs.home-manager.nixosModules.home-manager ]; }; @@ -47,6 +47,7 @@ in { }; modules = [ ./chmura + ../modules inputs.home-manager.nixosModules.home-manager inputs.agenix.nixosModules.default ]; diff --git a/hosts/hape/configuration.nix b/hosts/hape/configuration.nix index aeded276..e6ff7ac5 100644 --- a/hosts/hape/configuration.nix +++ b/hosts/hape/configuration.nix @@ -231,5 +231,11 @@ ''; }; + myOptions = { + services = { + greetd.enable = true; + }; + }; + system.stateVersion = "23.11"; } diff --git a/hosts/hape/greetd.nix b/hosts/hape/greetd.nix deleted file mode 100644 index 3914bed4..00000000 --- a/hosts/hape/greetd.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - inputs, - pkgs, - config', - ... -}: let - greeter = "gtkgreet"; - - hyprlandConfig = pkgs.writeText "greetd-hyprland-config" '' - workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false - - exec-once=systemctl --user stop waybar.service - exec-once=[workspace 1;fullscreen;noanim] ${pkgs.greetd.${greeter}}/bin/${greeter} -l; hyprctl dispatch exit - exec-once=hyprctl dispatch focuswindow gtkgreet - ''; -in { - services.greetd = { - enable = true; - settings.default_session = { - command = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/Hyprland --config ${hyprlandConfig}"; - user = config'.username; - }; - }; - - environment.etc = { - "greetd/environments".text = '' - Hyprland - sway - zsh - shutdown now - ''; - }; -} diff --git a/hosts/niks/asusd.nix b/hosts/niks/asusd.nix deleted file mode 100644 index 2231290c..00000000 --- a/hosts/niks/asusd.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - ... -}: { - services.asusd = { - enable = true; - enableUserService = true; - asusdConfig = '' - ( - bat_charge_limit: 90, - panel_od: true, - mini_led_mode: true, - disable_nvidia_powerd_on_battery: true, - ac_command: "${pkgs.asusctl}/bin/asusctl profile -P Performance", - bat_command: "${pkgs.asusctl}/bin/asusctl profile -P Quiet", - ) - ''; - }; -} diff --git a/hosts/niks/configuration.nix b/hosts/niks/configuration.nix index c75f5d66..cebaf78b 100644 --- a/hosts/niks/configuration.nix +++ b/hosts/niks/configuration.nix @@ -10,6 +10,7 @@ config = { permittedInsecurePackages = [ "python-2.7.18.6" + "armcord-3.2.3" ]; allowUnfree = true; }; @@ -27,7 +28,6 @@ }; efi.canTouchEfiVariables = true; }; - #kernelPackages = pkgs.linuxPackages_xanmod_latest; kernelPackages = pkgs.linuxPackages_zen; extraModulePackages = with config.boot.kernelPackages; [ ( @@ -89,21 +89,15 @@ "nix-command" ]; substituters = [ - "https://hyprland.cachix.org" "https://nix-gaming.cachix.org" - "https://anyrun.cachix.org" "https://nix-community.cachix.org" "https://nixpkgs-wayland.cachix.org" - "https://helix.cachix.org" "https://viperml.cachix.org" ]; trusted-public-keys = [ - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" - "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" - "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" "viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8=" ]; keep-outputs = true; @@ -141,7 +135,6 @@ material-design-icons (nerdfonts.override { fonts = [ "JetBrainsMono" - "Iosevka" ]; }) noto-fonts noto-fonts-cjk-sans @@ -222,6 +215,22 @@ udisks2.enable = true; dbus.enable = true; + + fwupd = { + enable = true; + }; + + # db + mysql = { + enable = true; + package = pkgs.mariadb; + ensureUsers = [{ + name = "jacek"; + ensurePermissions = { + "*.*" = "ALL PRIVILEGES"; + }; + }]; + }; }; programs.gnupg.agent = { @@ -241,13 +250,14 @@ driSupport = true; driSupport32Bit = true; }; + cpu.amd.updateMicrocode = true; }; xdg.portal = { enable = true; - extraPortals = with pkgs; [ + extraPortals = [ inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland - xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-gtk ]; }; @@ -269,5 +279,212 @@ ''; }; + services.udev = { + extraRules = let + inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; + + power_supply = pkgs.writeShellScript "on_power_supply" '' + ${pkgs.asusctl}/bin/asusctl profile -P Performance + #${pkgs.supergfxctl}/bin/supergfxctl -m Hybrid + ${config.boot.kernelPackages.cpupower}/bin/cpupower frequency-set -g performance + ${hyprland}/bin/hyprctl keyword decoration:blur:enabled true + ${hyprland}/bin/hyprctl keyword animations:enabled true + ''; + battery = pkgs.writeShellScript "on_battery" '' + ${pkgs.asusctl}/bin/asusctl profile -P Quiet + #${pkgs.supergfxctl}/bin/supergfxctl -m Integrated + ${config.boot.kernelPackages.cpupower}/bin/cpupower frequency-set -g powersave + ${hyprland}/bin/hyprctl keyword decoration:blur:enabled false + ${hyprland}/bin/hyprctl keyword animations:enabled false + ''; + in '' + SUBSYSTEM == "power_supply", ENV{POWER_SUPPLY_ONLINE} == "1", RUN += "${power_supply}" + SUBSYSTEM == "power_supply", ENV{POWER_SUPPLY_ONLINE} == "0", RUN += "${battery}" + ''; + }; + + systemd.services = { + "suspend@" = { + description = "Unit suspend actions"; + before = [ "sleep.target" ]; + + serviceConfig = { + User = "%I"; + Type = "forking"; + }; + + environment = { + DISPLAY = ":0"; + }; + + preStart = "${pkgs.mpc-cli}/bin/mpc pause"; + script = "${inputs.nixpkgs-wayland.packages.${pkgs.system}.swaylock-effects}/bin/swaylock"; + postStart = "${pkgs.coreutils-full}/bin/sleep 1"; + + wantedBy = [ "sleep.target" ]; + }; + + #"resume@" = { + # + #}; + }; + + # this makes usb devices autosuspend + #powerManagement.powertop.enable = true; + + programs.kdeconnect.enable = true; + + myOptions = { + programs = { + git = { + enable = true; + userName = "jacekpoz"; + userEmail = "jacekpoz@cock.li"; + signingKey = "0EEE6B0C9A8CC06820E59C3894E812A8B12AAE3C"; + editor = "${pkgs.neovim-nightly}/bin/nvim"; + defaultBranch = "master"; + }; + starship.enable = true; + zsh.enable = true; + anyrun.enable = true; + armcord.enable = true; + btop.enable = true; + firefox = { + enable = true; + searchEngines = { + "NotASearx" = { + url = "https://search.notashelf.dev/search?q={searchTerms}"; + favicon = ""; + aliases = [ "@sx" ]; + }; + "NixOS Packages" = { + url = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; + favicon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + aliases = [ "@np" ]; + }; + "NixOS Options" = { + url = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; + favicon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + aliases = [ "@no" ]; + }; + "NixOS Wiki" = { + url = "https://nixos.wiki/index.php?search={searchTerms}"; + favicon = ""; + aliases = [ "@nw" ]; + }; + "Home Manger Option Search" = { + url = "https://mipmip.github.io/home-manager-option-search?query={searchTerms}"; + favicon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + aliases = [ "@hm" ]; + }; + "Arch Wiki" = { + url = "https://wiki.archlinux.org/index.php?search={searchTerms}"; + favicon = ""; + aliases = [ "@aw" ]; + }; + "Gentoo Wiki" = { + url = "https://wiki.gentoo.org/index.php?search={searchTerms}"; + favicon = ""; + aliases = [ "@gw" ]; + }; + "Debian Wiki" = { + url = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}"; + favicon = ""; + aliases = [ "@dw" ]; + }; + }; + }; + foot.enable = true; + gtklock.enable = false; + mpv.enable = true; + neovim.enable = true; + swaylock.enable = true; + waybar.enable = true; + zathura.enable = true; + hyprland.enable = true; + }; + themes = { + cursor = { + enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 24; + }; + gtk = { + enable = true; + package = pkgs.catppuccin-gtk; + name = "Catppuccin-Mocha-Standard-Green-Dark"; + variant = "mocha"; + accentColour = "green"; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.catppuccin-papirus-folders; + }; + }; + qt = { + enable = true; + package = pkgs.catppuccin-kde; + name = "Catppuccin-Mocha-Dark"; + variant = "mocha"; + accentColour = "green"; + }; + }; + services = { + asusd.enable = true; + dunst.enable = true; + mpd.enable = true; + greetd = { + enable = true; + greeter = "gtkgreet"; + launchOptions = [ + "Hyprland" + "sway" + "zsh" + "reboot" + "shutdown now" + ]; + }; + ssh = { + daemon.enable = false; + agent = { + enable = true; + hostAliases = { + "github" = { + hostName = "github.com"; + identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/githubkey"; + }; + "git.dupa.edu.pl" = { + hostName = "git.dupa.edu.pl"; + identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitdupaedupl"; + }; + "codeberg" = { + hostName = "codeberg.org"; + identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/codeberg"; + }; + "gitlab" = { + hostName = "gitlab.com"; + identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/gitlab"; + }; + "aur" = { + hostName = "aur.archlinux.org"; + user = "aur"; + identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/aur"; + }; + "chmura" = { + hostName = "192.168.15.17"; + user = "chmura"; + identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/chmura"; + }; + "malina" = { + hostName = "192.168.15.13"; + user = "malina"; + identityFile = "${config.home-manager.users.${config'.username}.home.homeDirectory}/.ssh/malina"; + }; + }; + }; + }; + }; + }; + system.stateVersion = "23.11"; } diff --git a/hosts/niks/default.nix b/hosts/niks/default.nix index 6e65bdd7..d5d6edaf 100644 --- a/hosts/niks/default.nix +++ b/hosts/niks/default.nix @@ -1,10 +1,7 @@ _: { imports = [ - ./ssh - ./asusd.nix ./configuration.nix ./fcitx5.nix - ./greetd.nix ./hardware-configuration.nix ./home-manager.nix #./mullvad.nix diff --git a/hosts/niks/greetd.nix b/hosts/niks/greetd.nix deleted file mode 100644 index 3914bed4..00000000 --- a/hosts/niks/greetd.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - inputs, - pkgs, - config', - ... -}: let - greeter = "gtkgreet"; - - hyprlandConfig = pkgs.writeText "greetd-hyprland-config" '' - workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false - - exec-once=systemctl --user stop waybar.service - exec-once=[workspace 1;fullscreen;noanim] ${pkgs.greetd.${greeter}}/bin/${greeter} -l; hyprctl dispatch exit - exec-once=hyprctl dispatch focuswindow gtkgreet - ''; -in { - services.greetd = { - enable = true; - settings.default_session = { - command = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/Hyprland --config ${hyprlandConfig}"; - user = config'.username; - }; - }; - - environment.etc = { - "greetd/environments".text = '' - Hyprland - sway - zsh - shutdown now - ''; - }; -} diff --git a/hosts/niks/home-manager.nix b/hosts/niks/home-manager.nix index ebc47f3f..a61db070 100644 --- a/hosts/niks/home-manager.nix +++ b/hosts/niks/home-manager.nix @@ -11,17 +11,6 @@ useGlobalPkgs = true; extraSpecialArgs = {inherit inputs self config';}; users.${config'.username} = { - imports = [ - inputs.hyprland.homeManagerModules.default - inputs.anyrun.homeManagerModules.default - inputs.neovim-flake.homeManagerModules.default - ../../modules/cli - ../../modules/gui - ../../modules/tui - ../../modules/other - ../../modules/services - ]; - programs = { home-manager.enable = true; direnv = { @@ -148,7 +137,6 @@ git-annex gamemode croc - linuxKernel.packages.linux_xanmod_latest.cpupower uutils-coreutils anki alsa-utils @@ -193,6 +181,19 @@ mypaint logseq gamescope + vitetris + + # tp + jetbrains.idea-community + maven + pmd + libsForQt5.umbrello + jdk + checkstyle + + linuxKernel.packages.linux_zen.cpupower + usbutils + libsForQt5.dolphin ]; stateVersion = lib.mkDefault "23.11"; diff --git a/hosts/niks/ssh/default.nix b/hosts/niks/ssh/default.nix deleted file mode 100644 index 532571ad..00000000 --- a/hosts/niks/ssh/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -_: { - imports = [ ./ssh-agent.nix ]; - - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - PermitRootLogin = "no"; - }; - }; - - programs.ssh.extraConfig = '' - AddKeysToAgent yes - - Host github - HostName github.com - User git - IdentityFile ~/.ssh/githubkey - IdentitiesOnly yes - Host git.dupa.edu.pl - HostName git.dupa.edu.pl - User git - IdentityFile ~/.ssh/gitdupaedupl - IdentitiesOnly yes - Host codeberg - HostName codeberg.org - User git - IdentityFile ~/.ssh/codeberg - IdentitiesOnly yes - Host gitlab - HostName gitlab.com - User git - IdentityFile ~/.ssh/gitlab - IdentitiesOnly yes - Host aur - HostName aur.archlinux.org - IdentityFile ~/.ssh/aur - User aur - Host chmura - HostName 192.168.15.17 - User chmura - IdentityFile ~/.ssh/chmura - IdentitiesOnly yes - Host malina - HostName 192.168.15.13 - User malina - IdentityFile ~/.ssh/malina - IdentitiesOnly yes - ''; -} diff --git a/hosts/niks/ssh/ssh-agent.nix b/hosts/niks/ssh/ssh-agent.nix deleted file mode 100644 index 2f64438b..00000000 --- a/hosts/niks/ssh/ssh-agent.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - pkgs, - ... -}: { - systemd.user.services.ssh-agent = { - enable = true; - description = "SSH key agent"; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.openssh}/bin/ssh-agent -D -a $SSH_AUTH_SOCK"; - }; - environment = { - SSH_AUTH_SOCK = "%t/ssh-agent.socket"; - DISPLAY = ":0"; - }; - wantedBy = [ "default.target" ]; - }; - - environment.sessionVariables = { - SSH_AUTH_SOCK = "\$XDG_RUNTIME_DIR/ssh-agent.socket"; - }; -} diff --git a/modules/cli/git.nix b/modules/cli/git.nix index ebf408a2..7ac89693 100644 --- a/modules/cli/git.nix +++ b/modules/cli/git.nix @@ -1,25 +1,57 @@ { - pkgs, + config, + config', + lib, ... -}: { - programs.git = { - enable = true; - userName = "jacekpoz"; - userEmail = "jacekpoz@cock.li"; - signing = { - key = "0EEE6B0C9A8CC06820E59C3894E812A8B12AAE3C"; - signByDefault = true; +}: with lib; let + cfg = config.myOptions.programs.git; +in { + options.myOptions.programs.git = { + enable = mkEnableOption "git"; + userName = mkOption { + type = types.str; + description = "git username"; + }; + userEmail = mkOption { + type = types.str; + description = "git email"; + }; + signingKey = mkOption { + type = types.str; + description = "git commit signing key"; + }; + editor = mkOption { + type = types.str; + default = "nvim"; + description = "commit message editor"; + }; + defaultBranch = mkOption { + type = types.str; + default = "main"; + description = "default git branch"; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.git = { + inherit (cfg) enable userName userEmail; + signing = { + key = cfg.signingKey; + signByDefault = true; + }; + includes = [ + { + contents = { core.editor = cfg.editor; }; + } + { + contents = { init.defaultBranch = cfg.defaultBranch; }; + } + { + contents = { push.autoSetupRemote = true; }; + } + ]; + }; }; - includes = [ - { - contents = { core.editor = "${pkgs.neovim-nightly}/bin/nvim"; }; - } - { - contents = { init.defaultBranch = "master"; }; - } - { - contents = { push.autoSetupRemote = true; }; - } - ]; }; } diff --git a/modules/cli/starship.nix b/modules/cli/starship.nix index 5850db9a..2c51713e 100644 --- a/modules/cli/starship.nix +++ b/modules/cli/starship.nix @@ -1,17 +1,30 @@ -_: { - programs.starship = { - enable = true; - enableZshIntegration = true; - settings = { - add_newline = false; - command_timeout = 1000; - line_break = { - disabled = true; - }; - directory = { - truncation_length = 3; - truncate_to_repo = false; - truncation_symbol = "…/"; +{ + config, + config', + lib, + ... +}: with lib; let + cfg = config.myOptions.programs.starship; +in { + options.myOptions.programs.starship.enable = mkEnableOption "enable starship"; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.starship = { + enable = true; + enableZshIntegration = config.myOptions.programs.zsh.enable; + settings = { + add_newline = false; + command_timeout = 1000; + line_break = { + disabled = true; + }; + directory = { + truncation_length = 3; + truncate_to_repo = false; + truncation_symbol = "…/"; + }; + }; }; }; }; diff --git a/modules/cli/zsh.nix b/modules/cli/zsh.nix index a0876d03..ebc059ea 100644 --- a/modules/cli/zsh.nix +++ b/modules/cli/zsh.nix @@ -1,64 +1,75 @@ { config, + config', + lib, pkgs, ... -}: { - programs.zsh = { - enable = true; - shellAliases = { - cl = "clear"; - cp = "cp -ivr"; - mv = "mv -iv"; - rm = "trash -v"; - l = "eza -a"; - e = "eza -lha --git"; - untar = "tar -xvf"; - untargz = "tar -xzf"; - mnt = "udisksctl mount -b"; - umnt = "udisksctl unmount -b"; - v = "nvim"; - kys = "shutdown now"; - gpl = "curl https://www.gnu.org/licenses/gpl-3.0.txt -o LICENSE"; - agpl = "curl https://www.gnu.org/licenses/agpl-3.0.txt -o LICENSE"; - wget = "wget --hsts-file=\"${config.xdg.dataHome}/wget-hsts\""; - g = "git"; - woman = "man"; +}: with lib; let + cfg = config.myOptions.programs.zsh; +in { + options.myOptions.programs.zsh.enable = mkEnableOption "enable zsh"; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.zsh = { + enable = true; + shellAliases = { + cl = "clear"; + cp = "cp -ivr"; + mv = "mv -iv"; + rm = "trash -v"; + l = "eza -a"; + e = "eza -lha --git"; + untar = "tar -xvf"; + untargz = "tar -xzf"; + mnt = "udisksctl mount -b"; + umnt = "udisksctl unmount -b"; + v = "nvim"; + kys = "shutdown now"; + gpl = "curl https://www.gnu.org/licenses/gpl-3.0.txt -o LICENSE"; + agpl = "curl https://www.gnu.org/licenses/agpl-3.0.txt -o LICENSE"; + g = "git"; + woman = "man"; + + wget = "wget --hsts-file=\"${config.home-manager.users.${config'.username}.xdg.dataHome}/wget-hsts\""; + }; + initExtra = '' + bindkey -e + ''; + history = { + path = "${config.home-manager.users.${config'.username}.xdg.dataHome}/zsh/zsh_history"; + size = 9999999999; + save = 9999999999; + extended = true; + ignoreSpace = true; + }; + enableAutosuggestions = true; + enableCompletion = true; + autocd = false; + dotDir = ".config/zsh"; + plugins = [ + { + name = "fast-syntax-highlighting"; + file = "fast-syntax-highlighting.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "zdharma-continuum"; + repo = "fast-syntax-highlighting"; + rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; + sha256 = "sha256-RVX9ZSzjBW3LpFs2W86lKI6vtcvDWP6EPxzeTcRZua4="; + }; + } + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "v0.7.0"; + sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91"; + }; + } + ]; + }; }; - initExtra = '' - bindkey -e - ''; - history = { - path = "${config.xdg.dataHome}/zsh/zsh_history"; - size = 9999999999; - save = 9999999999; - extended = true; - ignoreSpace = true; - }; - enableAutosuggestions = true; - enableCompletion = true; - autocd = false; - dotDir = ".config/zsh"; - plugins = [ - { - name = "fast-syntax-highlighting"; - file = "fast-syntax-highlighting.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "zdharma-continuum"; - repo = "fast-syntax-highlighting"; - rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; - sha256 = "sha256-RVX9ZSzjBW3LpFs2W86lKI6vtcvDWP6EPxzeTcRZua4="; - }; - } - { - name = "zsh-nix-shell"; - file = "nix-shell.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "v0.7.0"; - sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91"; - }; - } - ]; }; } diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 00000000..6083b433 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,10 @@ +_: { + imports = [ + ./cli + ./gui + ./other + ./services + ./tui + ]; +} + diff --git a/modules/gui/anyrun.nix b/modules/gui/anyrun.nix index 59469bb7..4029200e 100644 --- a/modules/gui/anyrun.nix +++ b/modules/gui/anyrun.nix @@ -1,109 +1,126 @@ { + config, + config', inputs, + lib, pkgs, ... -}: { - programs.anyrun = { - enable = true; - config = { - plugins = with inputs.anyrun.packages.${pkgs.system}; [ - applications - dictionary - kidex - rink - symbols - translate - ]; - hideIcons = false; - ignoreExclusiveZones = false; - layer = "overlay"; - hidePluginInfo = false; - closeOnClick = true; - showResultsImmediately = true; - maxEntries = 50; - width.fraction = 0.3; - y.absolute = 15; +}: with lib; let + cfg = config.myOptions.programs.anyrun; +in { + options.myOptions.programs.anyrun.enable = mkEnableOption "enable anyrun"; + + config = mkIf cfg.enable { + nix.settings = { + substituters = [ "https://anyrun.cachix.org" ]; + trusted-public-keys = [ "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" ]; }; + home-manager.users.${config'.username} = { + imports = [ inputs.anyrun.homeManagerModules.default ]; - extraCss = '' - * { - all: unset; - font-family: Lexend; - font-size: 1.3rem; - } + programs.anyrun = { + enable = true; + config = { + plugins = with inputs.anyrun.packages.${pkgs.system}; [ + applications + dictionary + kidex + rink + symbols + translate + ]; + hideIcons = false; + ignoreExclusiveZones = false; + layer = "overlay"; + hidePluginInfo = false; + closeOnClick = true; + showResultsImmediately = true; + maxEntries = 50; + width.fraction = 0.3; + y.absolute = 15; + }; - #window, - #match, - #entry, - #plugin, - #main { background: transparent; } + extraCss = '' + * { + all: unset; + font-family: Lexend; + font-size: 1.3rem; + } - #match.activatable { - border-radius: 16px; - padding: .3rem .9rem; - margin-top: .01rem; - } - #match.activatable:first-child { margin-top: .7rem; } - #match.activatable:last-child { margin-bottom: .6rem; } + #window, + #match, + #entry, + #plugin, + #main { background: transparent; } - #plugin:hover #match.activatable { - border-radius: 10px; - padding: .3rem; - margin-top: .01rem; - margin-bottom: 0; - } + #match.activatable { + border-radius: 16px; + padding: .3rem .9rem; + margin-top: .01rem; + } + #match.activatable:first-child { margin-top: .7rem; } + #match.activatable:last-child { margin-bottom: .6rem; } - #match:selected, #match:hover, #plugin:hover { - background: rgba(255, 255, 255, .1); - } + #plugin:hover #match.activatable { + border-radius: 10px; + padding: .3rem; + margin-top: .01rem; + margin-bottom: 0; + } - #entry { - background: rgba(255,255,255,.05); - border: 1px solid rgba(255,255,255,.1); - border-radius: 16px; - margin: .3rem; - padding: .3rem 1rem; - } + #match:selected, #match:hover, #plugin:hover { + background: rgba(255, 255, 255, .1); + } - list > #plugin { - border-radius: 16px; - margin: 0 .3rem; - } - list > #plugin:first-child { margin-top: .3rem; } - list > #plugin:last-child { margin-bottom: .3rem; } - list > #plugin:hover { padding: .6rem; } + #entry { + background: rgba(255,255,255,.05); + border: 1px solid rgba(255,255,255,.1); + border-radius: 16px; + margin: .3rem; + padding: .3rem 1rem; + } - box#main { - background: rgba(0, 0, 0, .5); - box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 0 1px rgba(0, 0, 0, .5); - border-radius: 24px; - padding: .3rem; - } - ''; - extraConfigFiles = { - "applications.ron".text = '' - Config( - desktop_actions: true, - terminal: Some("foot"), - max_entries: 30, - ) - ''; - "dictionary.ron".text = '' - Config( - prefix: ":d", - ) - ''; - "symbols.ron".text = '' - Config( - prefix: ":s", - ) - ''; - "translate.ron".text = '' - Config( - prefix: ":", - language_delimiter: ">", - ) - ''; + list > #plugin { + border-radius: 16px; + margin: 0 .3rem; + } + list > #plugin:first-child { margin-top: .3rem; } + list > #plugin:last-child { margin-bottom: .3rem; } + list > #plugin:hover { padding: .6rem; } + + box#main { + background: rgba(0, 0, 0, .5); + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 0 1px rgba(0, 0, 0, .5); + border-radius: 24px; + padding: .3rem; + } + ''; + extraConfigFiles = { + "applications.ron".text = '' + Config( + desktop_actions: true, + terminal: Some("foot"), + max_entries: 30, + ) + ''; + "dictionary.ron".text = '' + Config( + prefix: ":d", + ) + ''; + "symbols.ron".text = '' + Config( + prefix: ":s", + ) + ''; + "translate.ron".text = '' + Config( + prefix: ":", + language_delimiter: ">", + ) + ''; + }; + }; }; }; } diff --git a/modules/gui/armcord.nix b/modules/gui/armcord.nix index ad3e8389..5f780a60 100644 --- a/modules/gui/armcord.nix +++ b/modules/gui/armcord.nix @@ -1,268 +1,278 @@ { config, + config', lib, pkgs, ... -}: let +}: with lib; let + cfg = config.myOptions.programs.armcord; storage = "ArmCord/storage"; in { - home.packages = with pkgs; [ - (armcord.overrideAttrs { - version = "3.2.3"; - src = pkgs.fetchurl { - url = "https://github.com/ArmCord/ArmCord/releases/download/v3.2.3/ArmCord_3.2.3_amd64.deb"; - sha256 = "0pdsqvdvr0ylc8pjc4d1krxngcwl99jz74m04804bihpwzsyzibp"; - }; - }) - ]; + options.myOptions.programs.armcord = { + enable = mkEnableOption "enable armcord"; + }; - #xdg.configFile = { - # "${storage}/settings.json".text = builtins.toJSON { - # windowStyle = "native"; - # channel = "stable"; - # armcordCSP = true; - # minimizeToTray = false; - # mobileMode = false; - # automaticPatches = false; - # performanceMode = "performance"; - # useLegacyCapturer = false; - # alternativePaste = false; - # dynamicIcon = false; - # spellcheck = false; - # disableAutogain = false; - # startMinimized = false; - # trayIcon = "default"; - # mods = "vencord"; - # inviteWebsocket = true; - # tray = false; - # skipSplash = true; - # doneSetup = true; - # }; + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + home.packages = with pkgs; [ + (armcord.overrideAttrs { + version = "3.2.3"; + src = pkgs.fetchurl { + url = "https://github.com/ArmCord/ArmCord/releases/download/v3.2.3/ArmCord_3.2.3_amd64.deb"; + sha256 = "0pdsqvdvr0ylc8pjc4d1krxngcwl99jz74m04804bihpwzsyzibp"; + }; + }) + ]; - # "${storage}/lang.json".text = builtins.toJSON { - # lang = "en-GB"; - # }; + #xdg.configFile = { + # "${storage}/settings.json".text = builtins.toJSON { + # windowStyle = "native"; + # channel = "stable"; + # armcordCSP = true; + # minimizeToTray = false; + # mobileMode = false; + # automaticPatches = false; + # performanceMode = "performance"; + # useLegacyCapturer = false; + # alternativePaste = false; + # dynamicIcon = false; + # spellcheck = false; + # disableAutogain = false; + # startMinimized = false; + # trayIcon = "default"; + # mods = "vencord"; + # inviteWebsocket = true; + # tray = false; + # skipSplash = true; + # doneSetup = true; + # }; - # # this file doesn't actually do anything - you have to import it manually because of armcord's limitations - # "${storage}/vencord.json".text = builtins.toJSON { - # settings = { - # notifyAboutUpdates = true; - # autoUpdate = false; - # autoUpdateNotification = true; - # useQuickCss = true; - # themeLinks = []; - # enabledThemes = []; - # enableReactDevtools = false; - # frameless = false; - # transparent = false; - # winCtrlQ = false; - # macosTranslucency = false; - # disableMinSize = false; - # winNativeTitleBar = false; - # plugins = { - # BadgeAPI.enabled = true; - # CommandsAPI.enabled = true; - # ContextMenuAPI.enabled = true; - # MemberListDecoratorsAPI.enabled = false; - # MessageAccessoriesAPI.enabled = false; - # MessageDecorationsAPI.enabled = false; - # MessageEventsAPI.enabled = true; - # MessagePopoverAPI.enabled = false; - # NoticesAPI.enabled = true; - # ServerListAPI.enabled = false; - # SettingsStoreAPI.enabled = false; - # NoTrack.enabled = true; - # Settings = { - # enabled = true; - # settingsLocation = "aboveActivity"; - # }; - # AlwaysAnimate.enabled = false; - # AlwaysTrust.enabled = false; - # AnonymiseFileNames.enabled = false; - # "WebRichPresence (arRPC)".enabled = false; - # BANger.enabled = false; - # BetterFolders = { - # enabled = true; - # sidebar = true; - # closeAllHomeButton = false; - # closeAllFolders = false; - # forceOpen = false; - # sidebarAnim = true; - # }; - # BetterGifAltText.enabled = false; - # BetterNotesBox.enabled = false; - # BetterRoleDot.enabled = false; - # BetterUploadButton.enabled = false; - # BiggerStreamPreview.enabled = false; - # BlurNSFW = { - # enabled = true; - # blurAmount = 10; - # }; - # CallTimer.enabled = false; - # ClearURLs.enabled = false; - # ColorSighted.enabled = false; - # ConsoleShortcuts.enabled = false; - # CrashHandler.enabled = true; - # CustomRPC.enabled = false; - # DisableDMCallIdle.enabled = false; - # EmoteCloner.enabled = false; - # Experiments.enabled = false; - # F8Break.enabled = false; - # FakeNitro = { - # enabled = true; - # enableEmojiBypass = true; - # enableStickerBypass = true; - # enableStreamQualityBypass = true; - # transformStickers = true; - # transformEmojis = true; - # transformCompoundSentence = false; - # emojiSize = 48; - # }; - # FakeProfileThemes.enabled = false; - # FavoriteEmojiFirst.enabled = false; - # FixInbox.enabled = false; - # ForceOwnerCrown.enabled = false; - # FriendInvites.enabled = false; - # GameActivityToggle.enabled = false; - # GifPaste.enabled = false; - # HideAttachments.enabled = false; - # iLoveSpam.enabled = false; - # IgnoreActivities.enabled = false; - # ImageZoom.enabled = false; - # InvisibleChat.enabled = false; - # KeepCurrentChannel.enabled = false; - # LastFMRichPresence.enabled = false; - # LoadingQuotes.enabled = false; - # MemberCount.enabled = true; - # MessageClickActions.enabled = false; - # MessageLinkEmbeds.enabled = false; - # MessageLogger = { - # enabled = true; - # deleteStyle = "text"; - # ignoreBots = false; - # ignoreSelf = false; - # ignoreUsers = ""; - # ignoreChannels = ""; - # ignoreGuilds = ""; - # }; - # MessageTags.enabled = false; - # MoreCommands.enabled = false; - # MoreKaomoji.enabled = false; - # MoreUserTags.enabled = false; - # Moyai.enabled = false; - # MuteNewGuild.enabled = false; - # MutualGroupDMs.enabled = false; - # NoBlockedMessages = { - # enabled = true; - # ignoreBlockedMessages = false; - # }; - # NoDevtoolsWarning.enabled = false; - # NoF1.enabled = false; - # NoPendingCount.enabled = false; - # NoProfileThemes.enabled = true; - # NoReplyMention = { - # enabled = true; - # userList = ""; - # shouldPingListed = true; - # }; - # NoScreensharePreview.enabled = false; - # NoUnblockToJump.enabled = false; - # NSFWGateBypass.enabled = false; - # oneko.enabled = false; - # OpenInApp.enabled = false; - # "Party mode 🎉".enabled = false; - # PermissionsViewer.enabled = false; - # petpet.enabled = false; - # PinDMs.enabled = false; - # PlainFolderIcon.enabled = false; - # PlatformIndicators.enabled = false; - # PronounDB.enabled = false; - # QuickMention.enabled = false; - # QuickReply.enabled = false; - # ReactErrorDecoder.enabled = false; - # ReadAllNotificationsButton.enabled = false; - # RelationshipNotifier.enabled = false; - # RevealAllSpoilers.enabled = false; - # ReverseImageSearch.enabled = false; - # ReviewDB.enabled = false; - # RoleColorEverywhere.enabled = false; - # SearchReply.enabled = false; - # SendTimestamps.enabled = false; - # ServerListIndicators.enabled = false; - # ShikiCodeblocks.enabled = false; - # ShowAllMessageButtons.enabled = false; - # ShowConnections.enabled = false; - # ShowHiddenChannels = { - # enabled = true; - # showMode = 0; - # hideUnreads = true; - # }; - # ShowMeYourName.enabled = false; - # SilentMessageToggle.enabled = false; - # SilentTyping = { - # enabled = true; - # showIcon = false; - # isEnabled = true; - # }; - # SortFriendRequests.enabled = false; - # SpotifyControls.enabled = false; - # SpotifyCrack.enabled = false; - # SpotifyShareCommands.enabled = false; - # StartupTimings.enabled = false; - # SupportHelper.enabled = true; - # TextReplace.enabled = false; - # TimeBarAllActivities.enabled = false; - # Translate.enabled = false; - # TypingIndicator = { - # enabled = true; - # includeMutedChannels = false; - # }; - # TypingTweaks = { - # enabled = true; - # alternativeFormatting = true; - # showRoleColors = true; - # showAvatars = true; - # }; - # Unindent.enabled = false; - # UnsuppressEmbeds.enabled = false; - # UrbanDictionary.enabled = false; - # UserVoiceShow.enabled = false; - # USRBG.enabled = false; - # UwUifier.enabled = false; - # ValidUser.enabled = false; - # VoiceChatDoubleClick.enabled = false; - # VcNarrator.enabled = false; - # VencordToolbox.enabled = false; - # ViewIcons.enabled = false; - # ViewRaw.enabled = false; - # WebContextMenus.enabled = false; - # GreetStickerPicker.enabled = false; - # WhoReacted.enabled = false; - # Wikisearch.enabled = false; - # FavoriteGifSearch.enabled = false; - # NormalizeMessageLinks.enabled = false; - # PreviewMessage.enabled = false; - # "AI Noise Suppression" = { - # enabled = true; - # isEnabled = true; - # }; - # SecretRingToneEnabler.enabled = false; - # VoiceMessages.enabled = false; - # }; - # notifications = { - # timeout = 5000; - # position = "bottom-right"; - # useNative = "not-focused"; - # logLimit = 50; - # }; - # cloud = { - # authenticated = false; - # url = "https://api.vencord.dev/"; - # settingsSync = false; - # settingsSyncVersion = 1694474144460; - # }; - # }; - # quickCss = ""; - # }; - #}; + # "${storage}/lang.json".text = builtins.toJSON { + # lang = "en-GB"; + # }; + + # # this file doesn't actually do anything - you have to import it manually because of armcord's limitations + # "${storage}/vencord.json".text = builtins.toJSON { + # settings = { + # notifyAboutUpdates = true; + # autoUpdate = false; + # autoUpdateNotification = true; + # useQuickCss = true; + # themeLinks = []; + # enabledThemes = []; + # enableReactDevtools = false; + # frameless = false; + # transparent = false; + # winCtrlQ = false; + # macosTranslucency = false; + # disableMinSize = false; + # winNativeTitleBar = false; + # plugins = { + # BadgeAPI.enabled = true; + # CommandsAPI.enabled = true; + # ContextMenuAPI.enabled = true; + # MemberListDecoratorsAPI.enabled = false; + # MessageAccessoriesAPI.enabled = false; + # MessageDecorationsAPI.enabled = false; + # MessageEventsAPI.enabled = true; + # MessagePopoverAPI.enabled = false; + # NoticesAPI.enabled = true; + # ServerListAPI.enabled = false; + # SettingsStoreAPI.enabled = false; + # NoTrack.enabled = true; + # Settings = { + # enabled = true; + # settingsLocation = "aboveActivity"; + # }; + # AlwaysAnimate.enabled = false; + # AlwaysTrust.enabled = false; + # AnonymiseFileNames.enabled = false; + # "WebRichPresence (arRPC)".enabled = false; + # BANger.enabled = false; + # BetterFolders = { + # enabled = true; + # sidebar = true; + # closeAllHomeButton = false; + # closeAllFolders = false; + # forceOpen = false; + # sidebarAnim = true; + # }; + # BetterGifAltText.enabled = false; + # BetterNotesBox.enabled = false; + # BetterRoleDot.enabled = false; + # BetterUploadButton.enabled = false; + # BiggerStreamPreview.enabled = false; + # BlurNSFW = { + # enabled = true; + # blurAmount = 10; + # }; + # CallTimer.enabled = false; + # ClearURLs.enabled = false; + # ColorSighted.enabled = false; + # ConsoleShortcuts.enabled = false; + # CrashHandler.enabled = true; + # CustomRPC.enabled = false; + # DisableDMCallIdle.enabled = false; + # EmoteCloner.enabled = false; + # Experiments.enabled = false; + # F8Break.enabled = false; + # FakeNitro = { + # enabled = true; + # enableEmojiBypass = true; + # enableStickerBypass = true; + # enableStreamQualityBypass = true; + # transformStickers = true; + # transformEmojis = true; + # transformCompoundSentence = false; + # emojiSize = 48; + # }; + # FakeProfileThemes.enabled = false; + # FavoriteEmojiFirst.enabled = false; + # FixInbox.enabled = false; + # ForceOwnerCrown.enabled = false; + # FriendInvites.enabled = false; + # GameActivityToggle.enabled = false; + # GifPaste.enabled = false; + # HideAttachments.enabled = false; + # iLoveSpam.enabled = false; + # IgnoreActivities.enabled = false; + # ImageZoom.enabled = false; + # InvisibleChat.enabled = false; + # KeepCurrentChannel.enabled = false; + # LastFMRichPresence.enabled = false; + # LoadingQuotes.enabled = false; + # MemberCount.enabled = true; + # MessageClickActions.enabled = false; + # MessageLinkEmbeds.enabled = false; + # MessageLogger = { + # enabled = true; + # deleteStyle = "text"; + # ignoreBots = false; + # ignoreSelf = false; + # ignoreUsers = ""; + # ignoreChannels = ""; + # ignoreGuilds = ""; + # }; + # MessageTags.enabled = false; + # MoreCommands.enabled = false; + # MoreKaomoji.enabled = false; + # MoreUserTags.enabled = false; + # Moyai.enabled = false; + # MuteNewGuild.enabled = false; + # MutualGroupDMs.enabled = false; + # NoBlockedMessages = { + # enabled = true; + # ignoreBlockedMessages = false; + # }; + # NoDevtoolsWarning.enabled = false; + # NoF1.enabled = false; + # NoPendingCount.enabled = false; + # NoProfileThemes.enabled = true; + # NoReplyMention = { + # enabled = true; + # userList = ""; + # shouldPingListed = true; + # }; + # NoScreensharePreview.enabled = false; + # NoUnblockToJump.enabled = false; + # NSFWGateBypass.enabled = false; + # oneko.enabled = false; + # OpenInApp.enabled = false; + # "Party mode 🎉".enabled = false; + # PermissionsViewer.enabled = false; + # petpet.enabled = false; + # PinDMs.enabled = false; + # PlainFolderIcon.enabled = false; + # PlatformIndicators.enabled = false; + # PronounDB.enabled = false; + # QuickMention.enabled = false; + # QuickReply.enabled = false; + # ReactErrorDecoder.enabled = false; + # ReadAllNotificationsButton.enabled = false; + # RelationshipNotifier.enabled = false; + # RevealAllSpoilers.enabled = false; + # ReverseImageSearch.enabled = false; + # ReviewDB.enabled = false; + # RoleColorEverywhere.enabled = false; + # SearchReply.enabled = false; + # SendTimestamps.enabled = false; + # ServerListIndicators.enabled = false; + # ShikiCodeblocks.enabled = false; + # ShowAllMessageButtons.enabled = false; + # ShowConnections.enabled = false; + # ShowHiddenChannels = { + # enabled = true; + # showMode = 0; + # hideUnreads = true; + # }; + # ShowMeYourName.enabled = false; + # SilentMessageToggle.enabled = false; + # SilentTyping = { + # enabled = true; + # showIcon = false; + # isEnabled = true; + # }; + # SortFriendRequests.enabled = false; + # SpotifyControls.enabled = false; + # SpotifyCrack.enabled = false; + # SpotifyShareCommands.enabled = false; + # StartupTimings.enabled = false; + # SupportHelper.enabled = true; + # TextReplace.enabled = false; + # TimeBarAllActivities.enabled = false; + # Translate.enabled = false; + # TypingIndicator = { + # enabled = true; + # includeMutedChannels = false; + # }; + # TypingTweaks = { + # enabled = true; + # alternativeFormatting = true; + # showRoleColors = true; + # showAvatars = true; + # }; + # Unindent.enabled = false; + # UnsuppressEmbeds.enabled = false; + # UrbanDictionary.enabled = false; + # UserVoiceShow.enabled = false; + # USRBG.enabled = false; + # UwUifier.enabled = false; + # ValidUser.enabled = false; + # VoiceChatDoubleClick.enabled = false; + # VcNarrator.enabled = false; + # VencordToolbox.enabled = false; + # ViewIcons.enabled = false; + # ViewRaw.enabled = false; + # WebContextMenus.enabled = false; + # GreetStickerPicker.enabled = false; + # WhoReacted.enabled = false; + # Wikisearch.enabled = false; + # FavoriteGifSearch.enabled = false; + # NormalizeMessageLinks.enabled = false; + # PreviewMessage.enabled = false; + # "AI Noise Suppression" = { + # enabled = true; + # isEnabled = true; + # }; + # SecretRingToneEnabler.enabled = false; + # VoiceMessages.enabled = false; + # }; + # notifications = { + # timeout = 5000; + # position = "bottom-right"; + # useNative = "not-focused"; + # logLimit = 50; + # }; + # cloud = { + # authenticated = false; + # url = "https://api.vencord.dev/"; + # settingsSync = false; + # settingsSyncVersion = 1694474144460; + # }; + # }; + # quickCss = ""; + # }; + #}; + }; + }; } diff --git a/modules/gui/cursor.nix b/modules/gui/cursor.nix new file mode 100644 index 00000000..4ed38ef0 --- /dev/null +++ b/modules/gui/cursor.nix @@ -0,0 +1,34 @@ +{ + config, + config', + lib, + ... +}: with lib; let + cfg = config.myOptions.themes.cursor; +in { + options.myOptions.themes.cursor = { + enable = mkEnableOption "enable cursor theming"; + package = mkOption { + description = "cursor theme package"; + type = types.package; + }; + name = mkOption { + description = "cursor theme name"; + type = types.str; + }; + size = mkOption { + description = "cursor size"; + type = types.int; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + home.pointerCursor = { + inherit (cfg) package name size; + gtk.enable = true; + x11.enable = true; + }; + }; + }; +} diff --git a/modules/gui/default.nix b/modules/gui/default.nix index 7ae33890..35e1b6ca 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -1,8 +1,9 @@ _: { imports = [ - ./eww + #./eww ./anyrun.nix ./armcord.nix + ./cursor.nix ./firefox.nix ./foot.nix ./gtk.nix @@ -10,7 +11,7 @@ _: { ./hypr.nix ./mpv.nix ./qt.nix - ./rofi.nix + #./rofi.nix ./swaylock.nix ./waybar.nix ./zathura.nix diff --git a/modules/gui/firefox.nix b/modules/gui/firefox.nix index 70b65559..9725c95e 100644 --- a/modules/gui/firefox.nix +++ b/modules/gui/firefox.nix @@ -1,8 +1,12 @@ { + config, + config', lib, pkgs, ... -}: let +}: with lib; let + cfg = config.myOptions.programs.firefox; + buildFirefoxXpiAddon = lib.makeOverridable ({ stdenv ? pkgs.stdenv, fetchurl ? pkgs.fetchurl, @@ -49,419 +53,409 @@ sha256 = "1wjzivdmppbzrwdxhza5dzzljl3z59vfgggxim9xjb2rzr0wqyyf"; }; in { - xdg.desktopEntries = { - firefox-schizo = { - name = "Schizofox"; - genericName = "Web Browser"; - exec = "firefox --name firefox-schizo --profile /home/jacek/.mozilla/firefox/schizo %U"; - icon = "${logo}"; - terminal = false; - categories = [ "Network" "WebBrowser" ]; - mimeType = [ "text/html" "text/xml" "application/xhtml+xml" "application/vnd.mozilla.xul+xml" "x-scheme-handler/http" "x-scheme-handler/https" ]; - type = "Application"; - startupNotify = true; - settings = { - StartupWMClass = "firefox-schizo"; - }; - }; - firefox-unschizo = { - name = "Sanefox"; - genericName = "Web Browser"; - exec = "firefox --name firefox-sane --profile /home/jacek/.mozilla/firefox/unschizo %U"; - icon = "${logo}"; - terminal = false; - categories = [ "Network" "WebBrowser" ]; - mimeType = [ "text/html" "text/xml" "application/xhtml+xml" "application/vnd.mozilla.xul+xml" "x-scheme-handler/http" "x-scheme-handler/https" ]; - type = "Application"; - startupNotify = true; - settings = { - StartupWMClass = "firefox-sane"; - }; + options.myOptions.programs.firefox = { + enable = mkEnableOption "enable firefox"; + searchEngines = mkOption { + default = [{ + url = "https://startpage.com"; + name = "Startpage"; + aliases = [ "@sp" ]; + }]; + description = "search engines"; + type = with types; attrsOf (submodule { + options = { + url = mkOption { + description = "url for the search engine, params placeholder and all"; + type = str; + }; + favicon = mkOption { + default = ""; + description = "url or path to favicon"; + type = str; + }; + aliases = mkOption { + description = "aliases for the search engine"; + type = listOf str; + }; + }; + }); }; }; - programs.firefox = { - enable = true; - package = pkgs.firefox-devedition; - profiles = { - "schizo" = { - id = 0; - isDefault = true; - search = { - default = "${searxng-name}"; - force = true; - engines = { - "${searxng-name}" = searxng; - "NixOS Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "channel"; value = "unstable"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - "NixOS Options" = { - urls = [{ - template = "https://search.nixos.org/options"; - params = [ - { name = "channel"; value = "unstable"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@no" ]; - }; - "NixOS Wiki" = { - urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@nw" ]; - }; - "Home Manager Option Search" = { - urls = [{ template = "https://mipmip.github.io/home-manager-option-search/?query={searchTerms}"; }]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@hm" ]; - }; - "Arch Wiki" = { - url = [{ template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://archlinux.org/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@aw" ]; - }; - "Gentoo Wiki" = { - url = [{ template = "https://wiki.gentoo.org/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://www.gentoo.org/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@gw" ]; - }; - "Debian Wiki" = { - url = [{ template = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}"; }]; - iconUpdateURL = "https://www.debian.org/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@dw" ]; - }; - # GTFO - "Google".metaData.hidden = true; - "Bing".metaData.hidden = true; - "DuckDuckGo".metaData.hidden = true; - "Amazon.com".metaData.hidden = true; + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + xdg.desktopEntries = { + firefox-schizo = { + name = "Schizofox"; + genericName = "Web Browser"; + exec = "firefox --name firefox-schizo --profile /home/jacek/.mozilla/firefox/schizo %U"; + icon = "${logo}"; + terminal = false; + categories = [ "Network" "WebBrowser" ]; + mimeType = [ "text/html" "text/xml" "application/xhtml+xml" "application/vnd.mozilla.xul+xml" "x-scheme-handler/http" "x-scheme-handler/https" ]; + type = "Application"; + startupNotify = true; + settings = { + StartupWMClass = "firefox-schizo"; }; }; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - sponsorblock - tridactyl - violentmonkey - darkreader - keepassxc-browser - redirector - auto-tab-discard - extra-addons.yomichan - ]; - settings = { - "browser.aboutConfig.showWarning" = false; - "browser.startup.page" = 0; - "browser.startup.homepage" = "about:home"; - "browser.newtabpage.enabled" = true; - "browser.newtabpage.activity-stream.showSponsored" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.default.sites" = ""; - "geo.provider.network.url" = ""; - "geo.provider.network.logging.enabled" = false; - "geo.provider.ms-windows-location" = false; - "geo.provider.use_corelocation" = false; - "geo.provider.use_gpsd" = false; - "geo.provider.use_geoclue" = false; - "intl.accept_langauges" = "en-US"; - "javascript.use_us_english_locale" = true; - "extensions.getAddons.showPane" = false; - "extensions.htmlaboutaddons.recommendations.enabled" = false; - "browser.discovery.enabled" = false; - # this shit doesn't work thanks to firefox's - # fucking retarded ass decisions - # but I'm gonna keep it anyway - "extensions.unifiedExtensions.enabled" = false; - "datareporting.policy.dataSubmissionEnabled" = false; - "datareporting.healthreport.uploadEnabled" = false; - "toolkit.telemetry.unified" = false; - "toolkit.telemetry.enabled" = false; - "toolkit.telemetry.server" = "data:,"; - "toolkit.telemetry.archive.enabled" = false; - "toolkit.telemetry.newProfilePing.enabled" = false; - "toolkit.telemetry.shutdownPingSender.enabled" = false; - "toolkit.telemetry.updatePing.enabled" = false; - "toolkit.telemetry.bhrPing.enabled" = false; - "toolkit.telemetry.firstShutdownPing.enabled" = false; - "toolkit.telemetry.coverage.opt-out" = true; - "toolkit.coverage.endpoint.base" = ""; - "browser.ping-centre.telemetry" = false; - "browser.newtabpage.activity-stream.feeds.telemetry" = false; - "browser.newtabpage.activity-stream.telemetry" = false; - "app.shield.optoutstudies.enabled" = false; - "app.normandy.enabled" = false; - "app.normandy.api_url" = ""; - "breakpad.reportURL" = ""; - "browser.tabs.crashReporting.sendReport" = false; - "browser.crashReports.unsubmittedCheck.enabled" = false; - "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; - "captivedetect.canonicalURL" = ""; - "network.captive-portal-service.enabled" = false; - "network.connectivity-service.enabled" = false; - "browser.safebrowsing.malware.enabled" = false; - "browser.safebrowsing.phishing.enabled" = false; - "browser.safebrowsing.downloads.enabled" = false; - "browser.safebrowsing.downloads.remote.enabled" = false; - "browser.safebrowsing.downloads.remote.url" = ""; - "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; - "browser.safebrowsing.downloads.remote.block_uncommon" = false; - "browser.safebrowsing.allowOverride" = false; - "network.prefetch-next" = false; - "network.dns.disablePrefetch" = true; - "network.dns.disablePrefetchFromHTTPS" = true; - "network.predictor.enabled" = false; - "network.predictor.enable-prefetch" = false; - "network.http.speculative.parallel-limit" = 0; - "browser.places.speculativeConnect.enabled" = false; - "browser.send_pings" = false; - "network.dns.disableIPv6" = true; - "network.proxy.socks_remote_dns" = true; - "network.file.disable_unc_paths" = true; - "network.gio.supported-protocols" = ""; - "network.proxy.failover_direct" = false; - "network.proxy.allow_bypass" = false; - # "network.trr.mode" = 5; TODO read about this - "browser.fixup.alternate.enabled" = false; - # TODO do I want this - "browser.search.suggest.enabled" = true; - "browser.urlbar.suggest.searches" = true; - "browser.urlbar.speculativeConnect.enabled" = false; - "browser.urlbar.dnsResolveSingleWordsAfterSearch" = 0; - "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; - "browser.urlbar.suggest.quicksuggest.sponsored" = false; - "browser.formfill.enable" = false; - "layout.css.visited_links_enabled" = false; - "signon.autofillForms" = false; - "signon.formlessCapture.enabled" = false; - # TODO find some info about this - "network.auth.subresource-http-auth-allow" = 0; - "network.http.windows-sso.enabled" = false; - # TODO read about these until... - "browser.cache.disk.enable" = true; - "browser.privatebrowsing.forceMediaMemoryCache" = true; - "media.memory_cache_max_size" = 65536; - "browser.sessionstore.privacy_level" = 2; - # here - "toolkit.winRegisterApplicationRestart" = false; - # TODO favicons might be cool though - "browser.shell.shortcutFavicons" = false; - "security.ssl.require_safe_negotiation" = true; - "security.tls.enable_0rtt_data" = true; - # TODO read and think about it - "security.OCSP.enabled" = 1; - "security.OCSP.require" = true; - "security.family_safety.mode" = 0; - "security.cert_pinning.enforcement_level" = 2; - # TODO read about the next 2 - "security.remote_settings.crlite_filters.enabled" = true; - "security.pki.crlite_mode" = 2; - # TODO if images break it's probably this - "security.mixed_content.block_display_content" = true; - "dom.security.https_only_mode" = true; - "dom.security.https_only_mode_pbm" = true; - "dom.security.https_only_mode.upgrade_local" = true; - "dom.security.https_only_mode_send_http_background_request" = false; - "security.ssl.treat_unsafe_negotiation_as_broken" = true; - "browser.xul.error_pages.expert_bad_cert" = true; - "network.http.referer.XOriginPolicy" = 2; - "network.http.referer.XOriginTrimmingPolicy" = 2; - "privacy.userContext.enabled" = true; - "privacy.userContext.ui.enabled" = true; - "privacy.userContext.newTabContainerOnLeftClick.enabled" = true; - # TODO read about these 2 - "media.peerconnection.ice.proxy_only_if_behind_proxy" = true; - "media.peerconnection.ice.default_address_only" = true; - "media.peerconnection.ice.no_host" = true; - # TODO remove this if some codecs or shit don't work - "media.gmp-provider.enabled" = false; - # I think this is for netflix and shit - "media.gmp-widevinecdm.enabled" = false; - # disables DRM in general - "media.eme.enabled" = false; - # and the ui for it just in case - "browser.eme.ui.enabled" = false; - "dom.disable_window_move_resize" = true; - "accessibility.force_disabled" = 1; - "browser.helperApps.deleteTempFileOnExit" = true; - # TODO what the fuck is uitour - "browser.uitour.enabled" = false; - "browser.uitour.url" = ""; - "devtools.debugger.remote-enabled" = false; - "middlemouse.contentLoadURL" = false; - "permissions.default.shortcuts" = 2; - "permissions.manager.defaultsUrl" = ""; - # TODO what is this - "webchannel.allowObject.urlWhitelist" = ""; - "network.IDN_show_punycode" = true; - "pdfjs.disabled" = false; - "pdfjs.enableScripting" = false; - "network.protocol-handler.external.ms-windows-store" = false; - "permissions.delegation.enabled" = false; - "browser.download.useDownloadDir" = true; - "browser.download.alwaysOpenPanel" = false; - "browser.download.manager.addToRecentDocs" = true; - "browser.download.always_ask_before_handling_new_types" = true; - # if extensions break go here - "extensions.enabledScopes" = 5; - "extensions.autoDisableScopes" = 15; - # TODO rethink this - "extensions.postDownloadThirdPartyPrompt" = true; - "extensions.webextensions.restrictedDomains" = ""; - "browser.contentblocking.category" = "strict"; - "privacy.antitracking.enableWebcompat" = false; - "privacy.partition.serviceWorkers" = true; - "privacy.partition.always_partition_third_party_non_cookie_storage" = true; - "privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage" = false; - "privacy.sanitize.sanitizeOnShutdown" = true; - "privacy.clearOnShutdown.cache" = true; - "privacy.clearOnShutdown.downloads" = true; - "privacy.clearOnShutdown.formdata" = true; - "privacy.clearOnShutdown.history" = true; - "privacy.clearOnShutdown.sessions" = true; - "privacy.clearOnShutdown.siteSettings" = true; - # if true I can't recover from crashes according to arkenfox - "privacy.clearOnShutdown.openWindows" = false; - "privacy.clearOnShutdown.cookies" = true; - "privacy.clearOnShutdown.offlineApps" = true; - "privacy.clearsitedata.cache.enabled" = true; - "privacy.cpd.cache" = true; - "privacy.cpd.formdata" = true; - "privacy.cpd.history" = true; - "privacy.cpd.sessions" = true; - "privacy.cpd.offlineApps" = true; - "privacy.cpd.cookies" = true; - "privacy.cpd.downloads" = true; - "privacy.cpd.openWindows" = false; - "privacy.cpd.passwords" = true; - "privacy.cpd.siteSettings" = true; - "privacy.sanitize.timeSpan" = 0; - "privacy.resistFingerprint" = false; - # we won't be installing extensions through mozilla's website I don't think - "privacy.resistFingerprinting.block_mozAddonManager" = true; - "privacy.resistFingerprinting.letterboxing" = true; - "layout.css.font-visibility.resistFingerprinting" = 1; - "browser.display.use_system_colors" = false; - "widget.non-native-theme.enabled" = true; - "browser.link.open_newwindow" = 3; - "browser.link.open_newwindow.restriction" = 0; - "webgl.disabled" = false; - "signon.rememberSignons" = false; - "permissions.memory_only" = true; - "security.nocertdb" = true; - "browser.chrome.site_icons" = true; - "browser.session.max_tabs_undo" = 0; - "browser.sessionstore.resume_from_crash" = true; - "browser.urlbar.autoFill" = false; - "places.history.enabled" = false; - "extensions.formautofill.addresses.enabled" = false; - "extensions.formautofill.creditCards.enabled" = false; - "extensions.formautofill.heuristics.enabled" = false; - "dom.popup_allowed_events" = "click dblclick mousedown pointerdown"; - "javascript.options.ion" = false; - "javascript.options.baselinejit" = false; - "javascript.options.jit_trustedprincipals" = true; - "javascript.options.wasm" = false; - "extensions.blocklist.enabled" = true; - "network.http.referer.spoofSource" = false; - "security.dialog_enable_delay" = 1000; - "privacy.firstparty.isolate" = false; - "extensions.webcompat.enable_shims" = true; - "security.tls.version.enable-deprecated" = false; - "extensions.webcompat-reporter.enabled" = false; - - "gfx.webrender.all" = true; - "media.ffmpeg.vaapi.enabled" = true; + firefox-unschizo = { + name = "Sanefox"; + genericName = "Web Browser"; + exec = "firefox --name firefox-sane --profile /home/jacek/.mozilla/firefox/unschizo %U"; + icon = "${logo}"; + terminal = false; + categories = [ "Network" "WebBrowser" ]; + mimeType = [ "text/html" "text/xml" "application/xhtml+xml" "application/vnd.mozilla.xul+xml" "x-scheme-handler/http" "x-scheme-handler/https" ]; + type = "Application"; + startupNotify = true; + settings = { + StartupWMClass = "firefox-sane"; + }; }; }; - "unschizo" = { - id = 1; - isDefault = false; - search = { - default = "${searxng-name}"; - force = true; - engines = { - "${searxng-name}" = searxng; - # GTFO - "Google".metaData.hidden = true; - "Bing".metaData.hidden = true; - "DuckDuckGo".metaData.hidden = true; - "Amazon.com".metaData.hidden = true; - }; - }; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - sponsorblock - dearrow - tridactyl - violentmonkey - darkreader - keepassxc-browser - auto-tab-discard - extra-addons.yomichan - ]; - settings = { - "browser.aboutConfig.showWarning" = false; - "browser.startup.page" = 0; - "browser.startup.homepage" = "about:home"; - "browser.newtabpage.enabled" = true; - "browser.newtabpage.activity-stream.showSponsored" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.default.sites" = ""; - "extensions.getAddons.showPane" = false; - "extensions.htmlaboutaddons.recommendations.enabled" = false; - "browser.discovery.enabled" = false; - "extensions.unifiedExtensions.enabled" = false; - "datareporting.policy.dataSubmissionEnabled" = false; - "datareporting.healthreport.uploadEnabled" = false; - "toolkit.telemetry.unified" = false; - "toolkit.telemetry.enabled" = false; - "toolkit.telemetry.server" = "data:,"; - "toolkit.telemetry.archive.enabled" = false; - "toolkit.telemetry.newProfilePing.enabled" = false; - "toolkit.telemetry.shutdownPingSender.enabled" = false; - "toolkit.telemetry.updatePing.enabled" = false; - "toolkit.telemetry.bhrPing.enabled" = false; - "toolkit.telemetry.firstShutdownPing.enabled" = false; - "toolkit.telemetry.coverage.opt-out" = true; - "toolkit.coverage.endpoint.base" = ""; - "browser.ping-centre.telemetry" = false; - "browser.newtabpage.activity-stream.feeds.telemetry" = false; - "browser.newtabpage.activity-stream.telemetry" = false; - "app.shield.optoutstudies.enabled" = false; - "app.normandy.enabled" = false; - "app.normandy.api_url" = ""; - "breakpad.reportURL" = ""; - "browser.tabs.crashReporting.sendReport" = false; - "browser.crashReports.unsubmittedCheck.enabled" = false; - "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; - "captivedetect.canonicalURL" = ""; - "network.captive-portal-service.enabled" = false; - "network.connectivity-service.enabled" = false; - "browser.safebrowsing.malware.enabled" = false; - "browser.safebrowsing.phishing.enabled" = false; - "browser.safebrowsing.downloads.enabled" = false; - "browser.safebrowsing.downloads.remote.enabled" = false; - "browser.safebrowsing.downloads.remote.url" = ""; - "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; - "browser.safebrowsing.downloads.remote.block_uncommon" = false; - "browser.safebrowsing.allowOverride" = false; - "privacy.resistFingerprinting.block_mozAddonManager" = true; - "signon.rememberSignons" = false; - "gfx.webrender.all" = true; - "media.ffmpeg.vaapi.enabled" = true; + programs.firefox = { + enable = true; + package = pkgs.firefox-devedition; + profiles = { + "schizo" = { + id = 0; + isDefault = true; + search = { + default = "${searxng-name}"; + force = true; + engines = (mapAttrs (name: value: { + ${name} = { + urls = [{ template = value.url; }]; + icon = if isPath value.favicon then value.favicon else ""; + iconUpdateURL = if isPath value.favicon then "" else value.favicon; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = value.aliases; + }; + }) cfg.searchEngines) + // { + # GTFO + "Google".metaData.hidden = true; + "Bing".metaData.hidden = true; + "DuckDuckGo".metaData.hidden = true; + "Amazon.com".metaData.hidden = true; + }; + }; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + sponsorblock + tridactyl + violentmonkey + darkreader + keepassxc-browser + redirector + auto-tab-discard + extra-addons.yomichan + ]; + settings = { + "browser.aboutConfig.showWarning" = false; + "browser.startup.page" = 0; + "browser.startup.homepage" = "about:home"; + "browser.newtabpage.enabled" = true; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.default.sites" = ""; + "geo.provider.network.url" = ""; + "geo.provider.network.logging.enabled" = false; + "geo.provider.ms-windows-location" = false; + "geo.provider.use_corelocation" = false; + "geo.provider.use_gpsd" = false; + "geo.provider.use_geoclue" = false; + "intl.accept_langauges" = "en-US"; + "javascript.use_us_english_locale" = true; + "extensions.getAddons.showPane" = false; + "extensions.htmlaboutaddons.recommendations.enabled" = false; + "browser.discovery.enabled" = false; + # this shit doesn't work thanks to firefox's + # fucking retarded ass decisions + # but I'm gonna keep it anyway + "extensions.unifiedExtensions.enabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.server" = "data:,"; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.updatePing.enabled" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.coverage.opt-out" = true; + "toolkit.coverage.endpoint.base" = ""; + "browser.ping-centre.telemetry" = false; + "browser.newtabpage.activity-stream.feeds.telemetry" = false; + "browser.newtabpage.activity-stream.telemetry" = false; + "app.shield.optoutstudies.enabled" = false; + "app.normandy.enabled" = false; + "app.normandy.api_url" = ""; + "breakpad.reportURL" = ""; + "browser.tabs.crashReporting.sendReport" = false; + "browser.crashReports.unsubmittedCheck.enabled" = false; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; + "captivedetect.canonicalURL" = ""; + "network.captive-portal-service.enabled" = false; + "network.connectivity-service.enabled" = false; + "browser.safebrowsing.malware.enabled" = false; + "browser.safebrowsing.phishing.enabled" = false; + "browser.safebrowsing.downloads.enabled" = false; + "browser.safebrowsing.downloads.remote.enabled" = false; + "browser.safebrowsing.downloads.remote.url" = ""; + "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; + "browser.safebrowsing.downloads.remote.block_uncommon" = false; + "browser.safebrowsing.allowOverride" = false; + "network.prefetch-next" = false; + "network.dns.disablePrefetch" = true; + "network.dns.disablePrefetchFromHTTPS" = true; + "network.predictor.enabled" = false; + "network.predictor.enable-prefetch" = false; + "network.http.speculative.parallel-limit" = 0; + "browser.places.speculativeConnect.enabled" = false; + "browser.send_pings" = false; + "network.dns.disableIPv6" = true; + "network.proxy.socks_remote_dns" = true; + "network.file.disable_unc_paths" = true; + "network.gio.supported-protocols" = ""; + "network.proxy.failover_direct" = false; + "network.proxy.allow_bypass" = false; + # "network.trr.mode" = 5; TODO read about this + "browser.fixup.alternate.enabled" = false; + # TODO do I want this + "browser.search.suggest.enabled" = true; + "browser.urlbar.suggest.searches" = true; + "browser.urlbar.speculativeConnect.enabled" = false; + "browser.urlbar.dnsResolveSingleWordsAfterSearch" = 0; + "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; + "browser.urlbar.suggest.quicksuggest.sponsored" = false; + "browser.formfill.enable" = false; + "layout.css.visited_links_enabled" = false; + "signon.autofillForms" = false; + "signon.formlessCapture.enabled" = false; + # TODO find some info about this + "network.auth.subresource-http-auth-allow" = 0; + "network.http.windows-sso.enabled" = false; + # TODO read about these until... + "browser.cache.disk.enable" = true; + "browser.privatebrowsing.forceMediaMemoryCache" = true; + "media.memory_cache_max_size" = 65536; + "browser.sessionstore.privacy_level" = 2; + # here + "toolkit.winRegisterApplicationRestart" = false; + # TODO favicons might be cool though + "browser.shell.shortcutFavicons" = false; + "security.ssl.require_safe_negotiation" = true; + "security.tls.enable_0rtt_data" = true; + # TODO read and think about it + "security.OCSP.enabled" = 1; + "security.OCSP.require" = true; + "security.family_safety.mode" = 0; + "security.cert_pinning.enforcement_level" = 2; + # TODO read about the next 2 + "security.remote_settings.crlite_filters.enabled" = true; + "security.pki.crlite_mode" = 2; + # TODO if images break it's probably this + "security.mixed_content.block_display_content" = true; + "dom.security.https_only_mode" = true; + "dom.security.https_only_mode_pbm" = true; + "dom.security.https_only_mode.upgrade_local" = true; + "dom.security.https_only_mode_send_http_background_request" = false; + "security.ssl.treat_unsafe_negotiation_as_broken" = true; + "browser.xul.error_pages.expert_bad_cert" = true; + "network.http.referer.XOriginPolicy" = 2; + "network.http.referer.XOriginTrimmingPolicy" = 2; + "privacy.userContext.enabled" = true; + "privacy.userContext.ui.enabled" = true; + "privacy.userContext.newTabContainerOnLeftClick.enabled" = true; + # TODO read about these 2 + "media.peerconnection.ice.proxy_only_if_behind_proxy" = true; + "media.peerconnection.ice.default_address_only" = true; + "media.peerconnection.ice.no_host" = true; + # TODO remove this if some codecs or shit don't work + "media.gmp-provider.enabled" = false; + # I think this is for netflix and shit + "media.gmp-widevinecdm.enabled" = false; + # disables DRM in general + "media.eme.enabled" = false; + # and the ui for it just in case + "browser.eme.ui.enabled" = false; + "dom.disable_window_move_resize" = true; + "accessibility.force_disabled" = 1; + "browser.helperApps.deleteTempFileOnExit" = true; + # TODO what the fuck is uitour + "browser.uitour.enabled" = false; + "browser.uitour.url" = ""; + "devtools.debugger.remote-enabled" = false; + "middlemouse.contentLoadURL" = false; + "permissions.default.shortcuts" = 2; + "permissions.manager.defaultsUrl" = ""; + # TODO what is this + "webchannel.allowObject.urlWhitelist" = ""; + "network.IDN_show_punycode" = true; + "pdfjs.disabled" = false; + "pdfjs.enableScripting" = false; + "network.protocol-handler.external.ms-windows-store" = false; + "permissions.delegation.enabled" = false; + "browser.download.useDownloadDir" = true; + "browser.download.alwaysOpenPanel" = false; + "browser.download.manager.addToRecentDocs" = true; + "browser.download.always_ask_before_handling_new_types" = true; + # if extensions break go here + "extensions.enabledScopes" = 5; + "extensions.autoDisableScopes" = 15; + # TODO rethink this + "extensions.postDownloadThirdPartyPrompt" = true; + "extensions.webextensions.restrictedDomains" = ""; + "browser.contentblocking.category" = "strict"; + "privacy.antitracking.enableWebcompat" = false; + "privacy.partition.serviceWorkers" = true; + "privacy.partition.always_partition_third_party_non_cookie_storage" = true; + "privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage" = false; + "privacy.sanitize.sanitizeOnShutdown" = true; + "privacy.clearOnShutdown.cache" = true; + "privacy.clearOnShutdown.downloads" = true; + "privacy.clearOnShutdown.formdata" = true; + "privacy.clearOnShutdown.history" = true; + "privacy.clearOnShutdown.sessions" = true; + "privacy.clearOnShutdown.siteSettings" = true; + # if true I can't recover from crashes according to arkenfox + "privacy.clearOnShutdown.openWindows" = false; + "privacy.clearOnShutdown.cookies" = true; + "privacy.clearOnShutdown.offlineApps" = true; + "privacy.clearsitedata.cache.enabled" = true; + "privacy.cpd.cache" = true; + "privacy.cpd.formdata" = true; + "privacy.cpd.history" = true; + "privacy.cpd.sessions" = true; + "privacy.cpd.offlineApps" = true; + "privacy.cpd.cookies" = true; + "privacy.cpd.downloads" = true; + "privacy.cpd.openWindows" = false; + "privacy.cpd.passwords" = true; + "privacy.cpd.siteSettings" = true; + "privacy.sanitize.timeSpan" = 0; + "privacy.resistFingerprint" = false; + # we won't be installing extensions through mozilla's website I don't think + "privacy.resistFingerprinting.block_mozAddonManager" = true; + "privacy.resistFingerprinting.letterboxing" = true; + "layout.css.font-visibility.resistFingerprinting" = 1; + "browser.display.use_system_colors" = false; + "widget.non-native-theme.enabled" = true; + "browser.link.open_newwindow" = 3; + "browser.link.open_newwindow.restriction" = 0; + "webgl.disabled" = false; + "signon.rememberSignons" = false; + "permissions.memory_only" = true; + "security.nocertdb" = true; + "browser.chrome.site_icons" = true; + "browser.session.max_tabs_undo" = 0; + "browser.sessionstore.resume_from_crash" = true; + "browser.urlbar.autoFill" = false; + "places.history.enabled" = false; + "extensions.formautofill.addresses.enabled" = false; + "extensions.formautofill.creditCards.enabled" = false; + "extensions.formautofill.heuristics.enabled" = false; + "dom.popup_allowed_events" = "click dblclick mousedown pointerdown"; + "javascript.options.ion" = false; + "javascript.options.baselinejit" = false; + "javascript.options.jit_trustedprincipals" = true; + "javascript.options.wasm" = false; + "extensions.blocklist.enabled" = true; + "network.http.referer.spoofSource" = false; + "security.dialog_enable_delay" = 1000; + "privacy.firstparty.isolate" = false; + "extensions.webcompat.enable_shims" = true; + "security.tls.version.enable-deprecated" = false; + "extensions.webcompat-reporter.enabled" = false; + + "gfx.webrender.all" = true; + "media.ffmpeg.vaapi.enabled" = true; + }; + }; + "unschizo" = { + id = 1; + isDefault = false; + search = { + default = "${searxng-name}"; + force = true; + engines = { + "${searxng-name}" = searxng; + # GTFO + "Google".metaData.hidden = true; + "Bing".metaData.hidden = true; + "DuckDuckGo".metaData.hidden = true; + "Amazon.com".metaData.hidden = true; + }; + }; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + sponsorblock + dearrow + tridactyl + violentmonkey + darkreader + keepassxc-browser + auto-tab-discard + extra-addons.yomichan + ]; + settings = { + "browser.aboutConfig.showWarning" = false; + "browser.startup.page" = 0; + "browser.startup.homepage" = "about:home"; + "browser.newtabpage.enabled" = true; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.default.sites" = ""; + "extensions.getAddons.showPane" = false; + "extensions.htmlaboutaddons.recommendations.enabled" = false; + "browser.discovery.enabled" = false; + "extensions.unifiedExtensions.enabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.server" = "data:,"; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.updatePing.enabled" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.coverage.opt-out" = true; + "toolkit.coverage.endpoint.base" = ""; + "browser.ping-centre.telemetry" = false; + "browser.newtabpage.activity-stream.feeds.telemetry" = false; + "browser.newtabpage.activity-stream.telemetry" = false; + "app.shield.optoutstudies.enabled" = false; + "app.normandy.enabled" = false; + "app.normandy.api_url" = ""; + "breakpad.reportURL" = ""; + "browser.tabs.crashReporting.sendReport" = false; + "browser.crashReports.unsubmittedCheck.enabled" = false; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; + "captivedetect.canonicalURL" = ""; + "network.captive-portal-service.enabled" = false; + "network.connectivity-service.enabled" = false; + "browser.safebrowsing.malware.enabled" = false; + "browser.safebrowsing.phishing.enabled" = false; + "browser.safebrowsing.downloads.enabled" = false; + "browser.safebrowsing.downloads.remote.enabled" = false; + "browser.safebrowsing.downloads.remote.url" = ""; + "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; + "browser.safebrowsing.downloads.remote.block_uncommon" = false; + "browser.safebrowsing.allowOverride" = false; + "privacy.resistFingerprinting.block_mozAddonManager" = true; + "signon.rememberSignons" = false; + + "gfx.webrender.all" = true; + "media.ffmpeg.vaapi.enabled" = true; + }; + }; }; }; }; diff --git a/modules/gui/foot.nix b/modules/gui/foot.nix index ab7020fc..2e8298fe 100644 --- a/modules/gui/foot.nix +++ b/modules/gui/foot.nix @@ -1,105 +1,123 @@ { + config, + config', inputs, + lib, pkgs, ... -}: { - programs.foot = { - enable = true; - package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot; - server.enable = true; - settings = { - main = { - term = "xterm-256color"; - app-id = "foot"; - title = "foot"; - locked-title = "no"; +}: with lib; let + cfg = config.myOptions.programs.foot; +in { + options.myOptions.programs.foot = { + enable = mkEnableOption "enable foot"; + server = mkOption { + description = "enable foot server mode"; + default = true; + type = types.bool; + }; + }; - font = "JetBrains Mono Nerd Font:size=16"; - line-height = 20; - letter-spacing = 0; - horizontal-letter-offset = 0; - vertical-letter-offset = -0.75; - box-drawings-uses-font-glyphs = "no"; - dpi-aware = "no"; + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.foot = { + enable = true; + package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot; + server.enable = cfg.server; + settings = { + main = { + term = "xterm-256color"; + app-id = "foot"; + title = "foot"; + locked-title = "no"; - initial-window-size-chars = "104x36"; - initial-window-mode = "windowed"; - pad = "5x5 center"; - resize-delay-ms = 100; + font = "JetBrains Mono Nerd Font:size=16"; + line-height = 20; + letter-spacing = 0; + horizontal-letter-offset = 0; + vertical-letter-offset = -0.75; + box-drawings-uses-font-glyphs = "no"; + dpi-aware = "no"; - notify = "${pkgs.libnotify}/bin/notify-send -a \${app-id} -i \${app-id} \${title} \${body}"; + initial-window-size-chars = "104x36"; + initial-window-mode = "windowed"; + pad = "5x5 center"; + resize-delay-ms = 100; - bold-text-in-bright = "no"; - word-delimiters = ",│`|:\"'()[]{}<>"; - selection-target = "primary"; - }; - bell = { - urgent = "yes"; - notify = "yes"; - command = "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 = "dee1e6"; - background = "101419"; - # Normal/regular colors (color palette 0-7) - regular0 = "c5c8cd"; # black - regular1 = "bd3c42"; # red - regular2 = "69b373"; # green - regular3 = "ceac67"; # yellow - regular4 = "4d82c8"; # blue - regular5 = "a367cb"; # magenta - regular6 = "519bc6"; # cyan - regular7 = "101419"; # white - # Bright colors (color palette 8-15) - bright0 = "989ba0"; # bright black - bright1 = "c24147"; # bright red - bright2 = "6eb878"; # bright green - bright3 = "d3b16c"; # bright yellow - bright4 = "5287cd"; # bright blue - bright5 = "a86cd0"; # bright magenta - bright6 = "56a0cb"; # bright cyan - bright7 = "1f2328"; # bright white - }; - 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"; + 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 = "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 = "dee1e6"; + background = "101419"; + # Normal/regular colors (color palette 0-7) + regular0 = "c5c8cd"; # black + regular1 = "bd3c42"; # red + regular2 = "69b373"; # green + regular3 = "ceac67"; # yellow + regular4 = "4d82c8"; # blue + regular5 = "a367cb"; # magenta + regular6 = "519bc6"; # cyan + regular7 = "101419"; # white + # Bright colors (color palette 8-15) + bright0 = "989ba0"; # bright black + bright1 = "c24147"; # bright red + bright2 = "6eb878"; # bright green + bright3 = "d3b16c"; # bright yellow + bright4 = "5287cd"; # bright blue + bright5 = "a86cd0"; # bright magenta + bright6 = "56a0cb"; # bright cyan + bright7 = "1f2328"; # bright white + }; + 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/gtk.nix b/modules/gui/gtk.nix index c6d5cbe9..2e8946b9 100644 --- a/modules/gui/gtk.nix +++ b/modules/gui/gtk.nix @@ -1,39 +1,71 @@ { config, - pkgs, config', + lib, ... -}: { - gtk = { - enable = true; - theme = { - name = config'.gtk-theme; - package = pkgs.catppuccin-gtk.override { - size = "standard"; - accents = [ "green" ]; - variant = "mocha"; - tweaks = [ "normal" ]; - }; +}: with lib; let + cfg = config.myOptions.themes.gtk; +in { + options.myOptions.themes.gtk = { + enable = mkEnableOption "enable gtk theming"; + name = mkOption { + description = "gtk theme name"; + type = types.str; }; - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.catppuccin-papirus-folders.override { - accent = "green"; - flavor = "mocha"; + variant = mkOption { + description = "gtk theme variant"; + type = types.str; + }; + accentColour = mkOption { + description = "accent colour for gtk theme"; + type = types.str; + }; + package = mkOption { + description = "gtk theme package"; + type = types.package; + }; + iconTheme = mkOption { + description = "gtk icon theme"; + type = with types; submodule { + options = { + name = mkOption { + description = "gtk icon theme name"; + type = str; + }; + package = mkOption { + description = "gtk icon theme package"; + type = package; + }; + }; }; }; }; - home = { - sessionVariables = { - GTK_THEME = config.gtk.theme.name; - GTK_USE_PORTAL = "1"; - }; - pointerCursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; - size = 24; - gtk.enable = true; - x11.enable = true; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + gtk = { + enable = true; + theme = { + inherit (cfg) name; + package = cfg.package.override { + size = "standard"; + accents = [ cfg.accentColour ]; + inherit (cfg) variant; + tweaks = [ "normal" ]; + }; + }; + iconTheme = { + inherit (cfg.iconTheme) name; + package = cfg.iconTheme.package.override { + accent = cfg.accentColour; + flavor = cfg.variant; + }; + }; + }; + home.sessionVariables = { + GTK_THEME = cfg.name; + GTK_USE_PORTAL = "1"; + }; }; }; } diff --git a/modules/gui/gtklock.nix b/modules/gui/gtklock.nix index bdf3974f..857e72df 100644 --- a/modules/gui/gtklock.nix +++ b/modules/gui/gtklock.nix @@ -1,14 +1,24 @@ { - pkgs, + config, config', + lib, + pkgs, ... -}: { - home.packages = with pkgs; [ - gtklock - ]; +}: with lib; let + cfg = config.myOptions.programs.gtklock; +in { + options.myOptions.programs.gtklock.enable = mkEnableOption "enable gtklock"; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + home.packages = with pkgs; [ + gtklock + ]; - xdg.configFile."gtklock/config.ini".text = '' - [main] - gtk-theme=${config'.gtk-theme} - ''; + xdg.configFile."gtklock/config.ini".text = '' + [main] + gtk-theme=${config.myOptions.themes.gtk.name} + ''; + }; + }; } diff --git a/modules/gui/hypr.nix b/modules/gui/hypr.nix index 9922981f..ceba1a1d 100644 --- a/modules/gui/hypr.nix +++ b/modules/gui/hypr.nix @@ -1,10 +1,13 @@ { config, + config', inputs, lib, pkgs, ... -}: let +}: with lib; let + cfg = config.myOptions.programs.hyprland; + nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system}; inherit (nixpkgs-wayland) foot; inherit (nixpkgs-wayland) wl-clipboard; @@ -16,298 +19,315 @@ inherit (inputs.shadower.packages.${pkgs.system}) shadower; inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; in { - wayland.windowManager.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.hyprland; - plugins = [ - #inputs.hyprland-plugins.packages.${pkgs.system}.csgo-vulkan-fix - inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces - ]; - extraConfig = '' - #laptop - monitor=eDP-1,2560@1440@60,0x0,1 - #second monitor - monitor=HDMI-A-1,2560x1440@144,2560x0,1 - workspace = 1, monitor:eDP-1, default:true - workspace = 2, monitor:eDP-1 - workspace = 3, monitor:eDP-1 - workspace = 4, monitor:eDP-1 - workspace = 5, monitor:eDP-1 - workspace = 6, monitor:eDP-1 - workspace = 7, monitor:eDP-1 - workspace = 8, monitor:eDP-1 - workspace = 9, monitor:eDP-1 - workspace = 10, monitor:eDP-1 + options.myOptions.programs.hyprland = { + enable = mkEnableOption "enable hiper ląd"; + }; - workspace = 11, monitor:HDMI-A-1, default:true - workspace = 12, monitor:HDMI-A-1 - workspace = 13, monitor:HDMI-A-1 - workspace = 14, monitor:HDMI-A-1 - workspace = 15, monitor:HDMI-A-1 - workspace = 16, monitor:HDMI-A-1 - workspace = 17, monitor:HDMI-A-1 - workspace = 18, monitor:HDMI-A-1 - workspace = 19, monitor:HDMI-A-1 - workspace = 20, monitor:HDMI-A-1 + config = mkIf cfg.enable { + nix.settings = { + substituters = [ "https://hyprland.cachix.org" ]; + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + }; - workspace = special:btop, decorate:false - workspace = special:amdgpu_top, decorate:false - workspace = special:helvum, decorate:false - workspace = special:nixos,decorate:false + home-manager.users.${config'.username} = { + imports = [ inputs.hyprland.homeManagerModules.default ]; - input { - kb_layout=pl,ru - kb_variant= - kb_model= - kb_options= - kb_rules= + wayland.windowManager.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + plugins = [ + #inputs.hyprland-plugins.packages.${pkgs.system}.csgo-vulkan-fix + inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + extraConfig = '' + #laptop + monitor=eDP-1,2560@1440@60,0x0,1 + #second monitor + monitor=HDMI-A-1,2560x1440@144,2560x0,1 - follow_mouse=1 - touchpad { - disable_while_typing=false - } + workspace = 1, monitor:eDP-1, default:true + workspace = 2, monitor:eDP-1 + workspace = 3, monitor:eDP-1 + workspace = 4, monitor:eDP-1 + workspace = 5, monitor:eDP-1 + workspace = 6, monitor:eDP-1 + workspace = 7, monitor:eDP-1 + workspace = 8, monitor:eDP-1 + workspace = 9, monitor:eDP-1 + workspace = 10, monitor:eDP-1 - repeat_rate = 50 - repeat_delay = 250 - } + workspace = 11, monitor:HDMI-A-1, default:true + workspace = 12, monitor:HDMI-A-1 + workspace = 13, monitor:HDMI-A-1 + workspace = 14, monitor:HDMI-A-1 + workspace = 15, monitor:HDMI-A-1 + workspace = 16, monitor:HDMI-A-1 + workspace = 17, monitor:HDMI-A-1 + workspace = 18, monitor:HDMI-A-1 + workspace = 19, monitor:HDMI-A-1 + workspace = 20, monitor:HDMI-A-1 - general { - sensitivity=1.0 # for mouse cursor + workspace = special:btop, decorate:false + workspace = special:amdgpu_top, decorate:false + workspace = special:helvum, decorate:false + workspace = special:nixos,decorate:false + workspace = special:rog,decorate:false + workspace = special:keepassxc,decorate:false - gaps_in=5 - gaps_out=5 - #gaps_in=0 - #gaps_out=0 - border_size=2 - #border_size=1 + input { + kb_layout=pl,ru + kb_variant= + kb_model= + kb_options= + kb_rules= - apply_sens_to_raw=0 # whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse) + follow_mouse=1 + touchpad { + disable_while_typing=false + } - #no_border_on_floating=true + repeat_rate = 50 + repeat_delay = 250 + } - #allow_tearing=true - } + general { + sensitivity=1.0 # for mouse cursor - decoration { - #rounding=0 - rounding=10 - blur { - enabled=1 - size=3 - passes=2 - } + gaps_in=5 + gaps_out=5 + #gaps_in=0 + #gaps_out=0 + border_size=2 + #border_size=1 - drop_shadow=1 - shadow_range=15 - shadow_render_power=2 - shadow_ignore_window=1 - shadow_offset= 2 4 - shadow_scale=1 - } + apply_sens_to_raw=0 # whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse) - gestures { - workspace_swipe=1 - workspace_swipe_distance=200 - workspace_swipe_invert=1 - workspace_swipe_min_speed_to_force=20 - workspace_swipe_cancel_ratio=0.5 - } + #no_border_on_floating=true - bezier=dupa, 0.1, 0.9, 0.1, 1.05 + #allow_tearing=true + } - animations { - enabled=1 - animation=windows,1,4,dupa,popin - animation=windowsOut,1,7,dupa,slide - animation=border,1,15,default - animation=fade,1,10,default - animation=workspaces,1,5,dupa,slidevert - } + decoration { + #rounding=0 + rounding=10 + blur { + enabled=1 + size=3 + passes=2 + } - dwindle { - no_gaps_when_only=1 - } + drop_shadow=1 + shadow_range=15 + shadow_render_power=2 + shadow_ignore_window=1 + shadow_offset= 2 4 + shadow_scale=1 + } - misc { - enable_swallow=0 - swallow_regex=foot - focus_on_activate=true - vrr=1 - animate_manual_resizes=false - animate_mouse_windowdragging=false - disable_hypr_chan=false - } + gestures { + workspace_swipe=1 + workspace_swipe_distance=200 + workspace_swipe_invert=1 + workspace_swipe_min_speed_to_force=20 + workspace_swipe_cancel_ratio=0.5 + } - windowrulev2 = float, title:^(.*)(Tor Browser)(.*)$ - windowrulev2 = float, class:^(mullvadbrowser)$ - windowrulev2 = float, class:^(foot)$ - windowrulev2 = float, class:^(mpv)$ - windowrulev2 = float, class:^(imv)$ - windowrulev2 = float, class:^(Vieb)$ - windowrulev2 = float, title:^(Picture-in-Picture)$ - windowrulev2 = float, title:^(.*)(Choose User Profile)(.*)$ + bezier=dupa, 0.1, 0.9, 0.1, 1.05 - windowrulev2 = float, class:^(xdg-desktop-portal-gtk)$ - windowrulev2 = float, class:^(code), title: ^(Open*) - windowrulev2 = size 70% 70%, class:^(code), title: ^(Open*) - windowrulev2 = center, class: ^(code), title: ^(Open*) - windowrulev2 = float, class:^(org.keepassxc.KeePassXC)$ - windowrulev2 = size 960 670, title:^(ROG Control Center)$ + animations { + enabled=1 + animation=windows,1,4,dupa,popin + animation=windowsOut,1,7,dupa,slide + animation=border,1,15,default + animation=fade,1,10,default + animation=workspaces,1,5,dupa,slidevert + } - #windowrulev2 = immediate, title:^(osu!)$ + dwindle { + no_gaps_when_only=1 + } - bind = SUPER, RETURN, exec, ${foot}/bin/footclient - bind = SUPER, W, exec, ${lib.removeSuffix " %U" config.xdg.desktopEntries.firefox-schizo.exec} - bind = SUPERSHIFT, W, exec, ${lib.removeSuffix " %U" config.xdg.desktopEntries.firefox-unschizo.exec} - bind = SUPER, Q, killactive - bind = SUPER, F, fullscreen, 0 - bind = SUPER, M, fullscreen, 1 - bind = SUPER, D, exec, ${pkgs.procps}/bin/pkill anyrun || ${anyrun}/bin/anyrun - bind = SUPER, SPACE, togglefloating, - bind = SUPERSHIFT, C, centerwindow - bind = SUPER, R, bringactivetotop - binde = SUPER, H, movefocus, l - binde = SUPER, J, movefocus, d - binde = SUPER, K, movefocus, u - binde = SUPER, L, movefocus, r - binde = SUPERCTRL, J, focusmonitor, l - binde = SUPERCTRL, K, focusmonitor, r - bind = SUPER, 1, split-workspace, 1 - bind = SUPER, 2, split-workspace, 2 - bind = SUPER, 3, split-workspace, 3 - bind = SUPER, 4, split-workspace, 4 - bind = SUPER, 5, split-workspace, 5 - bind = SUPER, 6, split-workspace, 6 - bind = SUPER, 7, split-workspace, 7 - bind = SUPER, 8, split-workspace, 8 - bind = SUPER, 9, split-workspace, 9 - bind = SUPER, 0, split-workspace, 10 - bind = SUPERSHIFT, 1, split-movetoworkspacesilent, 1 - bind = SUPERSHIFT, 2, split-movetoworkspacesilent, 2 - bind = SUPERSHIFT, 3, split-movetoworkspacesilent, 3 - bind = SUPERSHIFT, 4, split-movetoworkspacesilent, 4 - bind = SUPERSHIFT, 5, split-movetoworkspacesilent, 5 - bind = SUPERSHIFT, 6, split-movetoworkspacesilent, 6 - bind = SUPERSHIFT, 7, split-movetoworkspacesilent, 7 - bind = SUPERSHIFT, 8, split-movetoworkspacesilent, 8 - bind = SUPERSHIFT, 9, split-movetoworkspacesilent, 9 - bind = SUPERSHIFT, 0, split-movetoworkspacesilent, 10 - bindle = , XF86MonBrightnessUp, exec, ~/Scripts/notif_brightness.sh set +5% - bindle = , XF86MonBrightnessDown, exec, ~/Scripts/notif_brightness.sh set 5%- - bindl = , XF86AudioMedia, exec, ${pkgs.playerctl}/bin/playerctl play-pause - bindl = , XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause - bindl = , XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop - bindl = , XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous - bindl = , XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next - bindle = , XF86AudioRaiseVolume, exec, ~/Scripts/notif_volume.sh -ui 5 - bindle = , XF86AudioLowerVolume, exec, ~/Scripts/notif_volume.sh -ud 5 - bindl = , XF86AudioMute, exec, ~/Scripts/notif_volume.sh --toggle-mute + misc { + enable_swallow=0 + swallow_regex=foot + focus_on_activate=true + vrr=1 + animate_manual_resizes=false + animate_mouse_windowdragging=false + force_default_wallpaper=0 + } - bind = SUPER, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken" - bind = SUPERSHIFT, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken (shadower)" - bind = SUPERCONTROL, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken" - bind = SUPERSHIFTCONTROL, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken (shadower)" + windowrulev2 = float, title:^(.*)(Tor Browser)(.*)$ + windowrulev2 = float, class:^(mullvadbrowser)$ + windowrulev2 = float, class:^(foot)$ + windowrulev2 = float, class:^(mpv)$ + windowrulev2 = float, class:^(imv)$ + windowrulev2 = float, class:^(Vieb)$ + windowrulev2 = float, title:^(Picture-in-Picture)$ + windowrulev2 = float, title:^(.*)(Choose User Profile)(.*)$ - bind = SUPERSHIFT, R, exec, ${hyprland}/bin/hyprctl reload - bind = SUPER, P, pin - bind = , XF86Launch1, exec, ${pkgs.asusctl}/bin/rog-control-center - binde = , XF86Launch3, exec, ${pkgs.asusctl}/bin/asusctl led-mode -n - bind = , XF86Launch4, exec, ${pkgs.asusctl}/bin/asusctl profile -n - binde = , XF86KbdBrightnessUp, exec, ${pkgs.asusctl}/bin/asusctl -n - binde = , XF86KbdBrightnessDown, exec, ${pkgs.asusctl}/bin/asusctl -p - bind = , XF86TouchpadToggle, exec, - bind = SUPER, T, exec, grim -g "$(slurp)" -t ppm - | tesseract -l pol - - | wl-copy && notify-send "Copied text: " "\"$(wl-paste)\"" - bind = SUPER, SEMICOLON, exec, ~/.config/rofi/powermenu/type-2/powermenu.sh - bind = SUPER, X, exec, ${pkgs.keepassxc}/bin/keepassxc - bind = SUPER, G, togglegroup - binde = SUPERSHIFT, G, changegroupactive, f - binde = SUPERCONTROL, G, changegroupactive, b - bind = SUPERCONTROL, R, exec, replay-sorcery save - bind = SUPERCONTROL, X, exec, ${pkgs.systemd}/bin/systemctl --user restart xdg-desktop-portal-hyprland - bind = SUPERSHIFT, X, exec, ${hyprland}/bin/hyprctl kill - bind = SUPER, B, togglespecialworkspace, btop - bind = SUPER, A, togglespecialworkspace, amdgpu_top - bind = SUPER, V, togglespecialworkspace, helvum - bind = SUPER, N, togglespecialworkspace, nixos - bind = SUPER, C, exec, ${swaylock}/bin/swaylock - bind = SUPERCONTROL, B, exec, systemctl is-active --user && systemctl stop --user waybar || systemctl start --user waybar + windowrulev2 = float, class:^(xdg-desktop-portal-gtk)$ + windowrulev2 = float, class:^(code), title: ^(Open*) + windowrulev2 = size 70% 70%, class:^(code), title: ^(Open*) + windowrulev2 = center, class: ^(code), title: ^(Open*) + windowrulev2 = float, class:^(org.keepassxc.KeePassXC)$ + windowrulev2 = size 960 670, title:^(ROG Control Center)$ - bindm = SUPER, mouse:272, movewindow - bindm = SUPER, mouse:273, resizewindow + #windowrulev2 = immediate, title:^(osu!)$ - binds { - pass_mouse_when_bound=0 - } + bind = SUPER, RETURN, exec, ${foot}/bin/${if config.myOptions.programs.foot.server then "footclient" else "foot"} + bind = SUPER, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-schizo.exec} + bind = SUPERSHIFT, W, exec, ${removeSuffix " %U" config.home-manager.users.${config'.username}.xdg.desktopEntries.firefox-unschizo.exec} + bind = SUPER, Q, killactive + bind = SUPER, F, fullscreen, 0 + bind = SUPER, M, fullscreen, 1 + bind = SUPER, D, exec, ${pkgs.procps}/bin/pkill anyrun || ${anyrun}/bin/anyrun + bind = SUPER, SPACE, togglefloating, + bind = SUPERSHIFT, C, centerwindow + bind = SUPERCONTROL, R, bringactivetotop + binde = SUPER, H, movefocus, l + binde = SUPER, J, movefocus, d + binde = SUPER, K, movefocus, u + binde = SUPER, L, movefocus, r + binde = SUPERCTRL, J, focusmonitor, l + binde = SUPERCTRL, K, focusmonitor, r + bind = SUPER, 1, split-workspace, 1 + bind = SUPER, 2, split-workspace, 2 + bind = SUPER, 3, split-workspace, 3 + bind = SUPER, 4, split-workspace, 4 + bind = SUPER, 5, split-workspace, 5 + bind = SUPER, 6, split-workspace, 6 + bind = SUPER, 7, split-workspace, 7 + bind = SUPER, 8, split-workspace, 8 + bind = SUPER, 9, split-workspace, 9 + bind = SUPER, 0, split-workspace, 10 + bind = SUPERSHIFT, 1, split-movetoworkspacesilent, 1 + bind = SUPERSHIFT, 2, split-movetoworkspacesilent, 2 + bind = SUPERSHIFT, 3, split-movetoworkspacesilent, 3 + bind = SUPERSHIFT, 4, split-movetoworkspacesilent, 4 + bind = SUPERSHIFT, 5, split-movetoworkspacesilent, 5 + bind = SUPERSHIFT, 6, split-movetoworkspacesilent, 6 + bind = SUPERSHIFT, 7, split-movetoworkspacesilent, 7 + bind = SUPERSHIFT, 8, split-movetoworkspacesilent, 8 + bind = SUPERSHIFT, 9, split-movetoworkspacesilent, 9 + bind = SUPERSHIFT, 0, split-movetoworkspacesilent, 10 + bindle = , XF86MonBrightnessUp, exec, ~/Scripts/notif_brightness.sh set +5% + bindle = , XF86MonBrightnessDown, exec, ~/Scripts/notif_brightness.sh set 5%- + bindl = , XF86AudioMedia, exec, ${pkgs.playerctl}/bin/playerctl play-pause + bindl = , XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause + bindl = , XF86AudioStop, exec, ${pkgs.playerctl}/bin/playerctl stop + bindl = , XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous + bindl = , XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next + bindle = , XF86AudioRaiseVolume, exec, ~/Scripts/notif_volume.sh -ui 5 + bindle = , XF86AudioLowerVolume, exec, ~/Scripts/notif_volume.sh -ud 5 + bindl = , XF86AudioMute, exec, ~/Scripts/notif_volume.sh --toggle-mute - exec-once=${pkgs.systemd}/bin/systemctl start --user waybar.service - exec=${pkgs.systemd}/bin/systemctl restart --user waybar.service + bind = SUPER, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken" + bind = SUPERSHIFT, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken (shadower)" + bind = SUPERCONTROL, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken" + bind = SUPERSHIFTCONTROL, S, exec, ${hyprcontrib.grimblast}/bin/grimblast save area - | ${pkgs.swappy}/bin/swappy -f - -o - | ${shadower}/bin/shadower | ${pkgs.coreutils-full}/bin/tee "$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/$(date +'screenshot-%Y%m%d%H%M%S.png')" | ${wl-clipboard}/bin/wl-copy && ${pkgs.libnotify}/bin/notify-send "Screenshot taken (shadower)" - exec=${pkgs.procps}/bin/pkill btop - exec=${pkgs.procps}/bin/pkill amdgpu_top - exec=${pkgs.procps}/bin/pkill helvum + bind = SUPERSHIFT, R, exec, ${hyprland}/bin/hyprctl reload + bind = SUPER, P, pin + bind = , XF86Launch1, togglespecialworkspace, rog + binde = , XF86Launch3, exec, ${pkgs.asusctl}/bin/asusctl led-mode -n + bind = , XF86Launch4, exec, ${pkgs.asusctl}/bin/asusctl profile -n + binde = , XF86KbdBrightnessUp, exec, ${pkgs.asusctl}/bin/asusctl -n + binde = , XF86KbdBrightnessDown, exec, ${pkgs.asusctl}/bin/asusctl -p + bind = , XF86TouchpadToggle, exec, + #bind = SUPER, T, exec, grim -g "$(slurp)" -t ppm - | tesseract -l pol - - | wl-copy && notify-send "Copied text: " "\"$(wl-paste)\"" + bind = SUPER, SEMICOLON, exec, ~/.config/rofi/powermenu/type-2/powermenu.sh + bind = SUPER, G, togglegroup + binde = SUPERSHIFT, G, changegroupactive, f + binde = SUPERCONTROL, G, changegroupactive, b + bind = SUPERCONTROL, X, exec, ${pkgs.systemd}/bin/systemctl --user restart xdg-desktop-portal-hyprland + bind = SUPERSHIFT, X, exec, ${hyprland}/bin/hyprctl kill + bind = SUPER, B, togglespecialworkspace, btop + bind = SUPER, A, togglespecialworkspace, amdgpu_top + bind = SUPER, V, togglespecialworkspace, helvum + bind = SUPER, N, togglespecialworkspace, nixos + bind = SUPER, R, togglespecialworkspace, rog + bind = SUPER, X, togglespecialworkspace, keepassxc + bind = SUPER, C, exec, ${swaylock}/bin/swaylock + bind = SUPERCONTROL, B, exec, ${pkgs.systemd}/bin/systemctl is-active --user waybar && ${pkgs.systemd}/bin/systemctl stop --user waybar || ${pkgs.systemd}/bin/systemctl start --user waybar - exec=[workspace special:btop silent;tile] ${foot}/bin/foot -e ${pkgs.btop}/bin/btop - exec=[workspace special:amdgpu_top silent;tile] ${pkgs.amdgpu_top}/bin/amdgpu_top --gui -i 0 - exec=[workspace special:amdgpu_top silent;tile] ${pkgs.amdgpu_top}/bin/amdgpu_top --gui -i 1 - exec=[workspace special:helvum silent;tile] ${pkgs.helvum}/bin/helvum - exec-once=[workspace special:nixos silent;tile] cd ~/niksos; ${foot}/bin/foot + bindm = SUPER, mouse:272, movewindow + bindm = SUPER, mouse:273, resizewindow - exec-once=${foot}/bin/foot --server - exec-once=${hyprland}/bin/hyprctl setcursor Bibata-Modern-Classic 24 + binds { + pass_mouse_when_bound=0 + } - #exec-once=${wl-clipboard}/bin/wl-paste --watch cliphist store + exec-once=${pkgs.systemd}/bin/systemctl start --user waybar.service + exec=${pkgs.systemd}/bin/systemctl restart --user waybar.service - exec-once=${swww}/bin/swww init - exec=sleep 0.5 && ${swww}/bin/swww img -o eDP-1 ~/catppuccin-wall0.png - exec=sleep 0.5 && ${swww}/bin/swww img -o HDMI-A-1 ~/catppuccin-wall1.png + exec=${pkgs.procps}/bin/pkill btop + exec=${pkgs.procps}/bin/pkill amdgpu_top + exec=${pkgs.procps}/bin/pkill helvum - #exec-once=rog-control-center - exec-once=${wlsunset}/bin/wlsunset -S 06:00 -s 20:00 + exec=[workspace special:btop silent;tile] ${foot}/bin/foot -e ${pkgs.btop}/bin/btop + exec=[workspace special:amdgpu_top silent;tile] ${pkgs.amdgpu_top}/bin/amdgpu_top --gui -i 0 + exec=[workspace special:amdgpu_top silent;tile] ${pkgs.amdgpu_top}/bin/amdgpu_top --gui -i 1 + exec=[workspace special:helvum silent;tile] ${pkgs.helvum}/bin/helvum + exec-once=[workspace special:nixos silent;tile] cd ~/niksos; ${foot}/bin/foot + exec-once=[workspace special:rog silent;tile] ${pkgs.asusctl}/bin/rog-control-center + exec-once=[workspace special:keepassxc silent;tile] ${pkgs.keepassxc}/bin/keepassxc - exec-once=${pkgs.keepassxc}/bin/keepassxc + ${if config.myOptions.programs.foot.server then "exec-once=${pkgs.systemd}/bin/systemctl --user start foot.service" else ""} + exec-once=${hyprland}/bin/hyprctl setcursor Bibata-Modern-Classic 24 - exec-once=${pkgs.networkmanagerapplet}/bin/nm-applet --indicator + #exec-once=${wl-clipboard}/bin/wl-paste --watch cliphist store - exec-once=${pkgs.blueman}/bin/blueman-applet + exec-once=${swww}/bin/swww init + exec=sleep 0.5 && ${swww}/bin/swww img -o eDP-1 ~/catppuccin-wall0.png + exec=sleep 0.5 && ${swww}/bin/swww img -o HDMI-A-1 ~/catppuccin-wall1.png - #exec-once=fcitx5 + exec-once=${wlsunset}/bin/wlsunset -S 06:00 -s 20:00 - exec-once=${pkgs.systemd}/bin/systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP - exec-once=${pkgs.dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP + exec-once=${pkgs.networkmanagerapplet}/bin/nm-applet --indicator - # no black border on grimblast screenshots - layerrule = noanim, ^(selection)$ + exec-once=${pkgs.blueman}/bin/blueman-applet - layerrule = blur, ^(waybar)$ - layerrule = blur, ^(eww)$ + #exec-once=fcitx5 - # temporary fix to swaylock screenshoting rofi before locking - layerrule = noanim, ^(rofi)$ + exec-once=${pkgs.systemd}/bin/systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + exec-once=${pkgs.dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP - layerrule = blur, ^(anyrun)$ + # no black border on grimblast screenshots + layerrule = noanim, ^(selection)$ - general { - col.active_border=0xFFF5C2E7 - col.inactive_border=0xFF45475A - col.group_border_active=0xFFA6E3A1 - col.group_border=0xFF45475A - } + layerrule = blur, ^(waybar)$ + layerrule = blur, ^(eww)$ - decoration { - col.shadow=0xAF1E1E2E - } + # temporary fix to swaylock screenshoting rofi before locking + layerrule = noanim, ^(rofi)$ - plugin { - csgo-vulkan-fix { - res_w = 2560 - res_h = 1440 - } - split-monitor-workspaces { - count = 10 - keep_focused = true - } - } - ''; + layerrule = blur, ^(anyrun)$ + + general { + col.active_border=0xFFF5C2E7 + col.inactive_border=0xFF45475A + col.group_border_active=0xFFA6E3A1 + col.group_border=0xFF45475A + } + + decoration { + col.shadow=0xAF1E1E2E + } + + plugin { + csgo-vulkan-fix { + res_w = 2560 + res_h = 1440 + } + split-monitor-workspaces { + count = 10 + keep_focused = true + } + } + ''; + }; + }; }; } diff --git a/modules/gui/mpv.nix b/modules/gui/mpv.nix index 55804bd7..288ccfe8 100644 --- a/modules/gui/mpv.nix +++ b/modules/gui/mpv.nix @@ -1,24 +1,35 @@ { + config, + config', + lib, pkgs, ... -}: { - programs.mpv = { - enable = true; - config = { - vo = "gpu-next"; - hwdec = "auto"; - gpu-api = "vulkan"; - vulkan-device = "AMD Radeon RX 6800M (RADV NAVI22)"; - volume = 50; - osc = "no"; - osd-bar = "no"; - border = "no"; +}: with lib; let + cfg = config.myOptions.programs.mpv; +in { + options.myOptions.programs.mpv.enable = mkEnableOption "enable mpv"; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.mpv = { + enable = true; + config = { + vo = "gpu-next"; + hwdec = "auto"; + gpu-api = "vulkan"; + vulkan-device = "AMD Radeon RX 6800M (RADV NAVI22)"; + volume = 50; + osc = "no"; + osd-bar = "no"; + border = "no"; + }; + scripts = with pkgs.mpvScripts; [ + mpris + thumbfast + sponsorblock + uosc + ]; + }; }; - scripts = with pkgs.mpvScripts; [ - mpris - thumbfast - sponsorblock - uosc - ]; }; } diff --git a/modules/gui/qt.nix b/modules/gui/qt.nix index cffa6f7e..b6874a71 100644 --- a/modules/gui/qt.nix +++ b/modules/gui/qt.nix @@ -1,53 +1,83 @@ { + config, + config', + lib, pkgs, ... -}: { - # thanks raf :3 https://github.com/NotAShelf/nyx/blob/main/homes/notashelf/themes/qt.nix - qt = { - enable = true; - #platformTheme = "qtct"; - style = { - name = "Catppuccin-Mocha-Dark"; - package = pkgs.catppuccin-kde.override { - flavour = "mocha"; - accents = [ "green" ]; +}: with lib; let + cfg = config.myOptions.themes.qt; +in { + options.myOptions.themes.qt = { + enable = mkEnableOption "enable qt theming"; + name = mkOption { + description = "qt theme name"; + type = types.str; + }; + variant = mkOption { + description = "qt theme variant"; + type = types.str; + }; + accentColour = mkOption { + description = "accent colour for qt theme"; + type = types.str; + }; + package = mkOption { + description = "qt theme package"; + type = types.package; + }; + }; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + # thanks raf :3 https://github.com/NotAShelf/nyx/blob/main/homes/notashelf/themes/qt.nix + qt = { + enable = true; + #platformTheme = "qtct"; + style = { + inherit (cfg) name; + package = cfg.package.override { + flavour = cfg.variant; + accents = [ cfg.accentColour ]; + }; + }; + }; + + home = { + packages = with pkgs; [ + qt5.qttools + qt6Packages.qtstyleplugin-kvantum + libsForQt5.qtstyleplugin-kvantum + libsForQt5.qt5ct + breeze-icons + ]; + + sessionVariables = { + QT_STYLE_OVERRIDE = "kvantum"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + DISABLE_QT_COMPAT = "0"; + }; + }; + + # TODO somehow make this configurable IDK + xdg.configFile = { + "Kvantum/catppuccin/catppuccin.kvconfig".source = builtins.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Green/Catppuccin-Mocha-Green.kvconfig"; + sha256 = "16ry4k09nf5w1gyawwz2ny14zn6infqk40l35lqlg30lhgbdmr5f"; + }; + "Kvantum/catppuccin/catppuccin.svg".source = builtins.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Green/Catppuccin-Mocha-Green.svg"; + sha256 = "1djh625qag34rjsp7y67nzbi9nbmiwgq63ydfizsh65n3fyfakf1"; + }; + "Kvantum/kvantum.kvconfig".text = '' + [General] + theme=catppuccin + + [Applications] + catppuccin=qt5ct, org.qbittorrent.qBittorrent, hyprland-share-picker + ''; }; }; }; - - home = { - packages = with pkgs; [ - qt5.qttools - qt6Packages.qtstyleplugin-kvantum - libsForQt5.qtstyleplugin-kvantum - libsForQt5.qt5ct - breeze-icons - ]; - - sessionVariables = { - QT_STYLE_OVERRIDE = "kvantum"; - QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - QT_QPA_PLATFORM = "wayland;xcb"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - DISABLE_QT_COMPAT = "0"; - }; - }; - - xdg.configFile = { - "Kvantum/catppuccin/catppuccin.kvconfig".source = builtins.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Green/Catppuccin-Mocha-Green.kvconfig"; - sha256 = "16ry4k09nf5w1gyawwz2ny14zn6infqk40l35lqlg30lhgbdmr5f"; - }; - "Kvantum/catppuccin/catppuccin.svg".source = builtins.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Green/Catppuccin-Mocha-Green.svg"; - sha256 = "1djh625qag34rjsp7y67nzbi9nbmiwgq63ydfizsh65n3fyfakf1"; - }; - "Kvantum/kvantum.kvconfig".text = '' - [General] - theme=catppuccin - - [Applications] - catppuccin=qt5ct, org.qbittorrent.qBittorrent, hyprland-share-picker - ''; - }; } diff --git a/modules/gui/swaylock.nix b/modules/gui/swaylock.nix index 158e8371..874c0041 100644 --- a/modules/gui/swaylock.nix +++ b/modules/gui/swaylock.nix @@ -1,55 +1,66 @@ { + config, + config', inputs, + lib, pkgs, ... -}: { - programs.swaylock = { - enable = true; - package = inputs.nixpkgs-wayland.packages.${pkgs.system}.swaylock-effects; - settings = { - daemonize = false; - show-failed-attempts = true; - clock = true; - screenshots = true; - effect-blur = "9x5"; - effect-vignette = "0.5:0.5"; - indicator = true; - indicator-radius = 200; - indicator-thickness = 20; - color = "1e1e2e"; - bs-hl-color = "f5e0dc"; - caps-lock-bs-hl-color = "f5e0dc"; - caps-lock-key-hl-color = "a6e3a1"; - inside-color = "00000000"; - inside-clear-color = "00000000"; - inside-caps-lock-color = "00000000"; - inside-ver-color = "00000000"; - inside-wrong-color = "00000000"; - key-hl-color = "a6e3a1"; - layout-bg-color = "00000000"; - layout-border-color = "00000000"; - layout-text-color = "cdd6f4"; - line-color = "00000000"; - line-clear-color = "00000000"; - line-caps-lock-color = "00000000"; - line-ver-color = "00000000"; - line-wrong-color = "00000000"; - ring-color = "b4befe"; - ring-clear-color = "f5e0dc"; - ring-caps-lock-color = "fab387"; - ring-ver-color = "89b4fa"; - ring-wrong-color = "eba0ac"; - separator-color = "00000000"; - text-color = "cdd6f4"; - text-clear-color = "f5e0dc"; - text-caps-lock-color = "fab387"; - text-ver-color = "89b4fa"; - text-wrong-color = "eba0ac"; - grace = 2; - grace-no-mouse = true; - grace-no-touch = true; - fade-in = 0.2; - ignore-empty-password = true; +}: with lib; let + cfg = config.myOptions.programs.swaylock; +in { + options.myOptions.programs.swaylock.enable = mkEnableOption "enable swaylock"; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.swaylock = { + enable = true; + package = inputs.nixpkgs-wayland.packages.${pkgs.system}.swaylock-effects; + settings = { + daemonize = false; + show-failed-attempts = true; + clock = true; + screenshots = true; + effect-blur = "9x5"; + effect-vignette = "0.5:0.5"; + indicator = true; + indicator-radius = 200; + indicator-thickness = 20; + color = "1e1e2e"; + bs-hl-color = "f5e0dc"; + caps-lock-bs-hl-color = "f5e0dc"; + caps-lock-key-hl-color = "a6e3a1"; + inside-color = "00000000"; + inside-clear-color = "00000000"; + inside-caps-lock-color = "00000000"; + inside-ver-color = "00000000"; + inside-wrong-color = "00000000"; + key-hl-color = "a6e3a1"; + layout-bg-color = "00000000"; + layout-border-color = "00000000"; + layout-text-color = "cdd6f4"; + line-color = "00000000"; + line-clear-color = "00000000"; + line-caps-lock-color = "00000000"; + line-ver-color = "00000000"; + line-wrong-color = "00000000"; + ring-color = "b4befe"; + ring-clear-color = "f5e0dc"; + ring-caps-lock-color = "fab387"; + ring-ver-color = "89b4fa"; + ring-wrong-color = "eba0ac"; + separator-color = "00000000"; + text-color = "cdd6f4"; + text-clear-color = "f5e0dc"; + text-caps-lock-color = "fab387"; + text-ver-color = "89b4fa"; + text-wrong-color = "eba0ac"; + grace = 2; + grace-no-mouse = true; + grace-no-touch = true; + fade-in = 0.2; + ignore-empty-password = true; + }; + }; }; }; } diff --git a/modules/gui/waybar.nix b/modules/gui/waybar.nix index 2dd56bfd..da365cd0 100644 --- a/modules/gui/waybar.nix +++ b/modules/gui/waybar.nix @@ -1,531 +1,542 @@ { + config, + config', inputs, + lib, pkgs, ... -}: { - programs.waybar = { - enable = true; - package = inputs.nixpkgs-wayland.packages.${pkgs.system}.waybar; - systemd.enable = true; - settings.mainBar = { - gtk-layer-shell = true; - layer = "top"; - modules-left = [ "custom/launcher" "custom/xwayland" "tray" "hyprland/workspaces" ]; - modules-center = [ "hyprland/window" ]; - modules-right = [ "custom/dnd" "backlight" /*"cava"*/ "mpd" "pulseaudio" "clock" "battery" "custom/power" ]; +}: with lib; let + cfg = config.myOptions.programs.waybar; +in { + options.myOptions.programs.waybar.enable = mkEnableOption "enable waybar"; - pulseaudio = { - tooltip = false; - scroll-step = "1"; - format = " {icon} {volume}%"; - format-muted = " 󰸈 {volume}%"; - format-icons = { - default = ["󰕿" "󰖀" "󰕾"]; - }; - on-click = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - }; - "hyprland/workspaces" = { - sort-by-name = true; - sort-by-coordinates = false; - on-click = "activate"; - #on-scroll = "~/Scripts/cycle_workspace.sh 1"; - active-only = false; - format = "{icon}"; - format-icons = { - "1" = "1"; - "2" = "2"; - "3" = "3"; - "4" = "4"; - "5" = "5"; - "6" = "6"; - "7" = "7"; - "8" = "8"; - "9" = "9"; - "10" = "10"; - "11" = "1"; - "12" = "2"; - "13" = "3"; - "14" = "4"; - "15" = "5"; - "16" = "6"; - "17" = "7"; - "18" = "8"; - "19" = "9"; - "20" = "10"; - }; - persistent_workspaces = { - "1" = [ "eDP-1" ]; - "2" = [ "eDP-1" ]; - "3" = [ "eDP-1" ]; - "4" = [ "eDP-1" ]; - "5" = [ "eDP-1" ]; - "6" = [ "eDP-1" ]; - "7" = [ "eDP-1" ]; - "8" = [ "eDP-1" ]; - "9" = [ "eDP-1" ]; - "10" = [ "eDP-1" ]; - "11" = [ "HDMI-A-1" ]; - "12" = [ "HDMI-A-1" ]; - "13" = [ "HDMI-A-1" ]; - "14" = [ "HDMI-A-1" ]; - "15" = [ "HDMI-A-1" ]; - "16" = [ "HDMI-A-1" ]; - "17" = [ "HDMI-A-1" ]; - "18" = [ "HDMI-A-1" ]; - "19" = [ "HDMI-A-1" ]; - "20" = [ "HDMI-A-1" ]; - }; - }; - network = { - tooltip = false; - format = "{ipaddr} {icon}"; - format-alt = "{icon}"; - format-icons = { - wifi = [ "󰖩" ]; - ethernet = [ "󰈀" ]; - disconnected = [ "󰖪" ]; - }; - on-click-right = "foot -e nmtui"; - }; - backlight = { - interval = 1; - align = 0; - rotate = 0; - format = "{icon} {percent}%"; - format-icons = [ "󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠" ]; - on-scroll-up = "~/Scripts/bright.sh s +1%"; - on-scroll-down = "~/Scripts/bright.sh s 1%-"; - smooth-scrolling-threshold = 1; - }; - battery = { - interval = 1; - states = { - good = 75; - warning = 30; - critical = 20; - }; - format = "{icon}{capacity}%"; - format-charging = "󰚥{icon}{capacity}% 󱐋{power}"; - format-discharging = "{icon}{capacity}% 󱐋{power}"; - format-icons = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; - format-charging-icons = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"]; - }; - tray = { - icon-size = 18; - spacing = 10; - }; - clock = { - interval = 1; - format = "{:󱑁 %H:%M:%S 󰃰 %d/%m/%Y}"; - format-alt = "{:󱑁 %H:%M:%S}"; - tooltip-format = "{calendar}"; - calendar = { - mode = "year"; - mode-mon-col = 3; - weeks-pos = "right"; - on-scroll = 1; - on-click-right = "mode"; - format = { - months = "{}"; - days = "{}"; - weeks = "T{:%W}"; - weekdays = "{}"; - today = "{}"; + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.waybar = { + enable = true; + package = inputs.nixpkgs-wayland.packages.${pkgs.system}.waybar; + systemd.enable = true; + settings.mainBar = { + gtk-layer-shell = true; + layer = "top"; + modules-left = [ "custom/launcher" "custom/xwayland" "tray" "hyprland/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ "custom/dnd" "backlight" /*"cava"*/ "mpd" "pulseaudio" "clock" "battery" "custom/power" ]; + + pulseaudio = { + tooltip = false; + scroll-step = "1"; + format = " {icon} {volume}%"; + format-muted = " 󰸈 {volume}%"; + format-icons = { + default = ["󰕿" "󰖀" "󰕾"]; + }; + on-click = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }; - actions = { - on-click-right = "mode"; - on-click-forward = "tz_up"; - on-click-backward = "tz_down"; - on-scroll-up = "shift_up"; - on-scroll-down = "shift_down"; + "hyprland/workspaces" = { + sort-by-name = true; + sort-by-coordinates = false; + on-click = "activate"; + #on-scroll = "~/Scripts/cycle_workspace.sh 1"; + active-only = false; + format = "{icon}"; + format-icons = { + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + "10" = "10"; + "11" = "1"; + "12" = "2"; + "13" = "3"; + "14" = "4"; + "15" = "5"; + "16" = "6"; + "17" = "7"; + "18" = "8"; + "19" = "9"; + "20" = "10"; + }; + persistent_workspaces = { + "1" = [ "eDP-1" ]; + "2" = [ "eDP-1" ]; + "3" = [ "eDP-1" ]; + "4" = [ "eDP-1" ]; + "5" = [ "eDP-1" ]; + "6" = [ "eDP-1" ]; + "7" = [ "eDP-1" ]; + "8" = [ "eDP-1" ]; + "9" = [ "eDP-1" ]; + "10" = [ "eDP-1" ]; + "11" = [ "HDMI-A-1" ]; + "12" = [ "HDMI-A-1" ]; + "13" = [ "HDMI-A-1" ]; + "14" = [ "HDMI-A-1" ]; + "15" = [ "HDMI-A-1" ]; + "16" = [ "HDMI-A-1" ]; + "17" = [ "HDMI-A-1" ]; + "18" = [ "HDMI-A-1" ]; + "19" = [ "HDMI-A-1" ]; + "20" = [ "HDMI-A-1" ]; + }; + }; + network = { + tooltip = false; + format = "{ipaddr} {icon}"; + format-alt = "{icon}"; + format-icons = { + wifi = [ "󰖩" ]; + ethernet = [ "󰈀" ]; + disconnected = [ "󰖪" ]; + }; + on-click-right = "foot -e nmtui"; + }; + backlight = { + interval = 1; + align = 0; + rotate = 0; + format = "{icon} {percent}%"; + format-icons = [ "󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠" ]; + on-scroll-up = "~/Scripts/bright.sh s +1%"; + on-scroll-down = "~/Scripts/bright.sh s 1%-"; + smooth-scrolling-threshold = 1; + }; + battery = { + interval = 1; + states = { + good = 75; + warning = 30; + critical = 20; + }; + format = "{icon}{capacity}%"; + format-charging = "󰚥{icon}{capacity}% 󱐋{power}"; + format-discharging = "{icon}{capacity}% 󱐋{power}"; + format-icons = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; + format-charging-icons = ["󰢟" "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅"]; + }; + tray = { + icon-size = 18; + spacing = 10; + }; + clock = { + interval = 1; + format = "{:󱑁 %H:%M:%S 󰃰 %d/%m/%Y}"; + format-alt = "{:󱑁 %H:%M:%S}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + months = "{}"; + days = "{}"; + weeks = "T{:%W}"; + weekdays = "{}"; + today = "{}"; + }; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + }; + }; + cpu = { + interval = 1; + format = "󰻠 {}%"; + max-length = 10; + }; + memory = { + interval = 1; + format = "󰍛 {}%"; + max-length = 10; + }; + "custom/launcher" = { + format = "󰣇 "; + on-click = "~/.config/rofi/launchers/type-2/launcher.sh"; + on-click-right = "pkill rofi"; + }; + "custom/power" = { + format = "󰐥"; + on-click = "~/.config/rofi/powermenu/type-2/powermenu.sh"; + }; + "hyprland/window" = { + format = "{}"; + separate-outputs = true; + }; + gamemode = { + format = "{glyph}"; + format-alt = "{glyph} {count}"; + glyph = "󰊴"; + hide-not-running = true; + use-icon = true; + icon-name = "input-gaming-symbolic"; + icon-spacing = 4; + icon-size = 20; + tooltip = true; + tooltip-format = "Games running: {count}"; + }; + "custom/dnd" = { + exec = "~/Scripts/waybar-dunst.sh"; + on-click = "~/Scripts/dnd.sh"; + restart-interval = 1; + tooltip = false; + }; + cava = { + framerate = 165; + autosens = 1; + sensitivity = 100; + bars = 14; + lower_cutoff_freq = 50; + higher_cutoff_freq = 10000; + method = "pipewire"; + source = "auto"; + stereo = true; + reverse = false; + bar_delimiter = 0; + monstercat = false; + waves = false; + noise_reduction = 0.77; + input_delay = 2; + format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; + actions = { + on-click-right = "mode"; + }; + }; + "custom/power_profile" = { + exec = "asusctl profile -p | sed s:'Active profile is'::"; + interval = 30; + format = "󰈐{}"; + format-alt-click = "click-right"; + format-alt = "󰈐"; + on-click = "asusctl profile -n; pkill -SIGRTMIN+8 waybar"; + signal = 8; + }; + "custom/xwayland" = { + exec = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl clients | ${pkgs.ripgrep}/bin/rg -e 'xwayland: [1]' | ${pkgs.coreutils-full}/bin/wc -l"; + interval = 1; + format = "X {}"; + }; + mpd = { + format = "{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 󰝚"; + format-disconnected = "Disconnected 󰝚"; + format-stopped = "Stopped 󰝚"; + interval = 1; + tooltip-format = "MPD (connected)"; + tooltip-format-disconnected = "MPD (disconnected)"; + on-click = "mpc toggle"; }; }; - }; - cpu = { - interval = 1; - format = "󰻠 {}%"; - max-length = 10; - }; - memory = { - interval = 1; - format = "󰍛 {}%"; - max-length = 10; - }; - "custom/launcher" = { - format = "󰣇 "; - on-click = "~/.config/rofi/launchers/type-2/launcher.sh"; - on-click-right = "pkill rofi"; - }; - "custom/power" = { - format = "󰐥"; - on-click = "~/.config/rofi/powermenu/type-2/powermenu.sh"; - }; - "hyprland/window" = { - format = "{}"; - separate-outputs = true; - }; - gamemode = { - format = "{glyph}"; - format-alt = "{glyph} {count}"; - glyph = "󰊴"; - hide-not-running = true; - use-icon = true; - icon-name = "input-gaming-symbolic"; - icon-spacing = 4; - icon-size = 20; - tooltip = true; - tooltip-format = "Games running: {count}"; - }; - "custom/dnd" = { - exec = "~/Scripts/waybar-dunst.sh"; - on-click = "~/Scripts/dnd.sh"; - restart-interval = 1; - tooltip = false; - }; - cava = { - framerate = 165; - autosens = 1; - sensitivity = 100; - bars = 14; - lower_cutoff_freq = 50; - higher_cutoff_freq = 10000; - method = "pipewire"; - source = "auto"; - stereo = true; - reverse = false; - bar_delimiter = 0; - monstercat = false; - waves = false; - noise_reduction = 0.77; - input_delay = 2; - format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; - actions = { - on-click-right = "mode"; - }; - }; - "custom/power_profile" = { - exec = "asusctl profile -p | sed s:'Active profile is'::"; - interval = 30; - format = "󰈐{}"; - format-alt-click = "click-right"; - format-alt = "󰈐"; - on-click = "asusctl profile -n; pkill -SIGRTMIN+8 waybar"; - signal = 8; - }; - "custom/xwayland" = { - exec = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl clients | ${pkgs.ripgrep}/bin/rg -e 'xwayland: [1]' | ${pkgs.coreutils-full}/bin/wc -l"; - interval = 1; - format = "X {}"; - }; - mpd = { - format = "{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 󰝚"; - format-disconnected = "Disconnected 󰝚"; - format-stopped = "Stopped 󰝚"; - interval = 1; - tooltip-format = "MPD (connected)"; - tooltip-format-disconnected = "MPD (disconnected)"; - on-click = "mpc toggle"; + style = '' + @define-color base #1e1e2e; + @define-color mantle #181825; + @define-color crust #11111b; + + @define-color text #cdd6f4; + @define-color subtext0 #a6adc8; + @define-color subtext1 #bac2de; + + @define-color surface0 #313244; + @define-color surface1 #45475a; + @define-color surface2 #585b70; + + @define-color overlay0 #6c7086; + @define-color overlay1 #7f849c; + @define-color overlay2 #9399b2; + + @define-color blue #89b4fa; + @define-color lavender #b4befe; + @define-color sapphire #74c7ec; + @define-color sky #89dceb; + @define-color teal #94e2d5; + @define-color green #a6e3a1; + @define-color yellow #f9e2af; + @define-color peach #fab387; + @define-color maroon #eba0ac; + @define-color red #f38ba8; + @define-color mauve #cba6f7; + @define-color pink #f5c2e7; + @define-color flamingo #f2cdcd; + @define-color rosewater #f5e0dc; + + * { + border-radius: 10px; + font-family: Material Design Icons; + font-size: 16px; + color: @text; + } + + window#waybar { + background-color: alpha(@base, 0.5); + border-radius: 0px; + } + + window#waybar.hidden { + opacity: 0.2; + } + + #window { + margin-top: 4px; + margin-bottom: 4px; + padding-left: 5px; + padding-right: 5px; + background: @mantle; + color: @teal; + font-family: JetBrains Mono; + } + + #workspaces { + padding-left: 5px; + } + + #workspaces button { + border-radius: 15px; + padding-top: 0px; + padding-right: 0px; + padding-bottom: 0px; + padding-left: 0px; + margin-top: 6px; + margin-right: 3px; + margin-bottom: 6px; + margin-left: 3px; + background-color: @mantle; + min-width: 24px; + } + + #workspaces button.active { + padding-top: 0px; + padding-bottom: 0px; + padding-right: 0px; + padding-left: 0px; + margin-top: 6px; + margin-right: 3px; + margin-bottom: 6px; + margin-left: 3px; + background-color: @blue; + min-width: 24px; + } + + #workspaces button:hover { + background: alpha(@mantle, 0.7); + transition-property: background, min-width; + transition-duration: 0.5s; + transition-timing-function: ease; + } + + #workspaces button.focused { + background-color: @yellow; + } + + #workspaces button.urgent { + background-color: @red; + } + + .modules-left > widget:first-child > #workspaces { + margin-left: 0; + } + + .modules-right > widget:first-child > #workspaces { + margin-right: 0; + } + + #pulseaudio { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 0px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @peach; + /*border-top-left-radius: 0; + border-bottom-left-radius: 0;*/ + } + + #cava { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + margin-right: 0px; + padding-left: 10px; + padding-right: 0px; + transition: none; + background: @mantle; + color: @peach; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + + #battery { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @teal; + } + + @keyframes blink { + to { + background-color: @red; + } + } + + #battery.charging, #battery.plugged { + background-color: @mantle; + } + + #battery.critical:not(.charging) { + background-color: @mantle; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + #backlight { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @yellow; + } + #clock { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition-property: min-width; + transition-duration: 0.5s; + background: @mantle; + color: @pink; + } + + #custom-power_profile { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @rosewater; + } + + #tray { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + } + + #custom-launcher { + font-size: 16px; + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 5px; + transition: none; + background: @mantle; + color: @blue; + } + + #custom-power { + font-size: 20px; + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + margin-right: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @red; + } + + #custom-wallpaper { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + } + + #custom-updates { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + } + + #custom-media { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + } + + #custom-dnd { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @flamingo; + } + + #custom-xwayland { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @green; + } + + #mpd { + margin-top: 3px; + margin-bottom: 3px; + margin-left: 8px; + padding-left: 10px; + padding-right: 10px; + transition: none; + background: @mantle; + color: @green; + } + ''; }; }; - style = '' - @define-color base #1e1e2e; - @define-color mantle #181825; - @define-color crust #11111b; - - @define-color text #cdd6f4; - @define-color subtext0 #a6adc8; - @define-color subtext1 #bac2de; - - @define-color surface0 #313244; - @define-color surface1 #45475a; - @define-color surface2 #585b70; - - @define-color overlay0 #6c7086; - @define-color overlay1 #7f849c; - @define-color overlay2 #9399b2; - - @define-color blue #89b4fa; - @define-color lavender #b4befe; - @define-color sapphire #74c7ec; - @define-color sky #89dceb; - @define-color teal #94e2d5; - @define-color green #a6e3a1; - @define-color yellow #f9e2af; - @define-color peach #fab387; - @define-color maroon #eba0ac; - @define-color red #f38ba8; - @define-color mauve #cba6f7; - @define-color pink #f5c2e7; - @define-color flamingo #f2cdcd; - @define-color rosewater #f5e0dc; - - * { - border-radius: 10px; - font-family: Material Design Icons; - font-size: 16px; - color: @text; - } - - window#waybar { - background-color: alpha(@base, 0.5); - border-radius: 0px; - } - - window#waybar.hidden { - opacity: 0.2; - } - - #window { - margin-top: 4px; - margin-bottom: 4px; - padding-left: 5px; - padding-right: 5px; - background: @mantle; - color: @teal; - font-family: JetBrains Mono; - } - - #workspaces { - padding-left: 5px; - } - - #workspaces button { - border-radius: 15px; - padding-top: 0px; - padding-right: 0px; - padding-bottom: 0px; - padding-left: 0px; - margin-top: 6px; - margin-right: 3px; - margin-bottom: 6px; - margin-left: 3px; - background-color: @mantle; - min-width: 24px; - } - - #workspaces button.active { - padding-top: 0px; - padding-bottom: 0px; - padding-right: 0px; - padding-left: 0px; - margin-top: 6px; - margin-right: 3px; - margin-bottom: 6px; - margin-left: 3px; - background-color: @blue; - min-width: 24px; - } - - #workspaces button:hover { - background: alpha(@mantle, 0.7); - transition-property: background, min-width; - transition-duration: 0.5s; - transition-timing-function: ease; - } - - #workspaces button.focused { - background-color: @yellow; - } - - #workspaces button.urgent { - background-color: @red; - } - - .modules-left > widget:first-child > #workspaces { - margin-left: 0; - } - - .modules-right > widget:first-child > #workspaces { - margin-right: 0; - } - - #pulseaudio { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 0px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @peach; - /*border-top-left-radius: 0; - border-bottom-left-radius: 0;*/ - } - - #cava { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - margin-right: 0px; - padding-left: 10px; - padding-right: 0px; - transition: none; - background: @mantle; - color: @peach; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - - #battery { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @teal; - } - - @keyframes blink { - to { - background-color: @red; - } - } - - #battery.charging, #battery.plugged { - background-color: @mantle; - } - - #battery.critical:not(.charging) { - background-color: @mantle; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } - - #backlight { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @yellow; - } - #clock { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition-property: min-width; - transition-duration: 0.5s; - background: @mantle; - color: @pink; - } - - #custom-power_profile { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @rosewater; - } - - #tray { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - } - - #custom-launcher { - font-size: 16px; - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 5px; - transition: none; - background: @mantle; - color: @blue; - } - - #custom-power { - font-size: 20px; - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - margin-right: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @red; - } - - #custom-wallpaper { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - } - - #custom-updates { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - } - - #custom-media { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - } - - #custom-dnd { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @flamingo; - } - - #custom-xwayland { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @green; - } - - #mpd { - margin-top: 3px; - margin-bottom: 3px; - margin-left: 8px; - padding-left: 10px; - padding-right: 10px; - transition: none; - background: @mantle; - color: @green; - } - ''; }; } diff --git a/modules/gui/zathura.nix b/modules/gui/zathura.nix index b5ec9251..a652867b 100644 --- a/modules/gui/zathura.nix +++ b/modules/gui/zathura.nix @@ -1,19 +1,30 @@ { + config, + config', + lib, pkgs, ... -}: { - xdg.configFile."zathura/catppuccin-mocha".source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-mocha"; - hash = "sha256-/HXecio3My2eXTpY7JoYiN9mnXsps4PAThDPs4OCsAk="; - }; +}: with lib; let + cfg = config.myOptions.programs.zathura; +in { + options.myOptions.programs.zathura.enable = mkEnableOption "enable zathura"; - programs.zathura = { - enable = true; - extraConfig = '' - include catppuccin-mocha - ''; - options = { - selection-clipboard = "clipboard"; + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + xdg.configFile."zathura/catppuccin-mocha".source = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-mocha"; + hash = "sha256-/HXecio3My2eXTpY7JoYiN9mnXsps4PAThDPs4OCsAk="; + }; + + programs.zathura = { + enable = true; + extraConfig = '' + include catppuccin-mocha + ''; + options = { + selection-clipboard = "clipboard"; + }; + }; }; }; } diff --git a/modules/other/xdg.nix b/modules/other/xdg.nix index 86a69143..a986d513 100644 --- a/modules/other/xdg.nix +++ b/modules/other/xdg.nix @@ -1,4 +1,7 @@ -_: let +{ + config', + ... +}: let primary_browser = "firefox-schizo.desktop"; secondary_browser = "firefox-unschizo.desktop"; mail_client = "thunderbird.desktop"; @@ -7,46 +10,48 @@ _: let image_viewer = "imv.desktop"; text_editor = "nvim.desktop"; in { - xdg.mimeApps = { - enable = true; - defaultApplications = { - "text/html" = [ primary_browser secondary_browser ]; - "x-scheme-handler/http" = [ primary_browser secondary_browser ]; - "x-scheme-handler/https" = [ primary_browser secondary_browser ]; - "x-scheme-handler/about" = [ primary_browser secondary_browser ]; - "x-scheme-handler/unknown" = [ primary_browser secondary_browser ]; - "x-scheme-handler/mailto" = [ mail_client ]; - "message/rfc822" = [ mail_client ]; - "x-scheme-handler/mid" = [ mail_client ]; - "inode/directory" = [ file_manager ]; - "x-scheme-handler/heroic" = [ "heroic.desktop" ]; - "audio/mp3" = [ media_player ]; - "audio/ogg" = [ media_player ]; - "audio/mpeg" = [ media_player ]; - "audio/aac" = [ media_player ]; - "audio/opus" = [ media_player ]; - "audio/wav" = [ media_player ]; - "audio/webm" = [ media_player ]; - "audio/3gpp" = [ media_player ]; - "audio/3gpp2" = [ media_player ]; - "video/mp4" = [ media_player ]; - "video/x-msvideo" = [ media_player ]; - "video/mpeg" = [ media_player ]; - "video/ogg" = [ media_player ]; - "video/mp2t" = [ media_player ]; - "video/webm" = [ media_player ]; - "video/3gpp" = [ media_player ]; - "video/3gpp2" = [ media_player ]; - "image/png" = [ image_viewer ]; - "image/jpeg" = [ image_viewer ]; - "image/gif" = [ image_viewer ]; - "image/avif" = [ image_viewer ]; - "image/bmp" = [ image_viewer ]; - "image/vnd.microsoft.icon" = [ image_viewer ]; - "image/svg+xml" = [ image_viewer ]; - "image/tiff" = [ image_viewer ]; - "image/webp" = [ image_viewer ]; - "text/plain" = [ text_editor ]; + home-manager.users.${config'.username} = { + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = [ primary_browser secondary_browser ]; + "x-scheme-handler/http" = [ primary_browser secondary_browser ]; + "x-scheme-handler/https" = [ primary_browser secondary_browser ]; + "x-scheme-handler/about" = [ primary_browser secondary_browser ]; + "x-scheme-handler/unknown" = [ primary_browser secondary_browser ]; + "x-scheme-handler/mailto" = [ mail_client ]; + "message/rfc822" = [ mail_client ]; + "x-scheme-handler/mid" = [ mail_client ]; + "inode/directory" = [ file_manager ]; + "x-scheme-handler/heroic" = [ "heroic.desktop" ]; + "audio/mp3" = [ media_player ]; + "audio/ogg" = [ media_player ]; + "audio/mpeg" = [ media_player ]; + "audio/aac" = [ media_player ]; + "audio/opus" = [ media_player ]; + "audio/wav" = [ media_player ]; + "audio/webm" = [ media_player ]; + "audio/3gpp" = [ media_player ]; + "audio/3gpp2" = [ media_player ]; + "video/mp4" = [ media_player ]; + "video/x-msvideo" = [ media_player ]; + "video/mpeg" = [ media_player ]; + "video/ogg" = [ media_player ]; + "video/mp2t" = [ media_player ]; + "video/webm" = [ media_player ]; + "video/3gpp" = [ media_player ]; + "video/3gpp2" = [ media_player ]; + "image/png" = [ image_viewer ]; + "image/jpeg" = [ image_viewer ]; + "image/gif" = [ image_viewer ]; + "image/avif" = [ image_viewer ]; + "image/bmp" = [ image_viewer ]; + "image/vnd.microsoft.icon" = [ image_viewer ]; + "image/svg+xml" = [ image_viewer ]; + "image/tiff" = [ image_viewer ]; + "image/webp" = [ image_viewer ]; + "text/plain" = [ text_editor ]; + }; }; }; } diff --git a/modules/services/asusd.nix b/modules/services/asusd.nix new file mode 100644 index 00000000..fe914473 --- /dev/null +++ b/modules/services/asusd.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + ... +}: with lib; let + cfg = config.myOptions.services.asusd; +in { + options.myOptions.services.asusd.enable = mkEnableOption "enable asusd"; + + config = mkIf cfg.enable { + services.asusd = { + enable = true; + enableUserService = true; + }; + }; +} diff --git a/modules/services/default.nix b/modules/services/default.nix index ec4990ce..f42c4be7 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1,6 +1,9 @@ _: { imports = [ + ./asusd.nix ./dunst.nix + ./greetd.nix ./mpd.nix + ./ssh.nix ]; } diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index dd7415bc..40a6b671 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -1,84 +1,95 @@ { + config, + config', inputs, + lib, pkgs, ... -}: { - services.dunst = { - enable = true; - package = inputs.nixpkgs-wayland.packages.${pkgs.system}.dunst; - settings = { - global = { - monitor = 1; - follow = "none"; - width = 300; - height = 300; - origin = "top-center"; - offset = "0x15"; - scale = 0; - notification_limit = 3; - idle_threshold = 120; - progress_bar = true; - progress_bar_height = 10; - progress_bar_frame_width = 0; - progress_bar_min_width = 150; - progress_bar_max_width = 300; - indicate_hidden = "yes"; - transparency = 10; - separator_height = 2; - padding = 10; - frame_width = 3; - frame_color = "#89B4FA"; - separator_color = "frame"; - highlight = "#89DCEB"; - sort = "yes"; - font = "JetBrains Mono 12"; - line_height = 0; - markup = "full"; - format = "%s\n%b"; - alignment = "right"; - vertical_alignment = "center"; - show_age_threshold = 60; - ellipsize = "middle"; - ignore_newline = "no"; - stack_duplicates = true; - hide_duplicate_count = false; - show_indicators = "yes"; - icon_position = "left"; - min_icon_size = 0; - max_icon_size = 32; - sticky_history = "yes"; - history_length = 20; - dmenu = "${pkgs.rofi-wayland}/bin/rofi"; - browser = "${pkgs.xdg-utils}/bin/xdg-open"; - always_run_script = true; - title = "Dunst"; - class = "dunst"; - corner_radius = 10; - ignore_dbusclose = false; - force_xwayland = false; - force_xinerama = false; - mouse_left_click = "do_action, close_current"; - mouse_middle_click = "context"; - mouse_right_click = "close_all"; - }; - experimental = { - per_monitor_dpi = false; - }; - urgency_low = { - background = "#1E1E2E"; - foreground = "#CDD6F4"; - timeout = 5; - }; - urgency_normal = { - background = "#1E1E2E"; - foreground = "#CDD6F4"; - timeout = 6; - }; - urgency_critical = { - background = "#1E1E2E"; - foreground = "#CDD6F4"; - frame_color = "#FAB387"; - timeout = 0; +}: with lib; let + cfg = config.myOptions.services.dunst; +in { + options.myOptions.services.dunst.enable = mkEnableOption "enable dunst"; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + services.dunst = { + enable = true; + package = inputs.nixpkgs-wayland.packages.${pkgs.system}.dunst; + settings = { + global = { + monitor = 1; + follow = "none"; + width = 300; + height = 300; + origin = "top-center"; + offset = "0x15"; + scale = 0; + notification_limit = 3; + idle_threshold = 120; + progress_bar = true; + progress_bar_height = 10; + progress_bar_frame_width = 0; + progress_bar_min_width = 150; + progress_bar_max_width = 300; + indicate_hidden = "yes"; + transparency = 10; + separator_height = 2; + padding = 10; + frame_width = 3; + frame_color = "#89B4FA"; + separator_color = "frame"; + highlight = "#89DCEB"; + sort = "yes"; + font = "JetBrains Mono 12"; + line_height = 0; + markup = "full"; + format = "%s\n%b"; + alignment = "right"; + vertical_alignment = "center"; + show_age_threshold = 60; + ellipsize = "middle"; + ignore_newline = "no"; + stack_duplicates = true; + hide_duplicate_count = false; + show_indicators = "yes"; + icon_position = "left"; + min_icon_size = 0; + max_icon_size = 32; + sticky_history = "yes"; + history_length = 20; + dmenu = "${pkgs.rofi-wayland}/bin/rofi"; + browser = "${pkgs.xdg-utils}/bin/xdg-open"; + always_run_script = true; + title = "Dunst"; + class = "dunst"; + corner_radius = 10; + ignore_dbusclose = false; + force_xwayland = false; + force_xinerama = false; + mouse_left_click = "do_action, close_current"; + mouse_middle_click = "context"; + mouse_right_click = "close_all"; + }; + experimental = { + per_monitor_dpi = false; + }; + urgency_low = { + background = "#1E1E2E"; + foreground = "#CDD6F4"; + timeout = 5; + }; + urgency_normal = { + background = "#1E1E2E"; + foreground = "#CDD6F4"; + timeout = 6; + }; + urgency_critical = { + background = "#1E1E2E"; + foreground = "#CDD6F4"; + frame_color = "#FAB387"; + timeout = 0; + }; + }; }; }; }; diff --git a/modules/services/greetd.nix b/modules/services/greetd.nix new file mode 100644 index 00000000..5e41fb81 --- /dev/null +++ b/modules/services/greetd.nix @@ -0,0 +1,46 @@ +{ + config, + config', + inputs, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.services.greetd; + + hyprlandConfig = pkgs.writeText "greetd-hyprland-config" '' + misc { + force_default_wallpaper=0 + } + + workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false + + ${if config.myOptions.programs.waybar.enable then "exec-once=systemctl --user stop waybar.service" else ""} + exec-once=[workspace 1;fullscreen;noanim] ${pkgs.greetd.${cfg.greeter}}/bin/${cfg.greeter} -l; ${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch exit + exec-once=${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch focuswindow ${cfg.greeter} + ''; +in { + options.myOptions.services.greetd = { + enable = mkEnableOption "enable greetd"; + greeter = mkOption { + description = "greetd frontend to use"; + type = types.str; + }; + launchOptions = mkOption { + description = "/etc/greetd/environments as list of strings"; + type = with types; listOf str; + }; + }; + + config = mkIf cfg.enable { + services.greetd = { + enable = true; + settings.default_session = { + command = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/Hyprland --config ${hyprlandConfig}"; + user = config'.username; + }; + }; + + environment.etc."greetd/environments".text = concatStringsSep "\n" cfg.launchOptions; + }; +} diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index f1fe546e..876ee984 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -1,31 +1,44 @@ -_: { - services = { - mpd = { - enable = true; - musicDirectory = "~/Music"; - extraConfig = '' - audio_output { - type "pipewire" - name "PipeWire Sound Server" - } +{ + config, + config', + lib, + ... +}: with lib; let + cfg = config.myOptions.services.mpd; +in { + options.myOptions.services.mpd.enable = mkEnableOption "enable mpd"; - follow_outside_symlinks "yes" - follow_inside_symlinks "yes" - ''; - }; + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + services = { + mpd = { + enable = true; + musicDirectory = "~/Music"; + extraConfig = '' + audio_output { + type "pipewire" + name "PipeWire Sound Server" + } - mpd-mpris = { - enable = true; - mpd = { - host = "127.0.0.1"; - network = "unix"; - port = 6600; - useLocal = true; + follow_outside_symlinks "yes" + follow_inside_symlinks "yes" + ''; + }; + + mpd-mpris = { + enable = true; + mpd = { + host = "127.0.0.1"; + network = "unix"; + port = 6600; + useLocal = true; + }; + }; + + playerctld = { + enable = true; + }; }; }; - - playerctld = { - enable = true; - }; }; } diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix new file mode 100644 index 00000000..4b3e46a5 --- /dev/null +++ b/modules/services/ssh.nix @@ -0,0 +1,105 @@ +{ + config, + lib, + pkgs, + ... +}: with lib; let + cfg = config.myOptions.services.ssh; +in { + options.myOptions.services.ssh = { + daemon = mkOption { + description = "sshd options"; + type = with types; submodule { + options = { + enable = mkEnableOption "enable sshd"; + passwordAuth = mkOption { + description = "allow password auth"; + default = false; + type = bool; + }; + allowRoot = mkOption { + description = "allow root login"; + default = false; + type = bool; + }; + }; + }; + }; + agent = mkOption { + description = "ssh agent options"; + type = with types; submodule { + options = { + enable = mkEnableOption "enable ssh-agent"; + hostAliases = mkOption { + description = "host aliases"; + type = with types; attrsOf (submodule { + options = { + hostName = mkOption { + description = "hostname to ssh into"; + type = types.str; + }; + user = mkOption { + description = "ssh user"; + type = types.str; + default = "git"; + }; + identityFile = mkOption { + description = "path to the private key"; + type = types.path; + }; + identitiesOnly = mkOption { + description = "whether ssh should not use additional identities offered by ssh-agent"; + type = types.bool; + default = true; + }; + }; + }); + }; + }; + }; + }; + }; + + config = mkMerge [ + (mkIf cfg.daemon.enable { + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + PermitRootLogin = "no"; + }; + }; + }) + (mkIf cfg.agent.enable { + programs.ssh.extraConfig = '' + AddKeysToAgent yes + + ${concatStrings (mapAttrsToList (name: value: '' + Host ${name} + HostName ${value.hostName} + User ${value.user} + IdentityFile ${value.identityFile} + IdentitiesOnly ${if value.identitiesOnly then "yes" else "no"} + '') cfg.agent.hostAliases)} + ''; + + systemd.user.services.ssh-agent = { + enable = true; + description = "SSH key agent"; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.openssh}/bin/ssh-agent -D -a $SSH_AUTH_SOCK"; + }; + environment = { + SSH_AUTH_SOCK = "%t/ssh-agent.socket"; + DISPLAY = ":0"; + }; + wantedBy = [ "default.target" ]; + }; + + #environment.sessionVariables = { + # SSH_AUTH_SOCK = "\$XDG_RUNTIME_DIR/ssh-agent.socket"; + #}; + }) + ]; +} diff --git a/modules/tui/btop.nix b/modules/tui/btop.nix index 09a1bc87..4dbcb231 100644 --- a/modules/tui/btop.nix +++ b/modules/tui/btop.nix @@ -1,17 +1,30 @@ -_: { - programs.btop = { - enable = true; - settings = { - theme_background = false; - vim_keys = true; - update_ms = 100; - cpu_single_graph = true; - clock_format = "%X"; - use_fstab = true; - io_mode = true; - net_sync = true; - net_iface = "enp4s0"; - log_level = "WARNING"; +{ + config, + config', + lib, + ... +}: with lib; let + cfg = config.myOptions.programs.btop; +in { + options.myOptions.programs.btop.enable = mkEnableOption "enable btop"; + + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + programs.btop = { + enable = true; + settings = { + theme_background = false; + vim_keys = true; + update_ms = 100; + cpu_single_graph = true; + clock_format = "%X"; + use_fstab = true; + io_mode = true; + net_sync = true; + net_iface = "enp4s0"; + log_level = "WARNING"; + }; + }; }; }; } diff --git a/modules/tui/default.nix b/modules/tui/default.nix index 217bc613..57f9a48b 100644 --- a/modules/tui/default.nix +++ b/modules/tui/default.nix @@ -2,6 +2,6 @@ _: { imports = [ ./neovim ./btop.nix - ./helix.nix + #./helix.nix ]; } diff --git a/modules/tui/helix.nix b/modules/tui/helix.nix index 23407c85..3f071c7b 100644 --- a/modules/tui/helix.nix +++ b/modules/tui/helix.nix @@ -1,87 +1,99 @@ { + config, + config', lib, inputs, pkgs, ... -}: { - programs.helix = { - enable = true; - package = inputs.helix.packages.${pkgs.system}.default.overrideAttrs (self: { - makeWrapperArgs = with pkgs; - self.makeWrapperArgs - or [] - ++ [ - "--suffix" - "PATH" - ":" - (lib.makeBinPath [ - rustfmt - rust-analyzer - nil - clang-tools - nodePackages.bash-language-server - nodePackages.vscode-css-languageserver-bin - nodePackages.vscode-langservers-extracted - ]) - ]; - }); - settings = { - theme = "catppuccin_mocha"; - editor = { - scrolloff = 7; - mouse = false; - middle-click-paste = false; - line-number = "relative"; - auto-completion = false; - auto-format = false; - completion-replace = true; - true-color = true; - undercurl = true; - rulers = [ 80 ]; - bufferline = "multiple"; - color-modes = true; - lsp = { - display-messages = true; - display-inlay-hints = true; - }; - cursor-shape = { - normal = "block"; - insert = "bar"; - select = "underline"; - }; - auto-pairs = false; - whitespace.render.newline = "all"; - indent-guides.render = true; - }; +}: with lib; let + cfg = config.myOptions.programs.helix; +in { + options.myOptions.programs.helix.enable = mkEnableOption "enable helix"; + + config = mkIf cfg.enable { + nix.settings = { + substituters = [ "https://helix.cachix.org" ]; + trusted-public-keys = [ "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" ]; }; - languages = { - language-server = { - nil = { - command = lib.getExe pkgs.nil; - config.nil.formatting.command = [ "${lib.getExe pkgs.alejandra}" "-q" ]; - }; - clangd = { - command = "${pkgs.clang-tools}/bin/clangd"; - clangd.fallbackFlags = [ "-std=c++2b" ]; - }; - vscode-css-language-server = { - command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver"; - args = [ "--stdio" ]; + programs.helix = { + enable = true; + package = inputs.helix.packages.${pkgs.system}.default.overrideAttrs (self: { + makeWrapperArgs = with pkgs; + self.makeWrapperArgs + or [] + ++ [ + "--suffix" + "PATH" + ":" + (lib.makeBinPath [ + rustfmt + rust-analyzer + nil + clang-tools + nodePackages.bash-language-server + nodePackages.vscode-css-languageserver-bin + nodePackages.vscode-langservers-extracted + ]) + ]; + }); + settings = { + theme = "catppuccin_mocha"; + editor = { + scrolloff = 7; + mouse = false; + middle-click-paste = false; + line-number = "relative"; + auto-completion = false; + auto-format = false; + completion-replace = true; + true-color = true; + undercurl = true; + rulers = [ 80 ]; + bufferline = "multiple"; + color-modes = true; + lsp = { + display-messages = true; + display-inlay-hints = true; + }; + cursor-shape = { + normal = "block"; + insert = "bar"; + select = "underline"; + }; + auto-pairs = false; + whitespace.render.newline = "all"; + indent-guides.render = true; }; }; - language = [ - { - name = "rust"; - auto-format = false; - } - { - name = "html"; - file-types = [ "html" ]; - } - { - name = "c"; - } - ]; + languages = { + language-server = { + nil = { + command = lib.getExe pkgs.nil; + config.nil.formatting.command = [ "${lib.getExe pkgs.alejandra}" "-q" ]; + }; + clangd = { + command = "${pkgs.clang-tools}/bin/clangd"; + clangd.fallbackFlags = [ "-std=c++2b" ]; + }; + vscode-css-language-server = { + command = "${pkgs.nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver"; + args = [ "--stdio" ]; + }; + }; + language = [ + { + name = "rust"; + auto-format = false; + } + { + name = "html"; + file-types = [ "html" ]; + } + { + name = "c"; + } + ]; + }; }; }; } diff --git a/modules/tui/neovim/default.nix b/modules/tui/neovim/default.nix index 1345a443..5baf2f59 100644 --- a/modules/tui/neovim/default.nix +++ b/modules/tui/neovim/default.nix @@ -1,187 +1,207 @@ { + config, + config', + inputs, + lib, pkgs, ... -}: { - programs.neovim-flake = { - enable = true; - settings = { - vim = { - package = pkgs.neovim-nightly; - viAlias = true; - vimAlias = true; - enableEditorconfig = true; - preventJunkFiles = true; - enableLuaLoader = true; +}: with lib; let + cfg = config.myOptions.programs.neovim; +in { + options.myOptions.programs.neovim.enable = mkEnableOption "enable neovim"; - scrollOffset = 7; + config = mkIf cfg.enable { + home-manager.users.${config'.username} = { + imports = [ inputs.neovim-flake.homeManagerModules.default ]; - useSystemClipboard = false; + programs.neovim-flake = { + enable = true; + settings = { + vim = { + package = pkgs.neovim-nightly; + viAlias = true; + vimAlias = true; + enableEditorconfig = true; + preventJunkFiles = true; + enableLuaLoader = true; - maps = { - normal = { - "gD" = { - action = "vim.lsp.buf.declaration"; - lua = true; - }; - "gd" = { - action = "vim.lsp.buf.definition"; - lua = true; - }; - "gi" = { - action = "vim.lsp.buf.implementation"; - lua = true; - }; - "gr" = { - action = "vim.lsp.buf.references"; - lua = true; - }; - "K" = { - action = "vim.lsp.buf.hover"; - lua = true; - }; - "" = { - action = "vim.lsp.buf.signature_help"; - lua = true; - }; - "wa" = { - action = "vim.lsp.buf.add_workspace_folder"; - lua = true; - }; - "wr" = { - action = "vim.lsp.buf.remove_workspace_folder"; - lua = true; - }; - "wl" = { - action = '' - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end - ''; - lua = true; - }; - "D" = { - action = "vim.lsp.buf.type_definition"; - lua = true; - }; - "r" = { - action = "vim.lsp.buf.rename"; - lua = true; - }; - "a" = { - action = "vim.lsp.buf.code_action"; - lua = true; - }; - "e" = { - action = "vim.diagnostic.open_float"; - lua = true; - }; - "q" = { - action = "vim.diagnostic.setloclist"; - lua = true; - }; - "[d" = { - action = "vim.diagnostic.goto_prev"; - lua = true; - }; - "]d" = { - action = "vim.diagnostic.goto_next"; - lua = true; - }; - "" = { - action = '' - function() - vim.lsp.buf.format { async = true } - end - ''; - lua = true; - }; - }; - }; + scrollOffset = 7; - treesitter = { - enable = true; - fold = true; - grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ - lua - rust - markdown - markdown-inline - python - cmake - cpp - ]; - }; + useSystemClipboard = false; - # extraPlugins = with pkgs.vimPlugins; [ - # - # ]; + maps = { + normal = { + "gD" = { + action = "vim.lsp.buf.declaration"; + lua = true; + }; + "gd" = { + action = "vim.lsp.buf.definition"; + lua = true; + }; + "gi" = { + action = "vim.lsp.buf.implementation"; + lua = true; + }; + "gr" = { + action = "vim.lsp.buf.references"; + lua = true; + }; + "K" = { + action = "vim.lsp.buf.hover"; + lua = true; + }; + "" = { + action = "vim.lsp.buf.signature_help"; + lua = true; + }; + "wa" = { + action = "vim.lsp.buf.add_workspace_folder"; + lua = true; + }; + "wr" = { + action = "vim.lsp.buf.remove_workspace_folder"; + lua = true; + }; + "wl" = { + action = '' + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end + ''; + lua = true; + }; + "D" = { + action = "vim.lsp.buf.type_definition"; + lua = true; + }; + "r" = { + action = "vim.lsp.buf.rename"; + lua = true; + }; + "a" = { + action = "vim.lsp.buf.code_action"; + lua = true; + }; + "e" = { + action = "vim.diagnostic.open_float"; + lua = true; + }; + "q" = { + action = "vim.diagnostic.setloclist"; + lua = true; + }; + "[d" = { + action = "vim.diagnostic.goto_prev"; + lua = true; + }; + "]d" = { + action = "vim.diagnostic.goto_next"; + lua = true; + }; + "" = { + action = '' + function() + vim.lsp.buf.format { async = true } + end + ''; + lua = true; + }; + }; + }; - lsp = { - formatOnSave = false; - }; - - languages = { - enableLSP = true; - enableFormat = true; - enableTreesitter = true; - enableExtraDiagnostics = true; - - nix.enable = true; - html.enable = true; - ts.enable = true; - rust = { - enable = true; - crates.enable = true; - }; - - clang = { - enable = true; - lsp = { + treesitter = { enable = true; - server = "clangd"; + fold = true; + grammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ + lua + rust + markdown + markdown-inline + python + cmake + cpp + ]; + }; + + # extraPlugins = with pkgs.vimPlugins; [ + # + # ]; + + lsp = { + formatOnSave = false; + }; + + languages = { + enableLSP = true; + enableFormat = true; + enableTreesitter = true; + enableExtraDiagnostics = true; + + nix.enable = true; + html.enable = true; + ts.enable = true; + rust = { + enable = true; + crates.enable = true; + }; + + clang = { + enable = true; + lsp = { + enable = true; + server = "clangd"; + }; + }; + + java = { + enable = true; + treesitter.enable = true; + lsp.enable = true; + }; + }; + + autocomplete = { + enable = true; + }; + + telescope.enable = true; + + git = { + enable = true; + gitsigns = { + enable = true; + codeActions = true; + }; + }; + #filetree.chadtree = { + # enable = true; + #}; + + filetree.nvimTree = { + enable = true; + mappings = { + toggle = "v"; + }; + disableNetrw = true; + + openOnSetup = false; + }; + + terminal.toggleterm = { + enable = true; + direction = "float"; + mappings.open = ""; + }; + + theme = { + enable = true; + name = "catppuccin"; + style = "mocha"; + transparent = true; }; }; }; - - autocomplete = { - enable = true; - }; - - telescope.enable = true; - - git = { - enable = true; - gitsigns = { - enable = true; - codeActions = true; - }; - }; - #filetree.chadtree = { - # enable = true; - #}; - - filetree.nvimTree = { - enable = true; - mappings = { - toggle = "v"; - }; - disableNetrw = true; - - openOnSetup = false; - }; - - terminal.toggleterm = { - enable = true; - direction = "float"; - mappings.open = ""; - }; - - theme = { - enable = true; - name = "catppuccin"; - style = "mocha"; - transparent = true; - }; }; }; };