diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-03-02 20:30:02 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-03-02 20:30:02 +0300 |
commit | 482bcef47a3b7ee63553c58d200065857ec42b1c (patch) | |
tree | face7032b62c8957df4a84b2fc0c4adc47020f9e | |
parent | 2024-03-01 (diff) |
2024-03-02
35 files changed, 518 insertions, 755 deletions
diff --git a/flake.lock b/flake.lock index be9589c..e02085f 100644 --- a/flake.lock +++ b/flake.lock @@ -101,6 +101,153 @@ "url": "https://git.azahi.cc/azahi-cc" } }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "665b3c6748534eb766c777298721cece9453fdae", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-alacritty": { + "flake": false, + "locked": { + "lastModified": 1703982197, + "narHash": "sha256-TNxKbwdiUXGi4Z4chT72l3mt3GSvOcz6NZsUH8bQU/k=", + "owner": "aarowill", + "repo": "base16-alacritty", + "rev": "c95c200b3af739708455a03b5d185d3d2d263c6e", + "type": "github" + }, + "original": { + "owner": "aarowill", + "repo": "base16-alacritty", + "type": "github" + } + }, + "base16-alacritty-yaml": { + "flake": false, + "locked": { + "lastModified": 1674275109, + "narHash": "sha256-Adwx9yP70I6mJrjjODOgZJjt4OPPe8gJu7UuBboXO4M=", + "owner": "aarowill", + "repo": "base16-alacritty", + "rev": "63d8ae5dfefe5db825dd4c699d0cdc2fc2c3eaf7", + "type": "github" + }, + "original": { + "owner": "aarowill", + "repo": "base16-alacritty", + "rev": "63d8ae5dfefe5db825dd4c699d0cdc2fc2c3eaf7", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-foot": { + "flake": false, + "locked": { + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "base16-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-foot", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1696727917, + "narHash": "sha256-FVrbPk+NtMra0jtlC5oxyNchbm8FosmvXIatkRbYy1g=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "dbe1480d99fe80f08df7970e471fac24c05f2ddb", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-kitty": { + "flake": false, + "locked": { + "lastModified": 1665001328, + "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", + "owner": "kdrag0n", + "repo": "base16-kitty", + "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", + "type": "github" + }, + "original": { + "owner": "kdrag0n", + "repo": "base16-kitty", + "type": "github" + } + }, + "base16-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "base16-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-tmux", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1663659192, + "narHash": "sha256-uJvaYYDMXvoo0fhBZUhN8WBXeJ87SRgof6GEK2efFT0=", + "owner": "chriskempson", + "repo": "base16-vim", + "rev": "3be3cd82cd31acfcab9a41bad853d9c68d30478d", + "type": "github" + }, + "original": { + "owner": "chriskempson", + "repo": "base16-vim", + "type": "github" + } + }, "blobs": { "flake": false, "locked": { @@ -212,6 +359,22 @@ "type": "github" } }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -233,6 +396,23 @@ "type": "github" } }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1698794309, + "narHash": "sha256-/TIkZ8y5Wv3QHLFp79Poao9fINurKs5pa4z0CRe+F8s=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "a7c169c6c29cf02a4c392fa0acbbc5f5072823e7", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "45.1", + "repo": "gnome-shell", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -498,11 +678,48 @@ "nmap-vulners": "nmap-vulners", "nmap-vulscan": "nmap-vulscan", "pre-commit": "pre-commit", + "stylix": "stylix", "systems": "systems", "vscode-extensions": "vscode-extensions", "xmonad-ng": "xmonad-ng" } }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-alacritty": "base16-alacritty", + "base16-alacritty-yaml": "base16-alacritty-yaml", + "base16-fish": "base16-fish", + "base16-foot": "base16-foot", + "base16-helix": "base16-helix", + "base16-kitty": "base16-kitty", + "base16-tmux": "base16-tmux", + "base16-vim": "base16-vim", + "flake-compat": [ + "flake-compat" + ], + "gnome-shell": "gnome-shell", + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708896938, + "narHash": "sha256-oMjkMjeNhDUEpKIofo9+9RdUnmmZ4h0sm+kf6XKdy6k=", + "owner": "danth", + "repo": "stylix", + "rev": "fcff15ac5ffbe81f1c66e352f3167c270d79cdab", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 6500a87..b40e1a0 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,15 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + stylix = { + url = "github:danth/stylix"; + inputs = { + flake-compat.follows = "flake-compat"; + home-manager.follows = "home-manager"; + nixpkgs.follows = "nixpkgs"; + }; + }; + impermanence.url = "github:nix-community/impermanence"; agenix = { diff --git a/modules/common/alacritty.nix b/modules/common/alacritty.nix index be3af21..892516b 100644 --- a/modules/common/alacritty.nix +++ b/modules/common/alacritty.nix @@ -12,104 +12,16 @@ in { config = mkIf cfg.enable { hm.programs.alacritty = { enable = true; - settings = with config.nixfiles.modules; { + settings = { window = { - padding = with config.fontScheme.monospaceFont; { - x = size; - y = size; + padding = with config.stylix.fonts.sizes; { + x = terminal; + y = terminal; }; dynamic_padding = false; decorations = "Full"; startup_mode = "Maximized"; }; - font = with config.fontScheme.monospaceFont; { - normal = { - inherit family; - style = "Regular"; - }; - bold = { - inherit family; - style = "Bold"; - }; - italic = { - inherit family; - style = "Italic"; - }; - bold_italic = { - inherit family; - style = "Bold Italic"; - }; - inherit size; - }; - colors = with config.colourScheme; { - primary = { - inherit background foreground; - dim_foreground = "None"; - bright_foreground = "None"; - }; - cursor = { - text = "CellBackground"; - cursor = "CellForeground"; - }; - vi_mode_cursor = { - text = "CellBackground"; - cursor = "CellForeground"; - }; - search = { - matches = { - foreground = white; - background = red; - }; - focused_match = { - foreground = red; - background = black; - }; - }; - hints = { - start = { - foreground = black; - background = yellow; - }; - end = { - foreground = yellow; - background = black; - }; - }; - line_indicator = { - foreground = "None"; - background = "None"; - }; - footer_bar = { - foreground = black; - background = white; - }; - selection = { - text = "CellBackground"; - background = "CellForeground"; - }; - normal = { - inherit - black - red - green - yellow - blue - magenta - cyan - white - ; - }; - bright = { - black = brightBlack; - red = brightRed; - green = brightGreen; - yellow = brightYellow; - blue = brightBlue; - magenta = brightMagenta; - cyan = brightCyan; - white = brightWhite; - }; - }; selection.save_to_clipboard = true; cursor = { style = { diff --git a/modules/common/bat.nix b/modules/common/bat.nix index 2dc0913..89444d9 100644 --- a/modules/common/bat.nix +++ b/modules/common/bat.nix @@ -21,7 +21,6 @@ in { config = { style = "plain"; tabs = "4"; - theme = "base16"; wrap = "never"; }; }; diff --git a/modules/common/common/default.nix b/modules/common/common/default.nix index 0087754..62e4a95 100644 --- a/modules/common/common/default.nix +++ b/modules/common/common/default.nix @@ -7,6 +7,7 @@ _: { ./nix.nix ./secrets.nix ./shell + ./stylix.nix ./users.nix ./xdg.nix ]; diff --git a/modules/common/common/nix.nix b/modules/common/common/nix.nix index 78672a0..ecd5874 100644 --- a/modules/common/common/nix.nix +++ b/modules/common/common/nix.nix @@ -4,7 +4,6 @@ lib, localUsername ? lib.my.username, pkgs, - pkgsPr, this, ... }: @@ -90,7 +89,6 @@ with lib; { nixpkgs.overlays = with inputs; [ self.overlays.default (_: _: { - inherit (pkgsPr 274745 "sha256-VqBdz6OERQ7dUxWVG+aAeKWuRoPIgfZPipfNdX122WM=") beets-unstable; }) ]; diff --git a/modules/common/common/stylix.nix b/modules/common/common/stylix.nix new file mode 100644 index 0000000..46b1f52 --- /dev/null +++ b/modules/common/common/stylix.nix @@ -0,0 +1,68 @@ +{ + lib, + pkgs, + ... +}: +with lib; { + imports = [ + (mkAliasOptionModule ["colors"] [ + "lib" + "stylix" + "colors" + ]) + ]; + + options.nixfiles.modules.common.stylix.fonts.extraPackages = mkOption { + description = "Font packages."; + default = with pkgs; [ + font-awesome + noto-fonts + noto-fonts-emoji + sarasa-gothic + source-han-mono + source-han-sans + source-han-serif + ]; + readOnly = true; + }; + + config = { + stylix = { + image = pkgs.fetchurl { + url = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Bonaparte_ante_la_Esfinge%2C_por_Jean-Léon_Gérôme.jpg"; + sha256 = "sha256-qWv52oT8cF9K4ZoeawmR3jgoGB2ARfjbKKc12IljUcM="; + }; + + base16Scheme = "${pkgs.base16-schemes}/share/themes/default-dark.yaml"; + + fonts = { + serif = { + package = pkgs.iosevka-bin.override {variant = "etoile";}; + name = "Iosevka Etoile"; + }; + + sansSerif = { + package = pkgs.iosevka-bin.override {variant = "aile";}; + name = "Iosevka Aile"; + }; + + monospace = { + package = pkgs.iosevka-bin; + name = "Iosevka"; + }; + + sizes = { + desktop = 10; + applications = 10; + terminal = 12; + }; + }; + + cursor = { + name = "phinger-cursors"; + package = pkgs.phinger-cursors; + size = 32; + }; + }; + }; +} diff --git a/modules/common/default.nix b/modules/common/default.nix index c6c7c81..92f719d 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -9,7 +9,6 @@ _: { ./editorconfig.nix ./emacs ./eza.nix - ./fonts.nix ./git.nix ./gnupg.nix ./htop.nix diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix index 4d17e92..6c5ee1e 100644 --- a/modules/common/emacs/default.nix +++ b/modules/common/emacs/default.nix @@ -19,7 +19,6 @@ in { }; nixfiles.modules = { - fonts.enable = true; git.client.enable = true; gnupg.enable = true; password-store.enable = true; @@ -28,6 +27,8 @@ in { }; hm = { + stylix.targets.emacs.enable = false; + xdg.configFile = mapAttrs (_: value: value // { @@ -171,10 +172,9 @@ in { (appendq! auth-sources '(("${config.secrets.authinfo.path}"))) - ;; The font must be set to n+2, otherwise it looks too small. (setq doom-font (font-spec - :family "${config.fontScheme.monospaceFont.family}" - :size ${toString (config.fontScheme.monospaceFont.size + 2)}) + :family "${config.stylix.fonts.monospace.name}" + :size 16) doom-unicode-font doom-font) ;; :input japanese diff --git a/modules/common/emacs/doom/config.el b/modules/common/emacs/doom/config.el index 8fd2afc..9e3d603 100644 --- a/modules/common/emacs/doom/config.el +++ b/modules/common/emacs/doom/config.el @@ -9,7 +9,7 @@ scroll-margin 10 hscroll-margin 10) -(when IS-LINUX +(when (featurep :system 'linux) (setq browse-url-generic-program (executable-find "firefox") browse-url-browser-function 'browse-url-generic)) @@ -17,7 +17,7 @@ ;;; Doom-specific ;; -(setq doom-theme 'doom-tomorrow-night +(setq doom-theme 'modus-vivendi doom-modeline-icon nil doom-modeline-indent-info t doom-modeline-total-line-number t @@ -190,7 +190,7 @@ :tls t :user ,(concat circe-default-user "/" server) :pass ,(lambda (&rest _) - (+pass-get-secret "server/soju.manwe.shire.net/azahi")))) + (+pass-get-secret "")))) '("libera" "oftc" "hackint" "rizon"))) ;; diff --git a/modules/common/fonts.nix b/modules/common/fonts.nix deleted file mode 100644 index 6bd3e71..0000000 --- a/modules/common/fonts.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ - lib, - pkgs, - ... -}: -with lib; { - imports = [ - (mkAliasOptionModule ["fontScheme"] [ - "nixfiles" - "modules" - "fonts" - "fontScheme" - ]) - ]; - - options.nixfiles.modules.fonts = { - enable = mkEnableOption "fonts and their configurations"; - - packages = mkOption { - description = "Font packages to install."; - type = with types; listOf package; - default = with pkgs; [ - (iosevka-bin.override {variant = "aile";}) - (iosevka-bin.override {variant = "etoile";}) - iosevka-bin - sarasa-gothic - source-han-mono - source-han-sans - source-han-serif - noto-fonts - font-awesome - ]; - }; - - fontScheme = let - mkFont = { - family, - style, - size, - }: { - family = mkOption { - description = "Family of the font."; - type = types.str; - default = family; - }; - style = mkOption { - description = "Style of the font."; - type = types.str; - default = style; - }; - size = mkOption { - description = "Size of the font."; - type = types.int; - default = size; - }; - }; - in { - serifFont = mkFont { - family = "Iosevka Etoile"; - style = "Regular"; - size = 14; - }; - - serifFontFallback = mkFont { - family = "Sarasa Gothic J"; - style = "Regular"; - size = 14; - }; - - sansSerifFont = mkFont { - family = "Iosevka Aile"; - style = "Regular"; - size = 14; - }; - - sansSerifFontFallback = mkFont { - family = "Sarasa Gothic J"; - style = "Regular"; - size = 14; - }; - - monospaceFont = mkFont { - family = "Iosevka"; - style = "Regular"; - size = 14; - }; - - monospaceFontFallback = mkFont { - family = "Sarasa Mono J"; - style = "Regular"; - size = 14; - }; - }; - }; -} diff --git a/modules/common/profiles/default.nix b/modules/common/profiles/default.nix index 2b24752..a17ff08 100644 --- a/modules/common/profiles/default.nix +++ b/modules/common/profiles/default.nix @@ -13,53 +13,13 @@ in { ./email.nix ./headful.nix ./headless.nix - (mkAliasOptionModule ["colourScheme"] [ - "nixfiles" - "modules" - "profiles" - "default" - "colourScheme" - ]) ]; - options.nixfiles.modules.profiles.default = { - enable = - mkEnableOption "The most default profile of them all." - // { - default = true; - }; - - colourScheme = let - mkColour = default: - mkOption { - type = types.str; - inherit default; - description = "Colour in a standard hexadecimal notation."; - example = "#000000"; - }; - in rec { - black = mkColour "#161719"; - red = mkColour "#cc6666"; - green = mkColour "#b5bd68"; - yellow = mkColour "#f0c674"; - blue = mkColour "#81a2be"; - magenta = mkColour "#b294bb"; - cyan = mkColour "#8abeb7"; - white = mkColour "#c5c8c6"; - - brightBlack = mkColour "#969896"; - brightRed = mkColour "#cc6666"; - brightGreen = mkColour "#b5bd68"; - brightYellow = mkColour "#f0c674"; - brightBlue = mkColour "#81a2be"; - brightMagenta = mkColour "#b294bb"; - brightCyan = mkColour "#8abeb7"; - brightWhite = mkColour "#ffffff"; - - background = black; - foreground = white; + options.nixfiles.modules.profiles.default.enable = + mkEnableOption "The most default profile of them all." + // { + default = true; }; - }; config = mkIf cfg.enable { assertions = [ diff --git a/modules/common/profiles/dev/sql.nix b/modules/common/profiles/dev/sql.nix index b290c16..3e1c4b2 100644 --- a/modules/common/profiles/dev/sql.nix +++ b/modules/common/profiles/dev/sql.nix @@ -16,7 +16,6 @@ in { config = mkIf cfg.enable { hm = { home.packages = with pkgs; [ - dbeaver pgcli litecli ]; @@ -34,26 +33,26 @@ in { table_format = "fancy_grid"; }; - colorsSection = with config.colourScheme; { + colorsSection = with config.colors.withHashtag; { "arg-toolbar" = "noinherit bold"; "arg-toolbar.text" = "nobold"; - "bottom-toolbar" = "bg:${black} ${white}"; - "bottom-toolbar.off" = "bg:${black} ${brightBlack}"; - "bottom-toolbar.on" = "bg:${black} ${brightWhite}"; - "bottom-toolbar.transaction.failed" = "bg:${black} ${red} bold"; - "bottom-toolbar.transaction.valid" = "bg:${black} ${green} bold"; - "completion-menu.completion" = "bg:${black} ${white}"; - "completion-menu.completion.current" = "bg:${white} ${black}"; - "completion-menu.meta.completion" = "bg:${black} ${yellow}"; - "completion-menu.meta.completion.current" = "bg:${yellow} ${black}"; - "completion-menu.multi-column-meta" = "bg:${yellow} ${black}"; - "scrollbar" = "bg:${black}"; - "scrollbar.arrow" = "bg:${black}"; - "search" = "bg:${magenta} ${brightWhite}"; + "bottom-toolbar" = "bg:${base01} ${base06}"; + "bottom-toolbar.off" = "bg:${base01} ${base02}"; + "bottom-toolbar.on" = "bg:${base01} ${base07}"; + "bottom-toolbar.transaction.failed" = "bg:${base01} ${base08} bold"; + "bottom-toolbar.transaction.valid" = "bg:${base01} ${base0B} bold"; + "completion-menu.completion" = "bg:${base01} ${base06}"; + "completion-menu.completion.current" = "bg:${base06} ${base01}"; + "completion-menu.meta.completion" = "bg:${base01} ${base13}"; + "completion-menu.meta.completion.current" = "bg:${base09} ${base01}"; + "completion-menu.multi-column-meta" = "bg:${base09} ${base01}"; + "scrollbar" = "bg:${base01}"; + "scrollbar.arrow" = "bg:${base01}"; + "search" = "bg:${base17} ${base07}"; "search-toolbar" = "noinherit bold"; "search-toolbar.text" = "nobold"; - "search.current" = "bg:${green} ${brightWhite}"; - "selected" = "bg:${blue} ${brightWhite}"; + "search.current" = "bg:${base14} ${base07}"; + "selected" = "bg:${base0D} ${base07}"; "system-toolbar" = "noinherit bold"; }; diff --git a/modules/common/qutebrowser.nix b/modules/common/qutebrowser.nix index 9a919b7..a3b82d3 100644 --- a/modules/common/qutebrowser.nix +++ b/modules/common/qutebrowser.nix @@ -178,7 +178,6 @@ in { hints = { auto_follow = "unique-match"; auto_follow_timeout = 0; - border = "0px"; min_chars = 1; scatter = false; uppercase = false; @@ -242,207 +241,6 @@ in { title_format = "{perc}{current_title}{title_sep}qutebrowser"; }; - colors = with config.colourScheme; { - completion = rec { - fg = white; - match.fg = red; - odd.bg = black; - even.bg = odd.bg; - category = { - fg = white; - bg = black; - border = { - top = black; - bottom = black; - }; - }; - item.selected = { - fg = black; - bg = white; - border = { - top = white; - bottom = white; - }; - }; - scrollbar = { - fg = white; - bg = black; - }; - }; - contextmenu = { - menu = { - fg = white; - bg = black; - }; - selected = { - fg = black; - bg = white; - }; - disabled = { - fg = brightBlack; - bg = black; - }; - }; - downloads = { - bar.bg = black; - start = { - fg = green; - bg = black; - }; - stop = { - fg = yellow; - bg = black; - }; - error = { - fg = red; - bg = black; - }; - system = { - fg = "none"; - bg = "none"; - }; - }; - hints = { - fg = white; - match.fg = red; - bg = black; - }; - keyhint = { - fg = white; - suffix.fg = red; - bg = black; - }; - messages = { - error = rec { - bg = black; - fg = red; - border = bg; - }; - info = rec { - fg = blue; - bg = black; - border = bg; - }; - warning = rec { - fg = yellow; - bg = black; - border = bg; - }; - }; - prompts = rec { - fg = white; - bg = black; - selected = { - fg = black; - bg = white; - }; - border = bg; - }; - statusbar = { - normal = { - bg = black; - fg = white; - }; - command = { - bg = black; - fg = white; - }; - insert = { - bg = green; - fg = black; - }; - passthrough = { - bg = blue; - fg = black; - }; - private = { - bg = magenta; - fg = black; - }; - url = { - fg = blue; - hover.fg = brightBlue; - success = { - http.fg = brightGreen; - https.fg = brightGreen; - }; - warn.fg = brightYellow; - error.fg = brightRed; - }; - }; - tabs = rec { - bar.bg = black; - even = { - bg = black; - fg = white; - }; - odd = with even; {inherit bg fg;}; - selected = rec { - even = { - bg = white; - fg = black; - }; - odd = with even; {inherit bg fg;}; - }; - pinned = rec { - even = { - bg = brightBlack; - fg = brightWhite; - }; - odd = with even; {inherit bg fg;}; - }; - indicator = { - start = green; - stop = yellow; - error = red; - system = "none"; - }; - }; - webpage = { - bg = "white"; - darkmode.enabled = false; - preferred_color_scheme = "auto"; - }; - }; - - fonts = - (with config.fontScheme.monospaceFont; { - default_family = family; - default_size = (toString size) + "pt"; - }) - // { - web = with config.fontScheme; { - family = rec { - standard = sans_serif; - fixed = monospaceFont.family; - serif = serifFont.family; - sans_serif = sansSerifFont.family; - cursive = null; - fantasy = null; - }; - size = rec { - default = sansSerifFont.size; - default_fixed = monospaceFont.size; - minimum = 0; - minimum_logical = default / 2; - }; - }; - } - // mapListToAttrs (_: "default_size default_family") [ - "completion.category" - "completion.entry" - "contextmenu" - "debug_console" - "downloads" - "hints" - "keyhint" - "messages.error" - "messages.info" - "messages.warning" - "prompts" - "statusbar" - ]; - qt = mkIf kde.enable { force_platform = null; force_platformtheme = "KDE"; diff --git a/modules/common/vim/default.nix b/modules/common/vim/default.nix index cd24768..e305cf1 100644 --- a/modules/common/vim/default.nix +++ b/modules/common/vim/default.nix @@ -32,6 +32,8 @@ in { }; config = mkIf cfg.enable { + hm.stylix.targets.vim.enable = false; + environment = with config.programs.vim; { systemPackages = [package]; variables = rec { diff --git a/modules/common/vscode.nix b/modules/common/vscode.nix index 10d4bf6..0780b0b 100644 --- a/modules/common/vscode.nix +++ b/modules/common/vscode.nix @@ -69,30 +69,19 @@ in { ] ++ optional cfg.vim.enable vscodevim.vim; - userSettings = let - font = config.fontScheme.monospaceFont; - fontFamily = font.family; - fontSize = font.size; - in { - editor = - { - inherit fontFamily fontSize; - inlayHints = {inherit fontFamily fontSize;}; - codeLens = false; - cursorStyle = "block"; - detectIndentation = true; - minimap.enabled = false; - renderWhitespace = "trailing"; - rulers = [80 120]; - smoothScrolling = false; - tabCompletion = "on"; - } - // (let - surround = 10; - in { - cursorSurroundingLines = surround; - scrollBeyondLastColumn = surround; - }); + userSettings = { + editor = { + codeLens = false; + cursorStyle = "block"; + detectIndentation = true; + minimap.enabled = false; + renderWhitespace = "trailing"; + rulers = [80 120]; + smoothScrolling = false; + tabCompletion = "on"; + cursorSurroundingLines = 10; + scrollBeyondLastColumn = 10; + }; keyboard.dispatch = "keyCode"; @@ -117,13 +106,6 @@ in { }; }; - debug.console = {inherit fontFamily fontSize;}; - - scm = { - inputFontFamily = fontFamily; - inputFontSize = fontSize; - }; - extensions = { autoCheckUpdates = false; autoUpdate = false; @@ -131,7 +113,6 @@ in { }; terminal.integrated = { - inherit fontFamily fontSize; enableBell = true; }; @@ -225,8 +206,6 @@ in { vim = mkIf cfg.vim.enable { easymotion = true; - easymotionMarkerFontFamily = fontFamily; - easymotionMarkerFontSize = fontSize; leader = " "; diff --git a/modules/common/zathura.nix b/modules/common/zathura.nix index f78a9e9..b13d2a6 100644 --- a/modules/common/zathura.nix +++ b/modules/common/zathura.nix @@ -10,111 +10,74 @@ in { mkEnableOption "Zathura PDF reader"; config = mkIf cfg.enable { - hm.programs.zathura = with config.nixfiles.modules; { + hm.programs.zathura = { enable = true; - options = - (with config.colourScheme; { - default-fg = white; - default-bg = black; + options = { + recolor = true; + recolor-keephue = false; + recolor-reverse-video = false; - statusbar-fg = black; - statusbar-bg = white; + highlight-transparency = "0.3"; - inputbar-fg = black; - inputbar-bg = brightGreen; + n-completion-items = 10; - notification-fg = black; - notification-bg = brightBlue; + guioptions = ""; - notification-warning-fg = black; - notification-warning-bg = brightYellow; + statusbar-basename = true; + statusbar-home-tilde = true; - notification-error-fg = black; - notification-error-bg = brightRed; + statusbar-h-padding = 0; + statusbar-v-padding = 0; - highlight-color = brightYellow; - highlight-active-color = yellow; + window-height = 800; + window-width = 600; - completion-fg = brightWhite; - completion-bg = brightBlack; + window-icon = ""; - completion-highlight-fg = black; - completion-highlight-bg = brightRed; + abort-clear-search = true; - completion-group-fg = black; - completion-group-bg = brightRed; + incremental-search = true; - recolor-darkcolor = black; - recolor-lightcolor = white; - }) - // { - recolor = true; - recolor-keephue = false; - recolor-reverse-video = false; + adjust-open = "best-fit"; - highlight-transparency = "0.3"; + advance-pages-per-row = false; - font = config.fontScheme.monospaceFont.family; + database = "sqlite"; - n-completion-items = 10; + dbus-service = false; - guioptions = ""; + page-padding = 0; - statusbar-basename = true; - statusbar-home-tilde = true; + pages-per-row = 1; - statusbar-h-padding = 0; - statusbar-v-padding = 0; + render-loading = false; - window-height = 800; - window-width = 600; + show-directories = true; + show-hidden = true; + show-recent = 10; - window-icon = ""; + link-zoom = true; + link-hadjust = true; - abort-clear-search = true; + window-title-basename = true; + window-title-home-tilde = true; + window-title-page = true; - incremental-search = true; + zoom-center = false; + zoom-max = 1000; + zoom-min = 10; + zoom-step = 10; - adjust-open = "best-fit"; + scroll-hstep = -1; + scroll-step = 40; + scroll-full-overlap = 0; + scroll-wrap = true; + scroll-page-aware = false; - advance-pages-per-row = false; - - database = "sqlite"; - - dbus-service = false; - - page-padding = 0; - - pages-per-row = 1; - - render-loading = false; - - show-directories = true; - show-hidden = true; - show-recent = 10; - - link-zoom = true; - link-hadjust = true; - - window-title-basename = true; - window-title-home-tilde = true; - window-title-page = true; - - zoom-center = false; - zoom-max = 1000; - zoom-min = 10; - zoom-step = 10; - - scroll-hstep = -1; - scroll-step = 40; - scroll-full-overlap = 0; - scroll-wrap = true; - scroll-page-aware = false; - - selection-clipboard = "clipboard"; - selection-notification = false; - }; + selection-clipboard = "clipboard"; + selection-notification = false; + }; }; }; } diff --git a/modules/darwin/common/default.nix b/modules/darwin/common/default.nix index 4d4824f..04f7b29 100644 --- a/modules/darwin/common/default.nix +++ b/modules/darwin/common/default.nix @@ -6,6 +6,7 @@ _: { ./nix.nix ./secrets.nix ./shell.nix + ./stylix.nix ./users.nix ./xdg.nix ]; diff --git a/modules/darwin/common/stylix.nix b/modules/darwin/common/stylix.nix new file mode 100644 index 0000000..b5bb119 --- /dev/null +++ b/modules/darwin/common/stylix.nix @@ -0,0 +1,11 @@ +{ + config, + inputs, + lib, + ... +}: +with lib; { + imports = [inputs.stylix.darwinModules.stylix]; + + fonts.fonts = mkAfter config.modules.common.stylix.fonts.extraPackages; +} diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index fbc5c1e..ba7a2a7 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -1,7 +1,6 @@ _: { imports = [ ./common - ./fonts.nix ./gnupg.nix ./homebrew.nix ./profiles diff --git a/modules/darwin/fonts.nix b/modules/darwin/fonts.nix deleted file mode 100644 index c52d73e..0000000 --- a/modules/darwin/fonts.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; let - cfg = config.nixfiles.modules.fonts; -in { - config = mkIf cfg.enable { - fonts = { - fonts = cfg.packages; - - fontDir.enable = true; - }; - }; -} diff --git a/modules/nixos/common/console.nix b/modules/nixos/common/console.nix index e280919..3491e37 100644 --- a/modules/nixos/common/console.nix +++ b/modules/nixos/common/console.nix @@ -3,6 +3,8 @@ pkgs, ... }: { + stylix.targets.console.enable = false; + console = { earlySetup = true; font = "${pkgs.terminus_font}/share/consolefonts/ter-v16b.psf.gz"; diff --git a/modules/nixos/common/default.nix b/modules/nixos/common/default.nix index 54f8f51..4c192c9 100644 --- a/modules/nixos/common/default.nix +++ b/modules/nixos/common/default.nix @@ -12,6 +12,7 @@ _: { ./security.nix ./services.nix ./shell.nix + ./stylix.nix ./systemd.nix ./tmp.nix ./users.nix diff --git a/modules/nixos/common/stylix.nix b/modules/nixos/common/stylix.nix new file mode 100644 index 0000000..6249abf --- /dev/null +++ b/modules/nixos/common/stylix.nix @@ -0,0 +1,37 @@ +{ + config, + inputs, + lib, + ... +}: +with lib; { + imports = [inputs.stylix.nixosModules.stylix]; + + fonts = { + packages = mkAfter config.nixfiles.modules.common.stylix.fonts.extraPackages; + + fontconfig.defaultFonts = { + serif = mkForce [ + "Iosevka Etoile" + "Sarasa Gothic" + "Source Han Serif" + "Noto Serif" + ]; + sansSerif = mkForce [ + "Iosevka Aile" + "Sarasa Gothic" + "Source Han Sans" + "Noto Sans" + ]; + monospace = mkForce [ + "Iosevka" + "Sarasa Mono" + "Source Han Mono" + "Noto Sans Mono" + ]; + emoji = mkForce [ + "Noto Color Emoji" + ]; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 93f0974..1a42517 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -15,7 +15,6 @@ _: { ./endlessh.nix ./fail2ban.nix ./firefox - ./fonts.nix ./games ./git ./gnupg.nix diff --git a/modules/nixos/dwm.nix b/modules/nixos/dwm.nix index 9c5e283..a32ed29 100644 --- a/modules/nixos/dwm.nix +++ b/modules/nixos/dwm.nix @@ -18,8 +18,7 @@ in { windowManager.command = let pkg = pkgs.dwm.override { conf = let - font = with config.fontScheme.monospaceFont; "${family}:size=${toString size}"; - colour = config.colourScheme; + font = with config.stylix.fonts; "${monospace.name}:size=${toString sizes.terminal}"; in '' static const unsigned int borderpx = 1; static const unsigned int snap = 32; @@ -32,14 +31,14 @@ in { static const char *colors[][3] = { [SchemeNorm] = { - "${colour.white}", - "${colour.black}", - "${colour.black}", + "${config.color.base06}", + "${config.color.base01}", + "${config.color.base01}", }, [SchemeSel] = { - "${colour.black}", - "${colour.white}", - "${colour.white}", + "${config.color.base01}", + "${config.color.base06}", + "${config.color.base06}", }, }; @@ -82,10 +81,10 @@ in { "${pkgs.dmenu}/bin/dmenu_run", "-m", dmenumon, "-fn", "${font}", - "-nb", "${colour.black}", - "-nf", "${colour.white}", - "-sb", "${colour.white}", - "-sf", "${colour.black}", + "-nb", "${config.color.base01}", + "-nf", "${config.color.base06}", + "-sb", "${config.color.base06}", + "-sf", "${config.color.base01}", NULL, }; static const char *termcmd[] = { diff --git a/modules/nixos/firefox/default.nix b/modules/nixos/firefox/default.nix index ce8b3ee..d192ae1 100644 --- a/modules/nixos/firefox/default.nix +++ b/modules/nixos/firefox/default.nix @@ -22,6 +22,11 @@ in { home.packages = with pkgs; [profile-cleaner]; + stylix.targets.firefox = { + enable = true; + profileNames = ["default"]; + }; + programs.firefox = { enable = true; @@ -32,34 +37,34 @@ in { profiles.default = let mkCssWithRoot = css: mkMerge [ - (with config.colourScheme; '' + (with config.colors.withHashtag; '' :root { - --black: ${black}; - --red: ${red}; - --green: ${green}; - --yellow: ${yellow}; - --blue: ${blue}; - --magenta: ${magenta}; - --cyan: ${cyan}; - --white: ${white}; - --bright-black: ${brightBlack}; - --bright-red: ${brightRed}; - --bright-green: ${brightGreen}; - --bright-yellow: ${brightYellow}; - --bright-blue: ${brightBlue}; - --bright-magenta: ${brightMagenta}; - --bright-cyan: ${brightCyan}; - --bright-white: ${brightWhite}; - --background: ${background}; - --foreground: ${foreground}; + --black: ${base01}; + --red: ${base08}; + --green: ${base0B}; + --yellow: ${base09}; + --blue: ${base0D}; + --magenta: ${base0E}; + --cyan: ${base0C}; + --white: ${base06}; + --bright-black: ${base02}; + --bright-red: ${base12}; + --bright-green: ${base14}; + --bright-yellow: ${base13}; + --bright-blue: ${base16}; + --bright-magenta: ${base17}; + --bright-cyan: ${base15}; + --bright-white: ${base07}; + --background: ${base00}; + --foreground: ${base02}; '') - (with config.fontScheme; '' - --sans-serif-font-family: "${sansSerifFont.family}", "${sansSerifFontFallback.family}", sans-serif; - --sans-serif-font-size: ${toString sansSerifFont.size}px; - --serif-font-family: "${serifFont.family}", "${serifFontFallback.family}", serif; - --serif-font-size: ${toString serifFont.size}px; - --monospace-font-family: "${monospaceFont.family}", "${monospaceFontFallback.family}", monospace; - --monospace-font-size: ${toString monospaceFont.size}px; + (with config.stylix.fonts; '' + --sans-serif-font-family: "${sansSerif.name}", sans-serif; + --sans-serif-font-size: ${toString sizes.applications}; + --serif-font-family: "${serif.name}", serif; + --serif-font-size: ${toString sizes.applications}; + --monospace-font-family: "${monospace.name}", monospace; + --monospace-font-size: ${toString sizes.applications}; } '') (builtins.readFile css) diff --git a/modules/nixos/fonts.nix b/modules/nixos/fonts.nix deleted file mode 100644 index a333cb3..0000000 --- a/modules/nixos/fonts.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.nixfiles.modules.fonts; -in { - config = mkMerge [ - (mkIf cfg.enable { - nixfiles.modules.common.nix.allowedUnfreePackages = ["symbola"]; - hm.fonts.fontconfig.enable = true; - fonts = { - packages = - cfg.packages - ++ (with pkgs; [ - noto-fonts-emoji - twitter-color-emoji - symbola - ]); - - fontconfig = { - enable = true; - - defaultFonts = { - emoji = mkForce [ - "Twitter Color Emoji" - "Noto Color Emoji" - "Symbola" - ]; - monospace = mkForce [ - "Iosevka" - "Sarasa Mono" - "Source Han Mono" - "Noto Sans Mono" - ]; - sansSerif = mkForce [ - "Iosevka Aile" - "Sarasa Gothic" - "Source Han Sans" - "Noto Sans" - ]; - serif = mkForce [ - "Iosevka Etoile" - "Sarasa Gothic" - "Source Han Serif" - "Noto Serif" - ]; - }; - - localConf = '' - <?xml version='1.0'?> - <!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'> - <fontconfig> - <alias binding="same"> - <family>Helvetica</family> - <prefer> - <family>sans-serif</family> - </prefer> - </alias> - <alias binding="same"> - <family>Arial</family> - <prefer> - <family>sans-serif</family> - </prefer> - </alias> - </fontconfig> - ''; - }; - }; - }) - (mkIf (!cfg.enable) { - hm.fonts.fontconfig.enable = false; - fonts.fontconfig.enable = false; - }) - ]; -} diff --git a/modules/nixos/git/default.nix b/modules/nixos/git/default.nix index adff240..cbeb48a 100644 --- a/modules/nixos/git/default.nix +++ b/modules/nixos/git/default.nix @@ -93,7 +93,7 @@ in { @import url("cgit.css"); div#cgit { - font-family: "${config.fontScheme.monospaceFont.family}", monospace; + font-family: monospace; -moz-tab-size: 4; tab-size: 4; } diff --git a/modules/nixos/kde.nix b/modules/nixos/kde.nix index 58990f1..3822415 100644 --- a/modules/nixos/kde.nix +++ b/modules/nixos/kde.nix @@ -18,12 +18,29 @@ in { }; hm = { - home.sessionVariables.GTK_USE_PORTAL = 1; - programs.firefox.profiles.default.settings = { "widget.use-xdg-desktop-portal.file-picker" = 1; "widget.use-xdg-desktop-portal.mime-handler" = 1; }; + + gtk.theme = { + package = mkForce pkgs.breeze-gtk; + name = mkForce "Breeze"; + }; + + xdg.configFile = { + "fontconfig/conf.d/10-hm-fonts.conf".force = mkForce true; + "mimeapps.list".force = mkForce true; + "kcminputrc".text = generators.toINI {} { + Keyboard = with config.services.xserver; { + RepeatDelay = autoRepeatDelay; + RepeatRate = autoRepeatInterval; + }; + }; + "baloofilerc".text = generators.toINI {} { + "Basic Settings"."Indexing-Enabled" = false; + }; + }; }; services.xserver = { diff --git a/modules/nixos/profiles/headful.nix b/modules/nixos/profiles/headful.nix index 187c5a3..4bc7ed3 100644 --- a/modules/nixos/profiles/headful.nix +++ b/modules/nixos/profiles/headful.nix @@ -74,7 +74,6 @@ in { services = { upower.enable = true; - psd.enable = true; }; diff --git a/modules/nixos/thunderbird.nix b/modules/nixos/thunderbird.nix index b5f360a..d8ce4ad 100644 --- a/modules/nixos/thunderbird.nix +++ b/modules/nixos/thunderbird.nix @@ -24,11 +24,11 @@ in { config.hm.programs.firefox.profiles.default.settings // { "app.donation.eoy.version.viewed" = 999; - "browser.display.background_color" = config.colourScheme.black; - "browser.display.background_color.dark" = config.colourScheme.black; + "browser.display.background_color" = config.colors.withHashtag.base00; + "browser.display.background_color.dark" = config.colors.withHashtag.base00; "browser.display.document_color_use" = 2; - "browser.display.foreground_color" = config.colourScheme.white; - "browser.display.foreground_color.dark" = config.colourScheme.white; + "browser.display.foreground_color" = config.colors.withHashtag.base07; + "browser.display.foreground_color.dark" = config.colors.withHashtag.base07; "javascript.enabled" = false; "mail.chat.enabled" = false; "mail.cloud_files.enabled" = false; diff --git a/modules/nixos/x11.nix b/modules/nixos/x11.nix index b629aeb..bd35d87 100644 --- a/modules/nixos/x11.nix +++ b/modules/nixos/x11.nix @@ -25,40 +25,14 @@ in { XCOMPOSECACHE = "${config.dirs.cache}/libx11/compose"; }; - xresources.properties = - (let - font = with config.fontScheme.monospaceFont; "${family}:style=${style}:size=${toString size}"; - in { - "*.font" = font; - - "Xft.antialias" = mkDefault 1; - "Xft.autohint" = mkDefault 0; - "Xft.hinting" = mkDefault 1; - "Xft.hintstyle" = mkDefault "hintslight"; - "Xft.lcdfilter" = mkDefault "lcddefault"; - "Xft.rgba" = mkDefault "rgb"; - }) - // (with config.colourScheme; { - "*.color0" = black; - "*.color8" = brightBlack; - "*.color1" = red; - "*.color9" = brightRed; - "*.color2" = green; - "*.color10" = brightGreen; - "*.color3" = yellow; - "*.color11" = brightYellow; - "*.color4" = blue; - "*.color12" = brightBlue; - "*.color5" = magenta; - "*.color13" = brightMagenta; - "*.color6" = cyan; - "*.color14" = brightCyan; - "*.color7" = white; - "*.color15" = brightWhite; - - "*.background" = background; - "*.foreground" = foreground; - }); + xresources.properties = { + "Xft.antialias" = mkDefault 1; + "Xft.autohint" = mkDefault 0; + "Xft.hinting" = mkDefault 1; + "Xft.hintstyle" = mkDefault "hintslight"; + "Xft.lcdfilter" = mkDefault "lcddefault"; + "Xft.rgba" = mkDefault "rgb"; + }; services.xsettingsd = { enable = true; @@ -87,7 +61,7 @@ in { tty = mkDefault 1; autoRepeatDelay = 200; - autoRepeatInterval = 25; + autoRepeatInterval = 50; libinput.enable = true; diff --git a/nixosConfigurations/eonwe/default.nix b/nixosConfigurations/eonwe/default.nix index 002d150..8164cd4 100644 --- a/nixosConfigurations/eonwe/default.nix +++ b/nixosConfigurations/eonwe/default.nix @@ -152,7 +152,11 @@ with lib; { }; }; - services.mpd.musicDirectory = mkForce "/mnt/udata/music"; + services = { + mpd.musicDirectory = mkForce "/mnt/udata/music"; + + xsettingsd.settings."Xft/DPI" = "93"; + }; }; services = { diff --git a/overlay.nix b/overlay.nix index c8fed1f..0a883f5 100644 --- a/overlay.nix +++ b/overlay.nix @@ -95,7 +95,7 @@ final: prev: { rm -rf $out/share/icons/hicolor/* for size in 16 24 32 48 64 96; do convert -scale $size icon.png $size.png - install -Dm644 $size.png $out/share/icons/hicolor/''${size}x''${size}/apps/vencorddesktop.png + install -Dm644 $size.png $out/share/icons/hicolor/''${size}x''${size}/apps/vesktop.png done ''; }); |