diff --git a/hosts/common/user/configs/gui/ags/default.nix b/hosts/common/user/configs/gui/ags/default.nix index dab75f7..4017f84 100644 --- a/hosts/common/user/configs/gui/ags/default.nix +++ b/hosts/common/user/configs/gui/ags/default.nix @@ -23,10 +23,7 @@ in target = "ags/config.js"; }; - programs.matugen.settings.templates.ags = { - input_path = ./theme.sass; - output_path = "${hmConfig.xdg.configHome}/ags/theme.sass"; - }; + theme.templates."${hmConfig.xdg.configHome}/ags/theme.sass".source = ./theme.sass; systemd.user = { targets.tray.Unit = { diff --git a/hosts/common/user/configs/gui/btop/default.nix b/hosts/common/user/configs/gui/btop/default.nix index c51797e..47c3fd8 100644 --- a/hosts/common/user/configs/gui/btop/default.nix +++ b/hosts/common/user/configs/gui/btop/default.nix @@ -12,23 +12,20 @@ let in { home-manager.users.${username} = { - programs = { - btop.settings.color_theme = "matugen"; + programs.btop.settings.color_theme = "matugen"; - matugen.settings.templates.btop = { - input_path = ./theme.theme; - output_path = "${hmConfig.xdg.configHome}/btop/themes/matugen.theme"; - }; + theme = { + templates."${hmConfig.xdg.configHome}/btop/themes/matugen.theme".source = ./theme.theme; + + extraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-btop"; + runtimeInputs = with pkgs; [ procps ]; + text = "exec pkill btop -SIGUSR2"; + } + ) + } &"; }; - - theme.extraConfig = "${ - lib.meta.getExe ( - pkgs.writeShellApplication { - name = "reload-btop"; - runtimeInputs = with pkgs; [ procps ]; - text = "exec pkill btop -SIGUSR2"; - } - ) - } &"; }; } diff --git a/hosts/common/user/configs/gui/gtk/default.nix b/hosts/common/user/configs/gui/gtk/default.nix index af5969e..40cf321 100644 --- a/hosts/common/user/configs/gui/gtk/default.nix +++ b/hosts/common/user/configs/gui/gtk/default.nix @@ -51,15 +51,9 @@ in ); }; - programs.matugen.settings.templates = { - gtk3 = { - input_path = ./theme.css; - output_path = "${hmConfig.xdg.configHome}/gtk-3.0/theme.css"; - }; - gtk4 = { - input_path = ./theme.css; - output_path = "${hmConfig.xdg.configHome}/gtk-4.0/theme.css"; - }; + theme.templates = { + "${hmConfig.xdg.configHome}/gtk-3.0/theme.css".source = ./theme.css; + "${hmConfig.xdg.configHome}/gtk-4.0/theme.css".source = ./theme.css; }; theme.extraConfig = "${ diff --git a/hosts/common/user/configs/gui/hyprland/default.nix b/hosts/common/user/configs/gui/hyprland/default.nix index e0b1ae7..bfa851c 100644 --- a/hosts/common/user/configs/gui/hyprland/default.nix +++ b/hosts/common/user/configs/gui/hyprland/default.nix @@ -131,29 +131,26 @@ in extraConfig = "source = ./theme.conf"; }; - programs = { - zsh.loginExtra = lib.mkAfter '' - if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then - hyprland &> /tmp/hyprland.log - fi - ''; + programs.zsh.loginExtra = lib.mkAfter '' + if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then + hyprland &> /tmp/hyprland.log + fi + ''; - matugen.settings.templates.hyprland = { - input_path = ./theme.conf; - output_path = "${hmConfig.xdg.configHome}/hypr/theme.conf"; - }; + theme = { + templates."${hmConfig.xdg.configHome}/hypr/theme.conf".source = ./theme.conf; + + extraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-hyprland"; + runtimeInputs = with pkgs; [ hyprland ]; + text = "exec hyprctl reload"; + } + ) + } &"; }; - theme.extraConfig = "${ - lib.meta.getExe ( - pkgs.writeShellApplication { - name = "reload-hyprland"; - runtimeInputs = with pkgs; [ hyprland ]; - text = "exec hyprctl reload"; - } - ) - } &"; - home.sessionVariables.NIXOS_OZONE_WL = "1"; }; } diff --git a/hosts/common/user/configs/gui/kitty/default.nix b/hosts/common/user/configs/gui/kitty/default.nix index d263fc0..abb684b 100644 --- a/hosts/common/user/configs/gui/kitty/default.nix +++ b/hosts/common/user/configs/gui/kitty/default.nix @@ -13,37 +13,34 @@ let in { home-manager.users.${username} = { - programs = { - kitty = { - enable = true; + programs.kitty = { + enable = true; - font = { - name = builtins.head hmConfig.theme.font.monospace.names; - package = builtins.head hmConfig.theme.font.monospace.packages; - inherit (hmConfig.theme.font) size; - }; - - extraConfig = '' - confirm_os_window_close 0 - include theme.conf - ''; + font = { + name = builtins.head hmConfig.theme.font.monospace.names; + package = builtins.head hmConfig.theme.font.monospace.packages; + inherit (hmConfig.theme.font) size; }; - matugen.settings.templates.kitty = { - input_path = ./theme.conf; - output_path = "${hmConfig.xdg.configHome}/kitty/theme.conf"; - }; + extraConfig = '' + confirm_os_window_close 0 + include theme.conf + ''; }; - theme.extraConfig = "${ - lib.meta.getExe ( - pkgs.writeShellApplication { - name = "reload-kitty"; - runtimeInputs = with pkgs; [ procps ]; - text = "exec pkill kitty -SIGUSR1"; - } - ) - } &"; + theme = { + templates."${hmConfig.xdg.configHome}/kitty/theme.conf".source = ./theme.conf; + + extraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "reload-kitty"; + runtimeInputs = with pkgs; [ procps ]; + text = "exec pkill kitty -SIGUSR1"; + } + ) + } &"; + }; home.persistence."/cache${userConfig.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/kitty" diff --git a/hosts/common/user/configs/gui/matugen/default.nix b/hosts/common/user/configs/gui/matugen/default.nix deleted file mode 100644 index 3a5ad18..0000000 --- a/hosts/common/user/configs/gui/matugen/default.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ - username ? throw "username argument is required", -}: -{ - config, - lib, - pkgs, - ... -}: -let - hmConfig = config.home-manager.users.${username}; -in -{ - home-manager.users.${username} = { - imports = [ ./options.nix ]; - - programs.matugen = { - enable = true; - settings = { - config = { - custom_colors = - let - mkColor = category: color: { - color = hmConfig.theme.color.${category}.${color}; - blend = hmConfig.theme.color.${category}.blend; - }; - in - { - danger = mkColor "semantic" "danger"; - warning = mkColor "semantic" "warning"; - success = mkColor "semantic" "success"; - info = mkColor "semantic" "info"; - - red = mkColor "basic" "red"; - orange = mkColor "basic" "orange"; - yellow = mkColor "basic" "yellow"; - green = mkColor "basic" "green"; - cyan = mkColor "basic" "cyan"; - blue = mkColor "basic" "blue"; - magenta = mkColor "basic" "magenta"; - pink = mkColor "basic" "magenta"; - - keywords = mkColor "syntax" "keywords"; - functions = mkColor "syntax" "functions"; - properties = mkColor "syntax" "properties"; - constants = mkColor "syntax" "constants"; - strings = mkColor "syntax" "strings"; - numbers = mkColor "syntax" "numbers"; - structures = mkColor "syntax" "structures"; - types = mkColor "syntax" "types"; - }; - - custom_keywords = - let - zeroPad = hex: if builtins.stringLength hex == 1 then "0${hex}" else hex; - percentageToHex = percentage: zeroPad (lib.trivial.toHexString (builtins.floor (percentage * 255))); - in - { - flavour = hmConfig.theme.flavour; - contrast = builtins.toString hmConfig.theme.contrast; - radius = builtins.toString hmConfig.theme.radius; - padding = builtins.toString hmConfig.theme.padding; - padding_double = builtins.toString (hmConfig.theme.padding * 2); - blur = builtins.toString hmConfig.theme.blur; - opacity = builtins.toString hmConfig.theme.opacity; - opacity_hex = builtins.toString (percentageToHex hmConfig.theme.opacity); - opacity_shadow = builtins.toString (hmConfig.theme.opacity * 0.75); - opacity_shadow_hex = builtins.toString (percentageToHex (hmConfig.theme.opacity * 0.75)); - font_size = builtins.toString hmConfig.theme.font.size; - font_sans_serif = builtins.head hmConfig.theme.font.sansSerif.names; - font_sans_serif_all = builtins.concatStringsSep ", " hmConfig.theme.font.sansSerif.names; - font_serif = builtins.head hmConfig.theme.font.serif.names; - font_serif_all = builtins.concatStringsSep ", " hmConfig.theme.font.serif.names; - font_monospace = builtins.head hmConfig.theme.font.monospace.names; - font_monospace_all = builtins.concatStringsSep ", " hmConfig.theme.font.monospace.names; - font_emoji = builtins.head hmConfig.theme.font.emoji.names; - font_emoji_all = builtins.concatStringsSep ", " hmConfig.theme.font.emoji.names; - }; - }; - - templates = { }; - }; - }; - - theme.extraConfig = lib.mkBefore ( - lib.meta.getExe ( - pkgs.writeShellApplication { - name = "theme-matugen"; - runtimeInputs = with pkgs; [ matugen ]; - text = '' - exec matugen image "${hmConfig.theme.configDir}/wallpaper" \ - --type scheme-${hmConfig.theme.flavour} \ - --mode "$(cat "${hmConfig.theme.configDir}/mode")" \ - --contrast ${builtins.toString hmConfig.theme.contrast} - ''; - } - ) - ); - }; -} diff --git a/hosts/common/user/configs/gui/matugen/options.nix b/hosts/common/user/configs/gui/matugen/options.nix deleted file mode 100644 index bee78b8..0000000 --- a/hosts/common/user/configs/gui/matugen/options.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -let - cfg = config.programs.matugen; -in -{ - # https://github.com/Theaninova/matugen/blob/add-home-manager-module/hm-module.nix - options.programs.matugen = - with lib; - with types; - { - enable = mkEnableOption "matugen"; - package = mkPackageOption pkgs "matugen" { }; - settings = mkOption { - type = attrsOf anything; - description = "Settings to write to config.toml."; - }; - }; - - config = lib.mkIf cfg.enable { - home.packages = [ cfg.package ]; - xdg.configFile."matugen/config.toml".source = lib.mkIf (cfg.settings != null) ( - (pkgs.formats.toml { }).generate "matugen" cfg.settings - ); - }; -} diff --git a/hosts/common/user/configs/gui/obsidian/default.nix b/hosts/common/user/configs/gui/obsidian/default.nix index 6bdd0d2..f96113b 100644 --- a/hosts/common/user/configs/gui/obsidian/default.nix +++ b/hosts/common/user/configs/gui/obsidian/default.nix @@ -15,712 +15,710 @@ in home-manager.users.${username} = { imports = [ ./options.nix ]; - programs = { - obsidian = { - enable = true; + programs.obsidian = { + enable = true; - sharedSettings = { - app = { - defaultViewMode = "preview"; - livePreview = false; - readableLineLength = false; - showLineNumber = true; - tabSize = 2; - promptDelete = false; - trashOption = "local"; - alwaysUpdateLinks = true; - newFileLocation = "folder"; - newFileFolderPath = "inbox"; - newLinkFormat = "absolute"; - showUnsupportedFiles = true; - attachmentFolderPath = "./assets"; - }; + sharedSettings = { + app = { + defaultViewMode = "preview"; + livePreview = false; + readableLineLength = false; + showLineNumber = true; + tabSize = 2; + promptDelete = false; + trashOption = "local"; + alwaysUpdateLinks = true; + newFileLocation = "folder"; + newFileFolderPath = "inbox"; + newLinkFormat = "absolute"; + showUnsupportedFiles = true; + attachmentFolderPath = "./assets"; + }; - corePlugins = [ - "bookmarks" - { - name = "canvas"; - options = { - newFileLocation = "folder"; - newFileFolderPath = "Inbox"; - defaultWheelBehavior = "zoom"; - }; - } - "canvas" - { - name = "command-palette"; - options = { - pinned = [ - "file-explorer:new-file" - "canvas:new-file" - "obsidian-excalidraw-plugin:excalidraw-autocreate-on-current" - "obsidian-kanban:create-new-kanban-board" - "obsidian-read-it-later:save-clipboard-to-notice" - ]; - }; - } - "editor-status" - "file-explorer" - "global-search" - "graph" - "note-composer" - "outgoing-link" - "outline" - "page-preview" - "slash-command" - "switcher" - "tag-pane" - ]; + corePlugins = [ + "bookmarks" + { + name = "canvas"; + options = { + newFileLocation = "folder"; + newFileFolderPath = "Inbox"; + defaultWheelBehavior = "zoom"; + }; + } + "canvas" + { + name = "command-palette"; + options = { + pinned = [ + "file-explorer:new-file" + "canvas:new-file" + "obsidian-excalidraw-plugin:excalidraw-autocreate-on-current" + "obsidian-kanban:create-new-kanban-board" + "obsidian-read-it-later:save-clipboard-to-notice" + ]; + }; + } + "editor-status" + "file-explorer" + "global-search" + "graph" + "note-composer" + "outgoing-link" + "outline" + "page-preview" + "slash-command" + "switcher" + "tag-pane" + ]; - communityPlugins = [ - { - pkg = import ./config/plugins/better-word-count { inherit pkgs; }; - options = { - statusBar = [ - { - suffix = " words"; - metric = { - type = 0; - counter = 0; - }; - } - ]; - altBar = [ - { - suffix = " files"; - metric = { - type = 2; - counter = 6; - }; - } - ]; - countComments = true; # Inverse - }; - } - { - pkg = import ./config/plugins/custom-sort { inherit pkgs; }; - options = { - suspended = false; - statusBarEntryEnabled = false; - notificationsEnabled = false; - customSortContextSubmenu = false; - bookmarksGroupToConsumeAsOrderingReference = "Sort"; - bookmarksContextMenus = false; - }; - } - { - pkg = import ./config/plugins/dataview { inherit pkgs; }; - options = { - enableDataviewJs = true; - enableInlineDataviewJs = true; - warnOnEmptyResult = false; - defaultDateFormat = "dd/MM/yyyy"; - defaultDateTimeFormat = "HH:mm - dd/MM/yyyy"; - }; - } - { - pkg = import ./config/plugins/excalidraw { inherit pkgs; }; - options = { - folder = "Inbox"; - templateFilePath = "Templates"; - scriptFolderPath = "Scripts"; - compress = false; - drawingFilenamePrefix = ""; - drawingEmbedPrefixWithFilename = false; - drawingFilenameDateTime = "YYYY-MM-DD-HH.mm.ss"; - previewImageType = "SVG"; - previewMatchObsidianTheme = true; - defaultPenMode = "mobile"; - parseTODO = true; - focusOnFileTab = true; - pngExportScale = 2; - exportWithTheme = false; - exportWithBackground = false; - exportEmbedScene = true; - showReleaseNotes = false; - showNewVersionNotification = false; - }; - } - { - pkg = import ./config/plugins/folder-note { inherit pkgs; }; - options = { - folderNoteHide = false; - folderNoteStrInit = ""; - }; - } - { - pkg = import ./config/plugins/kanban { inherit pkgs; }; - options = { - move-tags = true; - move-dates = true; - date-display-format = "DD/MM/YYYY"; - show-relative-date = true; - date-picker-week-start = 1; - inline-metadata-position = "footer"; - move-task-metadata = true; - show-archive-all = false; - show-board-settings = false; - }; - } - { - pkg = import ./config/plugins/languagetool { inherit pkgs; }; - options = { - shouldAutoCheck = true; - pickyMode = true; - staticLanguage = "auto"; - englishVariety = "en-US"; - }; - } - { - pkg = import ./config/plugins/linter { inherit pkgs; }; - options = { - lintOnSave = true; - displayChanged = false; - lintOnFileChange = true; - ruleConfigs = { - add-blank-line-after-yaml.enabled = true; - dedupe-yaml-array-values.enabled = true; - escape-yaml-special-characters = { - enabled = true; - try-to-escape-single-line-arrays = true; + communityPlugins = [ + { + pkg = import ./config/plugins/better-word-count { inherit pkgs; }; + options = { + statusBar = [ + { + suffix = " words"; + metric = { + type = 0; + counter = 0; }; - format-tags-in-yaml.enabled = true; - format-yaml-array = { - enabled = true; - default-array-style = "multi-line"; + } + ]; + altBar = [ + { + suffix = " files"; + metric = { + type = 2; + counter = 6; }; - sort-yaml-array-values.enabled = true; - yaml-key-sort = { - enabled = true; - yaml-sort-order-for-other-keys = "Ascending Alphabetical"; - }; - capitalize-headings = { - enabled = true; - ignore-words = ""; - }; - header-increment = { - enabled = true; - start-at-h2 = true; - }; - headings-start-line.enabled = true; - remove-trailing-punctuation-in-heading.enabled = true; - auto-correct-common-misspellings.enabled = true; - blockquote-style.enabled = true; - convert-bullet-list-markers.enabled = true; - emphasis-style = { - enabled = true; - style = "asterisk"; - }; - no-bare-urls = { - enabled = true; - no-bare-uris = true; - }; - ordered-list-style.enabled = true; - quote-style.enabled = true; - remove-consecutive-list-markers.enabled = true; - remove-empty-list-markers.enabled = true; - remove-hyphenated-line-breaks.enabled = true; - remove-multiple-spaces.enabled = true; - strong-style = { - enabled = true; - style = "asterisk"; - }; - two-spaces-between-lines-with-content.enabled = true; - unordered-list-style = { - enabled = true; - list-style = "-"; - }; - compact-yaml = { - enabled = true; - inner-new-lines = true; - }; - consecutive-blank-lines.enabled = true; - empty-line-around-blockquotes.enabled = true; - empty-line-around-code-fences.enabled = true; - empty-line-around-math-blocks.enabled = true; - empty-line-around-tables.enabled = true; - heading-blank-lines.enabled = true; - line-break-at-document-end.enabled = true; - move-math-block-indicators-to-their-own-line.enabled = true; - paragraph-blank-lines.enabled = true; - remove-empty-lines-between-list-markers-and-checklists.enabled = true; - remove-link-spacing.enabled = true; - space-after-list-markers.enabled = true; - trailing-spaces.enabled = true; - add-blockquote-indentation-on-paste.enabled = true; - prevent-double-checklist-indicator-on-paste.enabled = true; - prevent-double-list-item-indicator-on-paste.enabled = true; - remove-hyphens-on-paste.enabled = true; - remove-leading-or-trailing-whitespace-on-paste.enabled = true; - remove-leftover-footnotes-from-quote-on-paste.enabled = true; - remove-multiple-blank-lines-on-paste.enabled = true; + } + ]; + countComments = true; # Inverse + }; + } + { + pkg = import ./config/plugins/custom-sort { inherit pkgs; }; + options = { + suspended = false; + statusBarEntryEnabled = false; + notificationsEnabled = false; + customSortContextSubmenu = false; + bookmarksGroupToConsumeAsOrderingReference = "Sort"; + bookmarksContextMenus = false; + }; + } + { + pkg = import ./config/plugins/dataview { inherit pkgs; }; + options = { + enableDataviewJs = true; + enableInlineDataviewJs = true; + warnOnEmptyResult = false; + defaultDateFormat = "dd/MM/yyyy"; + defaultDateTimeFormat = "HH:mm - dd/MM/yyyy"; + }; + } + { + pkg = import ./config/plugins/excalidraw { inherit pkgs; }; + options = { + folder = "Inbox"; + templateFilePath = "Templates"; + scriptFolderPath = "Scripts"; + compress = false; + drawingFilenamePrefix = ""; + drawingEmbedPrefixWithFilename = false; + drawingFilenameDateTime = "YYYY-MM-DD-HH.mm.ss"; + previewImageType = "SVG"; + previewMatchObsidianTheme = true; + defaultPenMode = "mobile"; + parseTODO = true; + focusOnFileTab = true; + pngExportScale = 2; + exportWithTheme = false; + exportWithBackground = false; + exportEmbedScene = true; + showReleaseNotes = false; + showNewVersionNotification = false; + }; + } + { + pkg = import ./config/plugins/folder-note { inherit pkgs; }; + options = { + folderNoteHide = false; + folderNoteStrInit = ""; + }; + } + { + pkg = import ./config/plugins/kanban { inherit pkgs; }; + options = { + move-tags = true; + move-dates = true; + date-display-format = "DD/MM/YYYY"; + show-relative-date = true; + date-picker-week-start = 1; + inline-metadata-position = "footer"; + move-task-metadata = true; + show-archive-all = false; + show-board-settings = false; + }; + } + { + pkg = import ./config/plugins/languagetool { inherit pkgs; }; + options = { + shouldAutoCheck = true; + pickyMode = true; + staticLanguage = "auto"; + englishVariety = "en-US"; + }; + } + { + pkg = import ./config/plugins/linter { inherit pkgs; }; + options = { + lintOnSave = true; + displayChanged = false; + lintOnFileChange = true; + ruleConfigs = { + add-blank-line-after-yaml.enabled = true; + dedupe-yaml-array-values.enabled = true; + escape-yaml-special-characters = { + enabled = true; + try-to-escape-single-line-arrays = true; }; - customRegexes = [ + format-tags-in-yaml.enabled = true; + format-yaml-array = { + enabled = true; + default-array-style = "multi-line"; + }; + sort-yaml-array-values.enabled = true; + yaml-key-sort = { + enabled = true; + yaml-sort-order-for-other-keys = "Ascending Alphabetical"; + }; + capitalize-headings = { + enabled = true; + ignore-words = ""; + }; + header-increment = { + enabled = true; + start-at-h2 = true; + }; + headings-start-line.enabled = true; + remove-trailing-punctuation-in-heading.enabled = true; + auto-correct-common-misspellings.enabled = true; + blockquote-style.enabled = true; + convert-bullet-list-markers.enabled = true; + emphasis-style = { + enabled = true; + style = "asterisk"; + }; + no-bare-urls = { + enabled = true; + no-bare-uris = true; + }; + ordered-list-style.enabled = true; + quote-style.enabled = true; + remove-consecutive-list-markers.enabled = true; + remove-empty-list-markers.enabled = true; + remove-hyphenated-line-breaks.enabled = true; + remove-multiple-spaces.enabled = true; + strong-style = { + enabled = true; + style = "asterisk"; + }; + two-spaces-between-lines-with-content.enabled = true; + unordered-list-style = { + enabled = true; + list-style = "-"; + }; + compact-yaml = { + enabled = true; + inner-new-lines = true; + }; + consecutive-blank-lines.enabled = true; + empty-line-around-blockquotes.enabled = true; + empty-line-around-code-fences.enabled = true; + empty-line-around-math-blocks.enabled = true; + empty-line-around-tables.enabled = true; + heading-blank-lines.enabled = true; + line-break-at-document-end.enabled = true; + move-math-block-indicators-to-their-own-line.enabled = true; + paragraph-blank-lines.enabled = true; + remove-empty-lines-between-list-markers-and-checklists.enabled = true; + remove-link-spacing.enabled = true; + space-after-list-markers.enabled = true; + trailing-spaces.enabled = true; + add-blockquote-indentation-on-paste.enabled = true; + prevent-double-checklist-indicator-on-paste.enabled = true; + prevent-double-list-item-indicator-on-paste.enabled = true; + remove-hyphens-on-paste.enabled = true; + remove-leading-or-trailing-whitespace-on-paste.enabled = true; + remove-leftover-footnotes-from-quote-on-paste.enabled = true; + remove-multiple-blank-lines-on-paste.enabled = true; + }; + customRegexes = [ + { + label = "Open Double Quote"; + find = "“"; + replace = "\""; + flags = "gm"; + } + { + label = "Close Double Quote"; + find = "”"; + replace = "\""; + flags = "gm"; + } + { + label = "Elipsis"; + find = "…"; + replace = "..."; + flags = "gm"; + } + { + label = "Open Quote"; + find = "‘"; + replace = "'"; + flags = "gm"; + } + { + label = "Close Quote"; + find = "’"; + replace = "'"; + flags = "gm"; + } + { + label = "Long Dash"; + find = "—"; + replace = "---"; + flags = "gm"; + } + { + label = "Short Dash"; + find = "–"; + replace = "--"; + flags = "gm"; + } + { + label = "Long Dash with Text"; + find = "([^\\s])---([^\\s])"; + replace = "$1 --- $2"; + flags = "gm"; + } + { + label = "Short Dash with Text"; + find = "([^\\s])--([^\\s])"; + replace = "$1 -- $2"; + flags = "gm"; + } + ]; + commonStyles = { + removeUnnecessaryEscapeCharsForMultiLineArrays = true; + }; + }; + } + { + pkg = import ./config/plugins/map-view { inherit pkgs; }; + options = { + "markerIconRules" = [ + { + "ruleName" = "default"; + "preset" = true; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-circle"; + "markerColor" = "blue"; + }; + } + { + "ruleName" = "#restaurant"; + "preset" = false; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-utensils"; + "markerColor" = "red"; + }; + } + { + "ruleName" = "#bar"; + "preset" = false; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-martini-glass"; + "markerColor" = "purple"; + }; + } + { + "ruleName" = "#coffee"; + "preset" = false; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-mug-hot"; + "markerColor" = "purple"; + }; + } + { + "ruleName" = "#culture"; + "preset" = false; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-building-columns"; + "markerColor" = "black"; + }; + } + { + "ruleName" = "#shopping"; + "preset" = false; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-shopping-bag"; + "markerColor" = "yellow"; + }; + } + { + "ruleName" = "#entertainment"; + "preset" = false; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-microphone"; + "markerColor" = "pink"; + }; + } + { + "ruleName" = "#nature"; + "preset" = false; + "iconDetails" = { + "prefix" = "fas"; + "icon" = "fa-tree"; + "markerColor" = "green"; + }; + } + ]; + "searchProvider" = "google"; + "geocodingApiMethod" = "path"; + "geocodingApiPath" = hmConfig.sops.secrets."google/geocoding".path; + "useGooglePlaces" = true; + "letZoomBeyondMax" = true; + "showGeolinkPreview" = true; + "newNotePath" = "Inbox"; + }; + } + { + pkg = import ./config/plugins/minimal-settings { inherit pkgs; }; + options = { + editorFont = "var(--font-monospace)"; + }; + } + { + pkg = import ./config/plugins/outliner { inherit pkgs; }; + options = { + styleLists = false; + stickCursor = "never"; + }; + } + { + pkg = import ./config/plugins/read-it-later { inherit pkgs; }; + options = { + inboxDir = "Inbox"; + assetsDir = "Inbox/assets"; + openNewNote = true; + youtubeNote = '' + --- + source: %videoURL% + --- + + %videoPlayer% + ''; + vimeoNote = '' + --- + source: %videoURL% + --- + + %videoPlayer% + ''; + bilibiliNote = '' + --- + source: %videoURL% + --- + + %videoPlayer% + ''; + twitterNote = '' + --- + source: %tweetURL% + --- + + %tweetContent% + ''; + parsableArticleNote = '' + --- + source: %articleURL% + --- + + %articleContent% + ''; + mastodonNote = '' + --- + source: %tootURL% + --- + + > %tootContent% + ''; + stackExchangeNote = '' + --- + source: %questionURL% + --- + + Author: [%authorName%](%authorProfileURL%) + + %questionContent% + + *** + + %topAnswer% + + %answers% + ''; + stackExchangeAnswer = '' + Answered by: [%authorName%](%authorProfileURL%) + + > %answerContent% + ''; + tikTokNote = '' + --- + source: %videoURL% + --- + + %videoDescription% + + %videoPlayer% + ''; + notParsableArticleNote = '' + --- + source: %articleURL% + --- + + %previewURL% + ''; + textSnippetNote = "%content%"; + }; + } + (import ./config/plugins/style-settings { inherit pkgs; }) + { + pkg = import ./config/plugins/tasks { inherit pkgs; }; + options = { + globalQuery = "short mode"; + globalFilter = "#todo"; + removeGlobalFilter = true; + setCreatedDate = true; + statusSettings = { + coreStatuses = [ { - label = "Open Double Quote"; - find = "“"; - replace = "\""; - flags = "gm"; + symbol = " "; + name = "to-do"; + nextStatusSymbol = "/"; + type = "TODO"; } { - label = "Close Double Quote"; - find = "”"; - replace = "\""; - flags = "gm"; - } - { - label = "Elipsis"; - find = "…"; - replace = "..."; - flags = "gm"; - } - { - label = "Open Quote"; - find = "‘"; - replace = "'"; - flags = "gm"; - } - { - label = "Close Quote"; - find = "’"; - replace = "'"; - flags = "gm"; - } - { - label = "Long Dash"; - find = "—"; - replace = "---"; - flags = "gm"; - } - { - label = "Short Dash"; - find = "–"; - replace = "--"; - flags = "gm"; - } - { - label = "Long Dash with Text"; - find = "([^\\s])---([^\\s])"; - replace = "$1 --- $2"; - flags = "gm"; - } - { - label = "Short Dash with Text"; - find = "([^\\s])--([^\\s])"; - replace = "$1 -- $2"; - flags = "gm"; + symbol = "x"; + name = "done"; + nextStatusSymbol = " "; + type = "DONE"; } ]; - commonStyles = { - removeUnnecessaryEscapeCharsForMultiLineArrays = true; - }; - }; - } - { - pkg = import ./config/plugins/map-view { inherit pkgs; }; - options = { - "markerIconRules" = [ + customStatuses = [ { - "ruleName" = "default"; - "preset" = true; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-circle"; - "markerColor" = "blue"; - }; + symbol = "/"; + name = "in-progress"; + nextStatusSymbol = "x"; + type = "IN_PROGRESS"; } { - "ruleName" = "#restaurant"; - "preset" = false; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-utensils"; - "markerColor" = "red"; - }; + symbol = "-"; + name = "canceled"; + nextStatusSymbol = " "; + type = "CANCELLED"; } { - "ruleName" = "#bar"; - "preset" = false; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-martini-glass"; - "markerColor" = "purple"; - }; + symbol = ">"; + name = "forwarded"; + nextStatusSymbol = "/"; + type = "IN_PROGRESS"; } { - "ruleName" = "#coffee"; - "preset" = false; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-mug-hot"; - "markerColor" = "purple"; - }; + symbol = "<"; + name = "scheduling"; + nextStatusSymbol = "/"; + type = "TODO"; } { - "ruleName" = "#culture"; - "preset" = false; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-building-columns"; - "markerColor" = "black"; - }; + symbol = "?"; + name = "question"; + nextStatusSymbol = " "; + type = "TODO"; } { - "ruleName" = "#shopping"; - "preset" = false; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-shopping-bag"; - "markerColor" = "yellow"; - }; + symbol = "!"; + name = "important"; + nextStatusSymbol = " "; + type = "TODO"; } { - "ruleName" = "#entertainment"; - "preset" = false; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-microphone"; - "markerColor" = "pink"; - }; + symbol = "*"; + name = "star"; + nextStatusSymbol = " "; + type = "TODO"; } { - "ruleName" = "#nature"; - "preset" = false; - "iconDetails" = { - "prefix" = "fas"; - "icon" = "fa-tree"; - "markerColor" = "green"; - }; + symbol = "\""; + name = "quote"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "l"; + name = "location"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "b"; + name = "bookmark"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "i"; + name = "information"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "S"; + name = "savings"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "I"; + name = "idea"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "p"; + name = "pros"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "c"; + name = "cons"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "f"; + name = "fire"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "k"; + name = "key"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "w"; + name = "win"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "u"; + name = "up"; + nextStatusSymbol = " "; + type = "TODO"; + } + { + symbol = "d"; + name = "down"; + nextStatusSymbol = " "; + type = "TODO"; } ]; - "searchProvider" = "google"; - "geocodingApiMethod" = "path"; - "geocodingApiPath" = hmConfig.sops.secrets."google/geocoding".path; - "useGooglePlaces" = true; - "letZoomBeyondMax" = true; - "showGeolinkPreview" = true; - "newNotePath" = "Inbox"; }; - } + }; + } + { + pkg = import ./config/plugins/url-into-selection { inherit pkgs; }; + options = { + nothingSelected = 2; + }; + } + ]; + + cssSnippets = [ ./config/snippets/file-explorer-separators.css ]; + + themes = [ (import ./config/themes/minimal { inherit pkgs; }) ]; + + hotkeys = { + "command-palette:open" = [ { key = "F1"; } ]; + "app:open-help" = [ ]; + "editor:swap-line-down" = [ { - pkg = import ./config/plugins/minimal-settings { inherit pkgs; }; - options = { - editorFont = "var(--font-monospace)"; - }; - } - { - pkg = import ./config/plugins/outliner { inherit pkgs; }; - options = { - styleLists = false; - stickCursor = "never"; - }; - } - { - pkg = import ./config/plugins/read-it-later { inherit pkgs; }; - options = { - inboxDir = "Inbox"; - assetsDir = "Inbox/assets"; - openNewNote = true; - youtubeNote = '' - --- - source: %videoURL% - --- - - %videoPlayer% - ''; - vimeoNote = '' - --- - source: %videoURL% - --- - - %videoPlayer% - ''; - bilibiliNote = '' - --- - source: %videoURL% - --- - - %videoPlayer% - ''; - twitterNote = '' - --- - source: %tweetURL% - --- - - %tweetContent% - ''; - parsableArticleNote = '' - --- - source: %articleURL% - --- - - %articleContent% - ''; - mastodonNote = '' - --- - source: %tootURL% - --- - - > %tootContent% - ''; - stackExchangeNote = '' - --- - source: %questionURL% - --- - - Author: [%authorName%](%authorProfileURL%) - - %questionContent% - - *** - - %topAnswer% - - %answers% - ''; - stackExchangeAnswer = '' - Answered by: [%authorName%](%authorProfileURL%) - - > %answerContent% - ''; - tikTokNote = '' - --- - source: %videoURL% - --- - - %videoDescription% - - %videoPlayer% - ''; - notParsableArticleNote = '' - --- - source: %articleURL% - --- - - %previewURL% - ''; - textSnippetNote = "%content%"; - }; - } - (import ./config/plugins/style-settings { inherit pkgs; }) - { - pkg = import ./config/plugins/tasks { inherit pkgs; }; - options = { - globalQuery = "short mode"; - globalFilter = "#todo"; - removeGlobalFilter = true; - setCreatedDate = true; - statusSettings = { - coreStatuses = [ - { - symbol = " "; - name = "to-do"; - nextStatusSymbol = "/"; - type = "TODO"; - } - { - symbol = "x"; - name = "done"; - nextStatusSymbol = " "; - type = "DONE"; - } - ]; - customStatuses = [ - { - symbol = "/"; - name = "in-progress"; - nextStatusSymbol = "x"; - type = "IN_PROGRESS"; - } - { - symbol = "-"; - name = "canceled"; - nextStatusSymbol = " "; - type = "CANCELLED"; - } - { - symbol = ">"; - name = "forwarded"; - nextStatusSymbol = "/"; - type = "IN_PROGRESS"; - } - { - symbol = "<"; - name = "scheduling"; - nextStatusSymbol = "/"; - type = "TODO"; - } - { - symbol = "?"; - name = "question"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "!"; - name = "important"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "*"; - name = "star"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "\""; - name = "quote"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "l"; - name = "location"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "b"; - name = "bookmark"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "i"; - name = "information"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "S"; - name = "savings"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "I"; - name = "idea"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "p"; - name = "pros"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "c"; - name = "cons"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "f"; - name = "fire"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "k"; - name = "key"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "w"; - name = "win"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "u"; - name = "up"; - nextStatusSymbol = " "; - type = "TODO"; - } - { - symbol = "d"; - name = "down"; - nextStatusSymbol = " "; - type = "TODO"; - } - ]; - }; - }; - } - { - pkg = import ./config/plugins/url-into-selection { inherit pkgs; }; - options = { - nothingSelected = 2; - }; + modifiers = [ "Alt" ]; + key = "ArrowDown"; } ]; - - cssSnippets = [ ./config/snippets/file-explorer-separators.css ]; - - themes = [ (import ./config/themes/minimal { inherit pkgs; }) ]; - - hotkeys = { - "command-palette:open" = [ { key = "F1"; } ]; - "app:open-help" = [ ]; - "editor:swap-line-down" = [ - { - modifiers = [ "Alt" ]; - key = "ArrowDown"; - } - ]; - "editor:swap-line-up" = [ - { - modifiers = [ "Alt" ]; - key = "ArrowUp"; - } - ]; - "editor:fold-all" = [ - { - modifiers = [ - "Alt" - "Mod" - ]; - key = "T"; - } - ]; - "editor:add-cursor-above" = [ - { - modifiers = [ - "Mod" - "Shift" - ]; - key = "ArrowUp"; - } - ]; - "editor:add-cursor-below" = [ - { - modifiers = [ - "Mod" - "Shift" - ]; - key = "ArrowDown"; - } - ]; - "obsidian-outliner:move-list-item-up" = [ ]; - "obsidian-outliner:move-list-item-down" = [ ]; - }; + "editor:swap-line-up" = [ + { + modifiers = [ "Alt" ]; + key = "ArrowUp"; + } + ]; + "editor:fold-all" = [ + { + modifiers = [ + "Alt" + "Mod" + ]; + key = "T"; + } + ]; + "editor:add-cursor-above" = [ + { + modifiers = [ + "Mod" + "Shift" + ]; + key = "ArrowUp"; + } + ]; + "editor:add-cursor-below" = [ + { + modifiers = [ + "Mod" + "Shift" + ]; + key = "ArrowDown"; + } + ]; + "obsidian-outliner:move-list-item-up" = [ ]; + "obsidian-outliner:move-list-item-down" = [ ]; }; }; - - matugen.settings.templates = builtins.mapAttrs (name: _: { - input_path = ./theme.json; - output_path = "${userConfig.home}/${name}/.obsidian/plugins/obsidian-style-settings/data.json"; - }) hmConfig.programs.obsidian.vaults; }; + theme.templates = lib.attrsets.mapAttrs' ( + _: vault: + lib.attrsets.nameValuePair "${vault.target}/.obsidian/plugins/obsidian-style-settings/data.json" { + source = ./theme.json; + } + ) hmConfig.programs.obsidian.vaults; + sops.secrets."google/geocoding" = { }; - wayland.windowManager.hyprland.settings.bind = [ - "$mod, o, exec, ${pkgs.obsidian}/bin/obsidian" - ]; + wayland.windowManager.hyprland.settings.bind = [ "$mod, o, exec, ${pkgs.obsidian}/bin/obsidian" ]; home.persistence."/cache${userConfig.home}".directories = [ ".config/obsidian" ]; }; diff --git a/hosts/common/user/configs/gui/qt/default.nix b/hosts/common/user/configs/gui/qt/default.nix index 6071cfe..8b57987 100644 --- a/hosts/common/user/configs/gui/qt/default.nix +++ b/hosts/common/user/configs/gui/qt/default.nix @@ -26,17 +26,11 @@ in QT_QPA_PLATFORMTHEME = "qt5ct"; }; - programs.matugen.settings.templates = { + theme.templates = { # https://github.com/GabePoel/KvLibadwaita/blob/main/src/KvLibadwaita/KvLibadwaita.kvconfig - kvantumConfig = { - input_path = ./KvAdwQt/KvAdwQt.kvconfig; - output_path = "${hmConfig.xdg.configHome}/Kvantum/KvAdwQt/KvAdwQt.kvconfig"; - }; + "${hmConfig.xdg.configHome}/Kvantum/KvAdwQt/KvAdwQt.kvconfig".source = ./KvAdwQt/KvAdwQt.kvconfig; # https://github.com/GabePoel/KvLibadwaita/blob/main/src/KvLibadwaita/KvLibadwaita.svg - kvantumSvg = { - input_path = ./KvAdwQt/KvAdwQt.svg; - output_path = "${hmConfig.xdg.configHome}/Kvantum/KvAdwQt/KvAdwQt.svg"; - }; + "${hmConfig.xdg.configHome}/Kvantum/KvAdwQt/KvAdwQt.svg".source = ./KvAdwQt/KvAdwQt.svg; }; xdg.configFile = diff --git a/hosts/common/user/configs/gui/theme/default.nix b/hosts/common/user/configs/gui/theme/default.nix index 8b07d54..2627bc2 100644 --- a/hosts/common/user/configs/gui/theme/default.nix +++ b/hosts/common/user/configs/gui/theme/default.nix @@ -24,13 +24,8 @@ in "Ctrl_Alt, t, exec, ${themeBin} toggle" ]; - home = { - activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ - "writeBoundary" - ] "run ${themeBin}"; - persistence."/persist${userConfig.home}".directories = [ - "${hmConfig.xdg.relativeConfigHome}/theme" - ]; - }; + home.persistence."/persist${userConfig.home}".directories = [ + "${hmConfig.xdg.relativeConfigHome}/theme" + ]; }; } diff --git a/hosts/common/user/configs/gui/theme/options.nix b/hosts/common/user/configs/gui/theme/options.nix index a8be09a..ee71f77 100644 --- a/hosts/common/user/configs/gui/theme/options.nix +++ b/hosts/common/user/configs/gui/theme/options.nix @@ -1,12 +1,33 @@ { config, + inputs, lib, pkgs, ... }: let cfg = config.theme; - init = pkgs.writeShellApplication { + + activation = pkgs.writeShellApplication { + name = "theme-init"; + runtimeInputs = with pkgs; [ matugen ]; + bashOptions = [ + "nounset" + "pipefail" + ]; + text = '' + matugen image "${cfg.configDir}/wallpaper" \ + --type scheme-${cfg.flavour} \ + --mode "$(cat "${cfg.configDir}/mode")" \ + --contrast ${builtins.toString cfg.contrast} + + [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && exit 0 + + ${cfg.extraConfig} + ''; + }; + + theme = pkgs.writeShellApplication { name = "theme"; runtimeInputs = with pkgs; [ coreutils ]; bashOptions = [ @@ -17,7 +38,7 @@ let CONFIG = cfg.configDir; DEFAULT_WALLPAPER = cfg.wallpaper; DEFAULT_MODE = cfg.mode; - SWITCH = lib.meta.getExe (pkgs.writeShellScriptBin "themeExtraConfig" cfg.extraConfig); + ACTIVATION = lib.meta.getExe activation; }; text = builtins.readFile ./theme.sh; }; @@ -43,7 +64,7 @@ in pkg = mkOption { type = package; - default = init; + default = theme; readOnly = true; description = "The package containing the `theme` script"; }; @@ -51,7 +72,40 @@ in extraConfig = mkOption { type = lines; default = ""; - description = "Extra configuration lines to add to the theme script."; + description = "Extra configuration lines to add to the theme reload script."; + }; + + templates = mkOption { + type = attrsOf ( + submodule ( + { name, config, ... }: + { + options = { + source = mkOption { + type = nullOr path; + description = "Path of the source file or directory."; + default = null; + }; + + text = mkOption { + type = nullOr str; + description = "Text of the file."; + default = null; + }; + + target = mkOption { + type = str; + defaultText = literalExpression "name"; + description = "Path to target relative to the user's {env}`HOME`."; + }; + }; + + config.target = mkDefault name; + } + ) + ); + default = { }; + description = "Templates to fill with theme colors."; }; flavour = mkOption { @@ -112,7 +166,7 @@ in semantic = { blend = mkOption { type = bool; - default = false; + default = true; description = "Blend the colors."; }; @@ -364,8 +418,16 @@ in config = lib.mkIf cfg.enable { home = { + activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ + "writeBoundary" + ] "run ${lib.meta.getExe activation}"; + packages = - [ cfg.pkg ] + with pkgs; + [ + matugen + theme + ] ++ cfg.font.sansSerif.packages ++ cfg.font.serif.packages ++ cfg.font.monospace.packages @@ -389,5 +451,75 @@ in emoji = cfg.font.emoji.names; }; }; + + xdg.configFile."matugen/config.toml".source = ( + (pkgs.formats.toml { }).generate "matugen" { + config = { + custom_colors = + let + mkColor = category: color: { + color = cfg.color.${category}.${color}; + blend = cfg.color.${category}.blend; + }; + in + { + danger = mkColor "semantic" "danger"; + warning = mkColor "semantic" "warning"; + success = mkColor "semantic" "success"; + info = mkColor "semantic" "info"; + + red = mkColor "basic" "red"; + orange = mkColor "basic" "orange"; + yellow = mkColor "basic" "yellow"; + green = mkColor "basic" "green"; + cyan = mkColor "basic" "cyan"; + blue = mkColor "basic" "blue"; + magenta = mkColor "basic" "magenta"; + pink = mkColor "basic" "pink"; + + keywords = mkColor "syntax" "keywords"; + functions = mkColor "syntax" "functions"; + properties = mkColor "syntax" "properties"; + constants = mkColor "syntax" "constants"; + strings = mkColor "syntax" "strings"; + numbers = mkColor "syntax" "numbers"; + structures = mkColor "syntax" "structures"; + types = mkColor "syntax" "types"; + }; + + custom_keywords = + let + zeroPad = hex: if builtins.stringLength hex == 1 then "0${hex}" else hex; + percentageToHex = percentage: zeroPad (lib.trivial.toHexString (builtins.floor (percentage * 255))); + in + { + flavour = cfg.flavour; + contrast = builtins.toString cfg.contrast; + radius = builtins.toString cfg.radius; + padding = builtins.toString cfg.padding; + padding_double = builtins.toString (cfg.padding * 2); + blur = builtins.toString cfg.blur; + opacity = builtins.toString cfg.opacity; + opacity_hex = builtins.toString (percentageToHex cfg.opacity); + opacity_shadow = builtins.toString (cfg.opacity * 0.75); + opacity_shadow_hex = builtins.toString (percentageToHex (cfg.opacity * 0.75)); + font_size = builtins.toString cfg.font.size; + font_sans_serif = builtins.head cfg.font.sansSerif.names; + font_sans_serif_all = builtins.concatStringsSep ", " cfg.font.sansSerif.names; + font_serif = builtins.head cfg.font.serif.names; + font_serif_all = builtins.concatStringsSep ", " cfg.font.serif.names; + font_monospace = builtins.head cfg.font.monospace.names; + font_monospace_all = builtins.concatStringsSep ", " cfg.font.monospace.names; + font_emoji = builtins.head cfg.font.emoji.names; + font_emoji_all = builtins.concatStringsSep ", " cfg.font.emoji.names; + }; + }; + + templates = builtins.mapAttrs (name: template: { + input_path = template.source or (pkgs.writeText name template.text); + output_path = template.target; + }) cfg.templates; + } + ); }; } diff --git a/hosts/common/user/configs/gui/theme/theme.sh b/hosts/common/user/configs/gui/theme/theme.sh index 81ecd3c..cc67dd4 100644 --- a/hosts/common/user/configs/gui/theme/theme.sh +++ b/hosts/common/user/configs/gui/theme/theme.sh @@ -1,6 +1,9 @@ [ ! -L "$CONFIG"/wallpaper ] && ln -sf "$DEFAULT_WALLPAPER" "$CONFIG"/wallpaper [ ! -f "$CONFIG"/mode ] && echo "$DEFAULT_MODE" > "$CONFIG"/mode +WALLPAPER="" +MODE="" + set_wallpaper() { if [ -f "$1" ]; then WALLPAPER="$1" @@ -35,14 +38,9 @@ finish() { [ -n "$WALLPAPER" ] && ln -sf "$WALLPAPER" "$CONFIG"/wallpaper [ -n "$MODE" ] && echo "$MODE" > "$CONFIG"/mode - { - "$SWITCH" - } > /dev/null + "$ACTIVATION" > /dev/null } -WALLPAPER="" -MODE="" - if [ $# -eq 0 ]; then finish else diff --git a/hosts/eirene/nick.nix b/hosts/eirene/nick.nix index fc20de6..feda5b4 100644 --- a/hosts/eirene/nick.nix +++ b/hosts/eirene/nick.nix @@ -36,7 +36,6 @@ in (import ../common/user/configs/gui/hyprland { inherit username; }) (import ../common/user/configs/gui/hyprshot { inherit username; }) (import ../common/user/configs/gui/kitty { inherit username; }) - (import ../common/user/configs/gui/matugen { inherit username; }) (import ../common/user/configs/gui/networking { inherit username; }) (import ../common/user/configs/gui/obsidian { inherit username; }) (import ../common/user/configs/gui/pipewire { inherit username; })