diff --git a/flake.nix b/flake.nix index b5b1bcd..4799cc7 100755 --- a/flake.nix +++ b/flake.nix @@ -16,8 +16,6 @@ hyprland.url = "github:hyprwm/hyprland"; hyprland-contrib.url = "github:hyprwm/contrib"; - ags.url = "github:Aylur/ags"; - eww-systray.url = "github:ralismark/eww/tray-3"; eww-systray.inputs.nixpkgs.follows = "nixpkgs"; @@ -40,6 +38,9 @@ mygui-git.url = "github:mygui/MyGUI/dae9ac4be5a09e672bec509b1a8552b107c40214"; mygui-git.flake = false; + + nvim-presence.url = "github:andweeb/presence.nvim"; + nvim-presence.flake = false; }; outputs = { @@ -68,29 +69,25 @@ formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; overlays = import ./overlay.nix {inherit inputs;}; - nixosConfigurations.terra = - nixpkgs.lib.nixosSystem - { - inherit system; - inherit pkgs; - specialArgs = {inherit inputs;}; - modules = [ - ./system/configuration.nix - home-manager.nixosModules.home-manager - { - home-manager = { - useUserPackages = true; - users.manuel = import ./user/home.nix; - extraSpecialArgs = { - inherit inputs; - inherit system; - }; - useGlobalPkgs = true; - }; - } - inputs.chaotic-nyx.nixosModules.default - inputs.nur.nixosModules.nur - ]; - }; + nixosConfigurations.terra = nixpkgs.lib.nixosSystem { + inherit system; + inherit pkgs; + specialArgs = {inherit inputs;}; + modules = [ + ./system/configuration.nix + inputs.chaotic-nyx.nixosModules.default + inputs.nur.nixosModules.nur + ]; + }; + + homeConfigurations.manuel = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = {inherit inputs;}; + modules = [ + ./user/home.nix + inputs.nix-index-database.hmModules.nix-index + inputs.nur.hmModules.nur + ]; + }; }; } diff --git a/overlay.nix b/overlay.nix index 623c8bc..9a726c9 100755 --- a/overlay.nix +++ b/overlay.nix @@ -1,6 +1,9 @@ {inputs, ...}: { default = final: prev: { - gruvbox-plus-icon-pack = final.callPackage ./pkgs/gruvbox-plus-icon-pack {inherit inputs;}; + gruvbox-plus-icon-pack = prev.callPackage ./pkgs/gruvbox-plus-icon-pack {inherit inputs;}; + eww-hyprland-activewindow = prev.callPackage ./pkgs/eww-hyprland-activewindow {}; + eww-hyprland-workspaces = prev.callPackage ./pkgs/eww-hyprland-workspaces {}; + bitwarden-rofi = prev.callPackage ./pkgs/bitwarden-rofi { rofi = prev.rofi-wayland; }; ncmpcpp = prev.ncmpcpp.override { visualizerSupport = true; @@ -44,5 +47,14 @@ prev.mpg123 ]; }; + + vimPlugins = + prev.vimPlugins + // { + presence-nvim = prev.vimUtils.buildVimPlugin { + name = "presence"; + src = inputs.nvim-presence; + }; + }; }; } diff --git a/pkgs/bitwarden-rofi/default.nix b/pkgs/bitwarden-rofi/default.nix new file mode 100644 index 0000000..146144c --- /dev/null +++ b/pkgs/bitwarden-rofi/default.nix @@ -0,0 +1,65 @@ +# Shamelessly stolen from https://raw.githubusercontent.com/nix-community/nur-combined/master/repos/reedrw/pkgs/bitwarden-rofi/default.nix + +{ stdenv +, lib +, fetchFromGitHub +, makeWrapper +, unixtools +, wl-clipboard +, ydotool +, bitwarden-cli +, rofi +, jq +, keyutils +, libnotify +}: +let + bins = [ + bitwarden-cli + jq + keyutils + libnotify + rofi + unixtools.getopt + wl-clipboard + ydotool + ]; +in +stdenv.mkDerivation rec { + pname = "bitwarden-rofi"; + version = "0.5"; + + src = fetchFromGitHub { + owner = "mattydebie"; + repo = "bitwarden-rofi"; + rev = "${version}"; + sha256 = "sha256-jXPwbvUTlMdwd/SYesfMuu7sQgR2WMiKOK88tGcQrcA="; + }; + + buildInputs = [ + makeWrapper + ]; + + installPhase = '' + mkdir -p "$out/bin" + install -Dm755 "bwmenu" "$out/bin/bwmenu" + install -Dm755 "lib-bwmenu" "$out/bin/lib-bwmenu" # TODO don't put this in bin + + install -Dm755 -d "$out/usr/share/doc/bitwarden-rofi" + install -Dm755 -d "$out/usr/share/doc/bitwarden-rofi/img" + + install -Dm644 "README.md" "$out/usr/share/doc/bitwarden-rofi/README.md" + install -Dm644 img/* "$out/usr/share/doc/bitwarden-rofi/img/" + + wrapProgram "$out/bin/bwmenu" --prefix PATH : ${lib.makeBinPath bins} + ''; + + meta = with lib; { + description = "Wrapper for Bitwarden and Rofi"; + homepage = "https://github.com/mattydebie/bitwarden-rofi"; + license = licenses.gpl3; + platforms = platforms.linux; + }; + +} + diff --git a/pkgs/eww-hyprland-activewindow/default.nix b/pkgs/eww-hyprland-activewindow/default.nix new file mode 100644 index 0000000..f414c8b --- /dev/null +++ b/pkgs/eww-hyprland-activewindow/default.nix @@ -0,0 +1,18 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, +}: +rustPlatform.buildRustPackage rec { + pname = "hyprland-workspaces"; + version = "0.4.4"; + + src = fetchFromGitHub { + owner = "FieldofClay"; + repo = "hyprland-activewindow"; + rev = "v${version}"; + hash = "sha256-DaQrVXrmDr1v/nECTVMfTrIgFe7j1dNLLGCjYeBfRpU="; + }; + + cargoHash = "sha256-wktlWAJ+cJNv+2Lrv2dys5yA2BUaU3EnvVjgEUocvaI="; +} diff --git a/pkgs/eww-hyprland-workspaces/default.nix b/pkgs/eww-hyprland-workspaces/default.nix new file mode 100644 index 0000000..a9869ec --- /dev/null +++ b/pkgs/eww-hyprland-workspaces/default.nix @@ -0,0 +1,17 @@ +{ + rustPlatform, + fetchFromGitHub, +}: +rustPlatform.buildRustPackage rec { + pname = "hyprland-workspaces"; + version = "1.2.5"; + + src = fetchFromGitHub { + owner = "FieldofClay"; + repo = "hyprland-workspaces"; + rev = "v${version}"; + hash = "sha256-5/add1VSJe5ChKi4UU5iUKRAj4kMjOnbB76QX/FkA6k="; + }; + + cargoHash = "sha256-kUDo+6fsrzzojHYNMNBYpztGJPPtPp/OXUypUJnzebY="; +} diff --git a/system/configuration.nix b/system/configuration.nix index 6fa57b4..aedb42c 100755 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -124,6 +124,7 @@ unrar unzip usbutils + wget ydotool ]; }; @@ -134,8 +135,8 @@ ''; user.extraConfig = '' - # needed for xdg-open to find the default browser. Why the fuck do I even need to do that? - DefaultEnvironment="PATH=/etc/profiles/per-user/manuel/bin:/run/current/system/sw/bin" + # # needed for xdg-open to find the default browser. Why the fuck do I even need to do that? + # DefaultEnvironment="PATH=/etc/profiles/per-user/$USER/bin:/run/current/system/sw/bin" #Systemd is a meme. This is the proof DefaultTimeoutStopSec=10s diff --git a/system/services/xdg-portal/default.nix b/system/services/xdg-portal/default.nix index 926a17b..05e25ae 100644 --- a/system/services/xdg-portal/default.nix +++ b/system/services/xdg-portal/default.nix @@ -2,7 +2,7 @@ xdg.portal = { enable = true; config.common.default = "*"; - xdgOpenUsePortal = true; + xdgOpenUsePortal = false; wlr.enable = false; #conflict with XDPH if enabled extraPortals = [pkgs.xdg-desktop-portal-gtk]; }; diff --git a/user/configs/firefox/default.nix b/user/configs/firefox/default.nix index eebda85..623a805 100755 --- a/user/configs/firefox/default.nix +++ b/user/configs/firefox/default.nix @@ -5,20 +5,53 @@ profiles.${config.home.username} = { extensions = with config.nur.repos.rycee.firefox-addons; [ augmented-steam + bitwarden + blocktube bypass-paywalls-clean darkreader gruvbox-dark-theme + indie-wiki-buddy + istilldontcareaboutcookies nitter-redirect + privacy-badger redirector + return-youtube-dislikes sponsorblock - startpage-private-search + stylus + tampermonkey ublock-origin youtube-shorts-block ]; settings = { + "general.smoothScroll" = false; "media.hardwaremediakeys.enabled" = false; }; + + bookmarks = [ + { + toolbar = true; + bookmarks = [ + { + name = "NixOS"; + bookmarks = [ + { + name = "NixOS Search"; + url = "https://search.nixos.org"; + } + { + name = "Home Manager Options List"; + url = "https://nix-community.github.io/home-manager/options.xhtml"; + } + { + name = "Home Manager Options Search"; + url = "https://mipmip.github.io/home-manager-option-search"; + } + ]; + } + ]; + } + ]; }; }; } diff --git a/user/configs/fish/default.nix b/user/configs/fish/default.nix index 41fbae0..aa0acf0 100755 --- a/user/configs/fish/default.nix +++ b/user/configs/fish/default.nix @@ -39,18 +39,16 @@ ''; nor = '' - pushd $PWD &> /dev/null - cd "${config.home.homeDirectory}/.dotfiles" - doas nixos-rebuild switch --flake .# - popd &> /dev/null + doas nixos-rebuild switch --flake ${config.home.homeDirectory}/.dotfiles + ''; + + hms = '' + home-manager switch --flake ${config.home.homeDirectory}/.dotfiles ''; nou = '' - pushd . &> /dev/null - cd "${config.home.homeDirectory}/.dotfiles" - nix flake update --commit-lock-file - doas nixos-rebuild switch --upgrade --flake .# - popd &> /dev/null + nix flake update ${config.home.homeDirectory}/.dotfiles --commit-lock-file + doas nixos-rebuild switch --upgrade --flake ${config.home.homeDirectory}/.dotfiles ''; }; shellAliases = { diff --git a/user/configs/mpd/default.nix b/user/configs/mpd/default.nix index 1e5c98f..71a05b8 100755 --- a/user/configs/mpd/default.nix +++ b/user/configs/mpd/default.nix @@ -1,4 +1,4 @@ -{ +{pkgs, ...}: { imports = [ ../../modules/mpd-notification ]; @@ -103,4 +103,6 @@ services.mpd-notification = { enable = true; }; + + home.packages = [pkgs.mpc-cli]; } diff --git a/user/configs/neovim/config/lua/plugins/presence.lua b/user/configs/neovim/config/lua/plugins/presence.lua new file mode 100644 index 0000000..5c4b69c --- /dev/null +++ b/user/configs/neovim/config/lua/plugins/presence.lua @@ -0,0 +1 @@ +require("presence").setup({}) diff --git a/user/configs/neovim/default.nix b/user/configs/neovim/default.nix index 94baa32..6ed5d52 100755 --- a/user/configs/neovim/default.nix +++ b/user/configs/neovim/default.nix @@ -1,6 +1,7 @@ {pkgs, ...}: { programs.neovim = { enable = true; + defaultEditor = true; plugins = with pkgs.vimPlugins; [ bufferline-nvim @@ -24,6 +25,7 @@ smart-splits-nvim vim-easy-align which-key-nvim + presence-nvim vim-fugitive diff --git a/user/configs/wayland/eww/config/eww.scss b/user/configs/wayland/eww/config/eww.scss new file mode 100644 index 0000000..c796426 --- /dev/null +++ b/user/configs/wayland/eww/config/eww.scss @@ -0,0 +1,111 @@ +$bg: rgb(40,40,40); +$fg: rgb(235,219,178); + +$widgetbg: rgb(80, 73, 69); +$border: rgb(102, 92, 84); + +$wsfg: rgb(235,219,178); +$wsbg: rgb(60,56,54); +$activewsbg: rgb(102,92,84); + +$border_radius: 6px; + +* { + all: unset; +} + +.panel { + background: rgba($bg, 0.8); + color: $fg; + font-size: 14px; + + border-radius: 0 0 $border-radius $border-radius; + border-bottom: 4px solid $border; + border-right: 4px solid $border; + border-left: 4px solid $border; + + @mixin widget { + font-size: 12px; + + background-color: $widgetbg; + + margin-top: 0.25em; + margin-bottom: 0.25em; + margin-left: 0.8em; + margin-right: 0.8em; + + padding-left: 0.8em; + padding-right: 0.8em; + + border-radius: $border-radius; + } + + .widget-workspace { + @include widget; + padding: 0; + + .workspace { + font-size: 14px; + } + + .workspace-button { + padding: 0 1em 0 1em; + + :first-child { + border-radius: $border-radius 0 0 $border-radius; + } + + :last-child { + border-radius: 0 $border-radius $border-radius 0; + } + } + + .workspace-active { + background: $fg; + color: $bg; + border-radius: $border-radius; + } + } + + .widget-activewindow { + font-size: 12px; + margin: 0 0 0 1em; + } + + .widget-systray { + @include widget; + + menu, menu menu { + font-size: 14px; + border-radius: $border-radius; + + background: $widgetbg; + color: $fg; + border: 1px solid $border; + + padding: 0.3em; + + :hover { + background: $fg; + color: $widgetbg; + } + + >separator { + border-top: 1px solid; + margin: 0.5em 0 0.5em 0; + padding: 0; + } + } + } + + .widget-music { + @include widget; + } + + .widget-time { + @include widget; + font-size: 14px; + } + +} + diff --git a/user/configs/wayland/eww/config/eww.yuck b/user/configs/wayland/eww/config/eww.yuck new file mode 100644 index 0000000..37a9930 --- /dev/null +++ b/user/configs/wayland/eww/config/eww.yuck @@ -0,0 +1,121 @@ +(defpoll TIME :interval "1s" "date '+%H:%M'") +(defpoll VOL :interval "1s" "scripts/getvol") + +(deflisten ACTIVEWINDOW :initial "[]" "hyprland-activewindow _") +(deflisten WORKSPACE0 :initial "[]" "hyprland-workspaces $(hyprctl monitors -j | jq -r \".[0].name\")") +(deflisten WORKSPACE1 :initial "[]" "hyprland-workspaces $(hyprctl monitors -j | jq -r \".[1].name\")") +(deflisten MUSIC :initial "" "scripts/mpd_current_song.sh") + + +;; -------------------------- + +(defwidget bar [monitor] + (centerbox + :class "panel" + (panel_left :monitor monitor) + (panel_center :monitor monitor) + (panel_right :monitor monitor) + ) +) + +(defwidget panel_left [monitor] + (box + :halign "start" + :space-evenly false + (widget_workspaces :monitor monitor) + (widget_activewindow :monitor monitor) + ) +) + +(defwidget panel_center [monitor] + (box + :halign "center" + :space-evenly false + + (widget_music) + ) +) + +(defwidget panel_right [monitor] + (box + :halign "end" + :space-evenly false + + (widget_systray) + (widget_time) + ) +) + +;; -------------------------- + +(defwidget widget_workspaces [monitor] + (eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" + (box :class "widget-workspace" + (for i in {monitor == 0 ? WORKSPACE0 : WORKSPACE1} + (button + :onclick "hyprctl dispatch workspace ${i.id}" + :class "${i.class}" + "${i.name}" + ) + ) + ) + ) +) + +(defwidget widget_activewindow [monitor] + (box + :class "widget-activewindow" + (label :text + {ACTIVEWINDOW == "[]" ? "" : "${ACTIVEWINDOW['${monitor}'].title}"} + ) + ) +) + +(defwidget widget_music [] + (box + :class "widget-music" + MUSIC + ) +) + +(defwidget widget_systray [] + (box + :class "widget-systray" + (systray + :pack-direction "rtl" + ) + ) +) + +(defwidget widget_time [] + (box + :class "widget-time" + TIME + ) +) + +;; -------------------------- + +(defwindow bar0 + :monitor 0 + :exclusive true + :geometry + (geometry + :width "95%" + :height "36px" + :anchor "top center" + ) + (bar :monitor 0) +) + +(defwindow bar1 + :monitor 1 + :exclusive true + :geometry + (geometry + :width "95%" + :height "36px" + :anchor "top center" + ) + (bar :monitor 1) +) diff --git a/user/configs/wayland/eww/config/scripts/mpd_current_song.sh b/user/configs/wayland/eww/config/scripts/mpd_current_song.sh new file mode 100755 index 0000000..dee8414 --- /dev/null +++ b/user/configs/wayland/eww/config/scripts/mpd_current_song.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +currentsong="" +state="" + +while true; do + state=$(mpc status %state%) + current_song=$(mpc current) + + if [[ $state == "playing" ]]; then + echo " $current_song" + elif [[ $state == "paused" && $current_song ]]; then + echo "󰏤 $current_song" + else + echo " stopped" + fi + mpc idle player &> /dev/null +done diff --git a/user/configs/wayland/eww/default.nix b/user/configs/wayland/eww/default.nix new file mode 100644 index 0000000..8fa2da1 --- /dev/null +++ b/user/configs/wayland/eww/default.nix @@ -0,0 +1,16 @@ +{ + pkgs, + inputs, + ... +}: { + programs.eww = { + enable = true; + package = inputs.eww-systray.packages.${pkgs.system}.eww-wayland; + configDir = ./config; + }; + + home.packages = [ + pkgs.eww-hyprland-activewindow + pkgs.eww-hyprland-workspaces + ]; +} diff --git a/user/configs/wayland/hyprland/default.nix b/user/configs/wayland/hyprland/default.nix index 976561a..6a6bde4 100755 --- a/user/configs/wayland/hyprland/default.nix +++ b/user/configs/wayland/hyprland/default.nix @@ -2,16 +2,17 @@ config, pkgs, inputs, - system, ... }: { imports = [ + ../eww + ../mako ./settings.nix ]; wayland.windowManager.hyprland = { enable = true; - package = inputs.hyprland.packages.${system}.hyprland; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; }; home.file.".local/share/kservices5/swww.desktop".text = '' @@ -28,7 +29,7 @@ ''; home.packages = [ - inputs.hyprland-contrib.packages.${system}.hyprprop + inputs.hyprland-contrib.packages.${pkgs.system}.hyprprop pkgs.hyprpicker pkgs.swww pkgs.wl-clipboard diff --git a/user/configs/wayland/hyprland/settings.nix b/user/configs/wayland/hyprland/settings.nix index cb48dfe..d055081 100644 --- a/user/configs/wayland/hyprland/settings.nix +++ b/user/configs/wayland/hyprland/settings.nix @@ -25,13 +25,13 @@ in { ]; workspace = [ - "1, monitor:${rightMonitor.display}, persistent:true" - "2, monitor:${rightMonitor.display}, persistent:true" - "3, monitor:${rightMonitor.display}, persistent:true" + "1, monitor:${rightMonitor.display}" + "2, monitor:${rightMonitor.display}" + "3, monitor:${rightMonitor.display}" - "4, monitor:${leftMonitor.display}, persistent:true" - "5, monitor:${leftMonitor.display}, persistent:true" - "6, monitor:${leftMonitor.display}, persistent:true" + "4, monitor:${leftMonitor.display}" + "5, monitor:${leftMonitor.display}" + "6, monitor:${leftMonitor.display}" ]; input = { @@ -64,7 +64,7 @@ in { }; decoration = { - rounding = 10; + rounding = 6; blur = { enabled = true; @@ -101,11 +101,12 @@ in { "${pkgs.openrgb}/bin/openrgb --startminimized --profile autorun.orp" "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${pkgs.ydotool}/bin/ydotoold" + "${pkgs.bitwarden}/bin/bitwarden" ]; exec = [ "${pkgs.xorg.xrandr}/bin/xrandr --output ${rightMonitor.display} --primary" - "eww kill; sleep 1; eww open-many bar0 bar1" + "pkill eww; sleep 1; eww open-many bar0 bar1" "sleep 2; pkill swww-daemon; swww init" #Set cursor @@ -138,7 +139,6 @@ in { "${modKey} SHIFT, Q, killactive" "${modKey}, D, exec, ${pkgs.rofi-wayland}/bin/rofi -show drun -p Applications -show-icons" - "${modKey} SHIFT, P, exec, ${pkgs.rofi-pass-wayland}/bin/rofi-pass" "${modKey}, Q, exec, ${pkgs.firefox}/bin/firefox" @@ -147,8 +147,6 @@ in { ", XF86AudioRaiseVolume, exec, ${pkgs.pamixer}/bin/pamixer -i 5 --get-volume" ", XF86AudioLowerVolume, exec, ${pkgs.pamixer}/bin/pamixer -d 5 --get-volume" - "CTRL, grave, exec, ags toggle-window notification-center" - "MOD5, F9, exec, ${pkgs.playerctl}/bin/playerctl stop" "MOD5, F10, exec, ${pkgs.playerctl}/bin/playerctl previous" "MOD5, F11, exec, ${pkgs.playerctl}/bin/playerctl play-pause" @@ -169,8 +167,6 @@ in { "blur, notifications" "ignorezero, notifications" "blur, gtk-layer-shell" - "blur, bar-0" - "blur, bar-1" "blur, notificationPopupWindow" "ignorezero, notificationPopupWindow" ]; diff --git a/user/configs/wayland/mako/default.nix b/user/configs/wayland/mako/default.nix new file mode 100644 index 0000000..5b724af --- /dev/null +++ b/user/configs/wayland/mako/default.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + ... +}: { + services.mako = { + enable = true; + anchor = "top-right"; + defaultTimeout = 5000; + + width = 440; + height = 320; + + backgroundColor = "#282828B3"; + borderColor = "#665C54ff"; + textColor = "#ebdbb2"; + progressColor = "over #665c54"; + borderRadius = 6; + borderSize = 2; + + font = "JetBrainsMono Nerd Font Regular 10"; + }; +} diff --git a/user/home.nix b/user/home.nix index d20f505..d995794 100755 --- a/user/home.nix +++ b/user/home.nix @@ -3,7 +3,6 @@ pkgs, lib, inputs, - system, ... }: { imports = [ @@ -22,21 +21,22 @@ ./configs/tmux ./configs/wayland/hyprland ./configs/xdg-mime.nix - inputs.nix-index-database.hmModules.nix-index - inputs.nur.hmModules.nur ]; home.username = "manuel"; home.homeDirectory = "/home/manuel"; home.packages = with pkgs; [ + bitwarden-rofi appimage-run armcord bc + bitwarden bottles bottom calcurse electron filezilla + floorp gimp gnome.gnome-boxes gnome.gnome-settings-daemon @@ -44,7 +44,6 @@ gnome.seahorse gnome.simple-scan imv - inputs.eww-systray.packages.${system}.eww-wayland jq libsForQt5.ark libsForQt5.dolphin @@ -79,12 +78,10 @@ ]; home.sessionVariables = { - EDITOR = "nvim"; GTK_THEME = "${builtins.toString config.gtk.theme.name}"; NIXOS_OZONE_WL = "1"; NIXPKGS_ALLOW_UNFREE = "1"; WINEDLLOVERRIDES = "winemenubuilder.exe=d"; - XDG_SCREENSHOTS_DIR = "~/Screenshots"; }; fonts.fontconfig.enable = true; @@ -141,7 +138,6 @@ programs = { aria2.enable = true; - password-store.enable = true; command-not-found.enable = false; fzf = { @@ -183,5 +179,7 @@ download = "/mnt/hdd/Downloads"; }; + programs.home-manager.enable = true; + home.stateVersion = "23.05"; }