From 161486b887f9b167ddec8fb0f3c08e7f79ee3f5a Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 11 Aug 2024 21:01:34 +0200 Subject: [PATCH] fix fonts and oh-my-posh --- components/gui/default.nix | 1 - components/gui/fonts.nix | 36 ------- components/terminal/default.nix | 1 - components/terminal/oh-my-posh/default.nix | 26 ----- flake.nix | 11 +-- homes/common/default.nix | 1 + homes/common/oh-my-posh/default.nix | 10 ++ homes/common/oh-my-posh/gmay.json | 96 +++++++++++++++++++ .../common}/oh-my-posh/gruvbox.json | 0 homes/palo/i3.nix | 4 +- 10 files changed, 112 insertions(+), 74 deletions(-) delete mode 100644 components/gui/fonts.nix delete mode 100644 components/terminal/oh-my-posh/default.nix create mode 100644 homes/common/oh-my-posh/default.nix create mode 100644 homes/common/oh-my-posh/gmay.json rename {components/terminal => homes/common}/oh-my-posh/gruvbox.json (100%) diff --git a/components/gui/default.nix b/components/gui/default.nix index abfdbc7..5484130 100644 --- a/components/gui/default.nix +++ b/components/gui/default.nix @@ -10,7 +10,6 @@ with lib; ./audio.nix ./browser.nix ./cups.nix - ./fonts.nix ./home-manager ./kmonad.nix #./noti.nix # todo: make this different (use password store and such) diff --git a/components/gui/fonts.nix b/components/gui/fonts.nix deleted file mode 100644 index 0f48789..0000000 --- a/components/gui/fonts.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, config, lib, ... }: -with lib; -{ - options.components.gui.style.enable = mkOption { - type = lib.types.bool; - default = config.components.gui.enable; - }; - - config = mkIf (config.components.gui.style.enable) { - - fonts.packages = with pkgs; [ - - corefonts - hasklig - inconsolata - source-code-pro - symbola - ubuntu_font_family - - # symbol fonts - # ------------ - #nerdfonts - #powerline-fonts - #font-awesome - #fira-code-symbols - #jetbrains-mono - - # shell font - # ---------- - #terminus_font - #gohufont - - ]; - - }; -} diff --git a/components/terminal/default.nix b/components/terminal/default.nix index edef90c..11dd4be 100644 --- a/components/terminal/default.nix +++ b/components/terminal/default.nix @@ -13,7 +13,6 @@ with lib; ./git.nix ./heygpt.nix ./hoard.nix - ./oh-my-posh ./remote-install.nix ./wtf.nix ./zsh.nix diff --git a/components/terminal/oh-my-posh/default.nix b/components/terminal/oh-my-posh/default.nix deleted file mode 100644 index ac4ba9a..0000000 --- a/components/terminal/oh-my-posh/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, config, lib, ... }: -with lib; -{ - options.components.terminal.oh-my-posh.enable = mkOption { - type = lib.types.bool; - default = config.components.terminal.enable; - }; - - config = mkIf (config.components.terminal.oh-my-posh.enable) { - - home-manager.users = - let - poshConfig = { - programs.oh-my-posh = { - enable = true; - # useTheme = "gruvbox"; - settings = builtins.fromJSON (builtins.readFile ./gruvbox.json); - }; - }; - in - { - mainUser = poshConfig; - root = poshConfig; - }; - }; -} diff --git a/flake.nix b/flake.nix index 6e59d02..ecc494f 100644 --- a/flake.nix +++ b/flake.nix @@ -309,15 +309,15 @@ stylix.image = ./assets/wallpaper.png; stylix.fonts = { serif = { - package = pkgs.ubuntu_font_family; + package = pkgs.nerdfonts.override { fonts = [ "Ubuntu" ]; }; name = "Ubuntu"; }; sansSerif = { - package = pkgs.ubuntu_font_family; + package = pkgs.nerdfonts.override { fonts = [ "Ubuntu" ]; }; name = "Ubuntu"; }; monospace = { - package = pkgs.jetbrains-mono; + package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }; name = "JetBrains Mono"; }; emoji = { @@ -326,11 +326,6 @@ }; sizes.popups = 15; }; - # todo: remove this if not needed anymore - #home-manager.sharedModules = [ - # { stylix.targets.bemenu.enable = false; } - #]; - }; homeManagerModules = { pkgs, config, ... }: { diff --git a/homes/common/default.nix b/homes/common/default.nix index bda4196..4db163f 100644 --- a/homes/common/default.nix +++ b/homes/common/default.nix @@ -1,6 +1,7 @@ { lib, ... }: { imports = [ + ./oh-my-posh ./packages.nix ./terminal.nix ./zfs.nix diff --git a/homes/common/oh-my-posh/default.nix b/homes/common/oh-my-posh/default.nix new file mode 100644 index 0000000..8875429 --- /dev/null +++ b/homes/common/oh-my-posh/default.nix @@ -0,0 +1,10 @@ +{ pkgs, config, lib, ... }: +with lib; +{ + programs.oh-my-posh = { + enable = true; + # https://ohmyposh.dev/docs/themes + #useTheme = "gmay"; # ganz nice, aber farben sind ein bisl schrill + settings = builtins.fromJSON (builtins.readFile ./gmay.json); + }; +} diff --git a/homes/common/oh-my-posh/gmay.json b/homes/common/oh-my-posh/gmay.json new file mode 100644 index 0000000..7318d9f --- /dev/null +++ b/homes/common/oh-my-posh/gmay.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + "blocks": [ + { + "alignment": "left", + "segments": [ + { + "background": "#076678", + "foreground": "#EBDBB2", + "leading_diamond": "\ue0b6", + "style": "diamond", + "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}} ", + "type": "os" + }, + { + "background": "#076678", + "foreground": "#EBDBB2", + "style": "powerline", + "template": " {{ .UserName }}@{{ .HostName }} ", + "type": "session" + }, + { + "background": "#B57614", + "foreground": "#EBDBB2", + "powerline_symbol": "\ue0b0", + "properties": { + "style": "full" + }, + "style": "powerline", + "template": " \ue5ff {{ .Path }} ", + "type": "path" + }, + { + "background": "#79740E", + "foreground": "#EBDBB2", + "powerline_symbol": "\ue0b0", + "properties": { + "time_format": "2006-01-02 15:04:05" + }, + "style": "powerline", + "template": " {{ .CurrentDate | date .Format }} ", + "type": "time" + }, + { + "background": "#8F3F71", + "foreground": "#EBDBB2", + "powerline_symbol": "\ue0b0", + "properties": { + "fetch_stash_count": true, + "fetch_upstream_icon": true + }, + "style": "powerline", + "template": " {{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ", + "type": "git" + }, + { + "background": "#9D0006", + "foreground": "#EBDBB2", + "powerline_symbol": "\ue0b0", + "style": "powerline", + "template": " \uf0e7 ", + "type": "root" + }, + { + "background": "#427B58", + "background_templates": ["{{ if gt .Code 0 }}#9D0006{{ end }}"], + "foreground": "#EBDBB2", + "leading_diamond": "\ue0b0", + "properties": { + "always_enabled": true + }, + "style": "diamond", + "template": " \ueb05 ", + "trailing_diamond": "\ue0b4", + "type": "status" + } + ], + "type": "prompt" + }, + { + "alignment": "left", + "newline": true, + "segments": [ + { + "foreground": "#076678", + "style": "plain", + "template": "\uf0a9 ", + "type": "text" + } + ], + "type": "prompt" + } + ], + "final_space": true, + "version": 2 +} diff --git a/components/terminal/oh-my-posh/gruvbox.json b/homes/common/oh-my-posh/gruvbox.json similarity index 100% rename from components/terminal/oh-my-posh/gruvbox.json rename to homes/common/oh-my-posh/gruvbox.json diff --git a/homes/palo/i3.nix b/homes/palo/i3.nix index 556cf37..d33675c 100644 --- a/homes/palo/i3.nix +++ b/homes/palo/i3.nix @@ -49,8 +49,8 @@ in enable = true; bars = { my = { - icons = "awesome5"; - theme = "gruvbox-light"; + icons = "material-nf"; # nerd fonts (influenced by stylix.font settings) + theme = "gruvbox-light"; # not configured by stylix yet. # https://github.com/greshake/i3status-rust/blob/v0.22.0/doc/blocks.md blocks = [ {