make eww more reusable, tinker with doom emacs and agda

This commit is contained in:
Leon Vatthauer 2025-03-09 19:59:58 +01:00
parent bffcdeca73
commit 71718f1981
Signed by: leonv
SSH key fingerprint: SHA256:G4+ddwoZmhLPRB1agvXzZMXIzkVJ36dUYZXf5NxT+u8
16 changed files with 80 additions and 60 deletions

View file

@ -21,9 +21,6 @@
# Docker # Docker
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
services.emacs.package = pkgs.emacs29-pgtk;
services.emacs.enable = true;
# optimize power usage # optimize power usage
powerManagement.enable = true; powerManagement.enable = true;

View file

@ -78,7 +78,6 @@
;; ;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented. ;; they are implemented.
(envrc-global-mode)
(setq +latex-viewers '(pdf-tools)) (setq +latex-viewers '(pdf-tools))
(eval-after-load "tex" (eval-after-load "tex"
'(add-to-list 'TeX-command-list '(add-to-list 'TeX-command-list
@ -87,7 +86,6 @@
(pdf-tools-install) (pdf-tools-install)
(evil-global-set-key 'normal (kbd "SPC t t") #'treemacs) (evil-global-set-key 'normal (kbd "SPC t t") #'treemacs)
;; The following is a hack to use the right agda version for my thesis... ;; The following is a hack to use the right agda version for my thesis...
;; (load-file "/nix/store/38cw6va0dhln7gknwsz7ghazlcldjgdc-Agda-2.6.3-data/share/ghc-9.2.8/x86_64-linux-ghc-9.2.8/Agda-2.6.3/emacs-mode/agda2.el") (load-file "/nix/store/p2b07qnkw664ni99is80ja4hvynllhw8-Agda-2.7.0.1-data/share/ghc-9.6.6/x86_64-linux-ghc-9.6.6/Agda-2.7.0.1/emacs-mode/agda2.el")
;;(load-file (let ((coding-system-for-read 'utf-8))
;; (shell-command-to-string "agda-mode locate")))
(add-to-list 'auto-mode-alist '("\\.lagda.md\\'" . agda2-mode)) (add-to-list 'auto-mode-alist '("\\.lagda.md\\'" . agda2-mode))
(envrc-global-mode)

View file

@ -114,7 +114,7 @@
;;tty ; improve the terminal Emacs experience ;;tty ; improve the terminal Emacs experience
:lang :lang
(agda +local) ; types of types of types of types... ;;(agda +local) ; types of types of types of types...
;;beancount ; mind the GAAP ;;beancount ; mind the GAAP
;;(cc +lsp) ; C > C++ == 1 ;;(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp ;;clojure ; java with a lisp

View file

@ -2,9 +2,7 @@
{ {
imports = [ imports = [
./../common ./../common
# ./hypr/hyprland.nix
./../modules/hyprland ./../modules/hyprland
./eww
]; ];
/* The home.stateVersion option does not have a default and must be set */ /* The home.stateVersion option does not have a default and must be set */
home.stateVersion = "24.11"; home.stateVersion = "24.11";
@ -30,14 +28,6 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
prismlauncher prismlauncher
# theme for gtk applications
orchis-theme
(catppuccin-gtk.override {
accents = [ "flamingo" ];
size = "compact";
tweaks = [ "rimless" "black" ];
variant = "macchiato";
})
# smt solver for liquid haskell # smt solver for liquid haskell
z3 z3
@ -91,24 +81,6 @@
anki anki
pandoc pandoc
# hyprland
kitty
networkmanagerapplet
mako
libnotify
pavucontrol
hyprpaper
qimgv
playerctl
hyprpicker
wev
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
bluez
htop
file-roller
zip
unzip
# yubikey # yubikey
yubico-pam yubico-pam
yubikey-manager yubikey-manager
@ -124,6 +96,7 @@
# for emacs # for emacs
texlab texlab
shellcheck shellcheck
emacs
]; ];
xdg.configHome = /home/leonv/.config; xdg.configHome = /home/leonv/.config;

View file

@ -1,13 +1,23 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, inputs, ... }:
with lib; with lib;
with types; with types;
let let
cfg = config.modules.hyprland; cfg = config.modules.hyprland;
in in
{ {
imports = [
./eww
];
options.modules.hyprland = { options.modules.hyprland = {
enable = mkEnableOption "Hyprland Wrapper"; enable = mkEnableOption "Hyprland Wrapper";
# eww
oled = mkOption {
type = bool;
description = ''Special theming for OLED monitors.'';
default = false;
};
# monitor setup # monitor setup
monitor = mkOption { monitor = mkOption {
type = listOf str; type = listOf str;
@ -33,7 +43,7 @@ in
hyprpaper = { hyprpaper = {
enable = mkEnableOption "Hyprpaper wrapper"; enable = mkEnableOption "Hyprpaper wrapper";
wallpaper = mkOption { wallpaper = mkOption {
type = types.path; type = path;
default = []; default = [];
description = '' description = ''
Wallpaper to be set on every monitor Wallpaper to be set on every monitor
@ -50,6 +60,35 @@ in
# TODO start script # TODO start script
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [
# hyprland
kitty
networkmanagerapplet
mako
libnotify
pavucontrol
hyprpaper
qimgv
playerctl
hyprpicker
wev
inputs.hyprland-contrib.packages.${pkgs.system}.grimblast
bluez
htop
file-roller
zip
unzip
# theme for gtk applications
orchis-theme
(catppuccin-gtk.override {
accents = [ "flamingo" ];
size = "compact";
tweaks = [ "rimless" "black" ];
variant = "macchiato";
})
];
services.hyprpaper = mkIf cfg.hyprpaper.enable { services.hyprpaper = mkIf cfg.hyprpaper.enable {
enable = true; enable = true;
settings = { settings = {
@ -162,7 +201,7 @@ in
"$mod, C, togglespecialworkspace, scratchpad" "$mod, C, togglespecialworkspace, scratchpad"
# status bar # status bar
"$mod, T, exec, eww open --toggle top-bar" "$mod, T, exec, eww open --toggle top-bar --arg oled=${if cfg.oled then "true" else "false"}"
]; ];
bindm = [ bindm = [
"$mod, mouse:272, movewindow" "$mod, mouse:272, movewindow"
@ -175,6 +214,7 @@ in
exec-once = [ exec-once = [
"bash ~/Git/nixos/modules/hyprland/start.sh" "bash ~/Git/nixos/modules/hyprland/start.sh"
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"${if cfg.oled then "" else "eww open --toggle top-bar --arg oled=false"}"
]; ];
}; };
}; };

View file

@ -1,25 +1,7 @@
; inspired by https://github.com/saimoomedits/eww-widgets/tree/main ; inspired by https://github.com/saimoomedits/eww-widgets/tree/main
(include "widgets/workspaces/eww.yuck")
(include "./widgets/workspaces/eww.yuck") (include "widgets/window-title/eww.yuck")
(include "./widgets/window-title/eww.yuck") (include "widgets/resources/eww.yuck")
(include "./widgets/resources/eww.yuck")
(defwindow top-bar
:monitor 0
:geometry (geometry :x "0%"
:y "10px"
:width "98.8%"
:height "30px"
:anchor "top center")
:stacking "fg"
:exclusive true
(centerbox
:class "bar"
(left)
(center)
(right)
)
)
(defwidget left [] (defwidget left []
(box (box
@ -52,3 +34,32 @@
(bluetooth) (bluetooth)
(datetime) (datetime)
)) ))
(defwidget top-bar-oled []
(centerbox
:class "oled"
(left)
(right)
)
)
(defwidget top-bar-non-oled []
(centerbox
:class "non-oled"
(left)
(center)
(right)
)
)
(defwindow top-bar [oled]
:monitor 0
:geometry (geometry :x "0%"
:y "10px"
:width "98.8%"
:height "30px"
:anchor "top center")
:stacking "fg"
:exclusive true
(literal :content {oled ? "(top-bar-oled)" : "(top-bar-non-oled)"})
)

View file

@ -1,5 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
# TODO choose oled or non-oled depending on some set variable
programs.eww = { programs.eww = {
enable = true; enable = true;
configDir = ./config; configDir = ./config;