diff --git a/flake.lock b/flake.lock index 3a5b0d7..6a9eecc 100644 --- a/flake.lock +++ b/flake.lock @@ -34,22 +34,6 @@ "type": "github" } }, - "base16-schemes": { - "flake": false, - "locked": { - "lastModified": 1696158499, - "narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=", - "owner": "tinted-theming", - "repo": "base16-schemes", - "rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-schemes", - "type": "github" - } - }, "crane": { "flake": false, "locked": { @@ -423,6 +407,22 @@ } }, "flake-compat_6": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_7": { "locked": { "lastModified": 1688025799, "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", @@ -437,7 +437,7 @@ "type": "github" } }, - "flake-compat_7": { + "flake-compat_8": { "flake": false, "locked": { "lastModified": 1696426674, @@ -685,6 +685,24 @@ "inputs": { "systems": "systems_4" }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_7": { + "inputs": { + "systems": "systems_5" + }, "locked": { "lastModified": 1710146030, "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", @@ -699,9 +717,9 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_8": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1710146030, @@ -794,6 +812,28 @@ } }, "gitignore_3": { + "inputs": { + "nixpkgs": [ + "nix-wallpaper", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_4": { "inputs": { "nixpkgs": [ "pre-commit-hooks-nix", @@ -1054,8 +1094,8 @@ }, "lib-aggregate": { "inputs": { - "flake-utils": "flake-utils_6", - "nixpkgs-lib": "nixpkgs-lib_5" + "flake-utils": "flake-utils_7", + "nixpkgs-lib": "nixpkgs-lib_4" }, "locked": { "lastModified": 1711282133, @@ -1168,25 +1208,6 @@ "type": "github" } }, - "nix-colors": { - "inputs": { - "base16-schemes": "base16-schemes", - "nixpkgs-lib": "nixpkgs-lib_4" - }, - "locked": { - "lastModified": 1707825078, - "narHash": "sha256-hTfge2J2W+42SZ7VHXkf4kjU+qzFqPeC9k66jAUBMHk=", - "owner": "Misterio77", - "repo": "nix-colors", - "rev": "b01f024090d2c4fc3152cd0cf12027a7b8453ba1", - "type": "github" - }, - "original": { - "owner": "Misterio77", - "repo": "nix-colors", - "type": "github" - } - }, "nix-eval-jobs": { "inputs": { "flake-parts": "flake-parts_6", @@ -1284,6 +1305,28 @@ "type": "github" } }, + "nix-wallpaper": { + "inputs": { + "flake-utils": "flake-utils_6", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks_3" + }, + "locked": { + "lastModified": 1708554876, + "narHash": "sha256-gaL/q2OtucwPrh/nVm1kvtLSvGdcem0E87WZ+rozBYc=", + "owner": "lunik1", + "repo": "nix-wallpaper", + "rev": "5058a76a9db42a7fdc05ce9cae0cc7c3c71acd22", + "type": "github" + }, + "original": { + "owner": "lunik1", + "repo": "nix-wallpaper", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1711274671, @@ -1386,21 +1429,6 @@ } }, "nixpkgs-lib_4": { - "locked": { - "lastModified": 1697935651, - "narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixpkgs-lib_5": { "locked": { "lastModified": 1711241261, "narHash": "sha256-knrTvpl81yGFHIpm1SsLDApe0thFkw1cl3ISAMPmP/0=", @@ -1464,6 +1492,22 @@ } }, "nixpkgs-stable_3": { + "locked": { + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_4": { "locked": { "lastModified": 1710695816, "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", @@ -1479,7 +1523,7 @@ "type": "github" } }, - "nixpkgs-stable_4": { + "nixpkgs-stable_5": { "locked": { "lastModified": 1711233294, "narHash": "sha256-eEu5y4J145BYDw9o/YEmeJyqh8blgnZwuz9k234zuWc=", @@ -1497,7 +1541,7 @@ }, "nixpkgs-wayland": { "inputs": { - "flake-compat": "flake-compat_6", + "flake-compat": "flake-compat_7", "lib-aggregate": "lib-aggregate", "nix-eval-jobs": "nix-eval-jobs", "nixpkgs": "nixpkgs_13" @@ -1874,11 +1918,11 @@ }, "pre-commit-hooks-nix_3": { "inputs": { - "flake-compat": "flake-compat_7", - "flake-utils": "flake-utils_7", - "gitignore": "gitignore_3", + "flake-compat": "flake-compat_8", + "flake-utils": "flake-utils_8", + "gitignore": "gitignore_4", "nixpkgs": "nixpkgs_14", - "nixpkgs-stable": "nixpkgs-stable_3" + "nixpkgs-stable": "nixpkgs-stable_4" }, "locked": { "lastModified": 1710923068, @@ -1921,6 +1965,34 @@ "type": "github" } }, + "pre-commit-hooks_3": { + "inputs": { + "flake-compat": "flake-compat_6", + "flake-utils": [ + "nix-wallpaper", + "flake-utils" + ], + "gitignore": "gitignore_3", + "nixpkgs": [ + "nix-wallpaper", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_3" + }, + "locked": { + "lastModified": 1708018599, + "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "pruned-racket-catalog": { "flake": false, "locked": { @@ -1983,7 +2055,7 @@ "hyprland-contrib": "hyprland-contrib", "jovian-nixos": "jovian-nixos", "mensa": "mensa", - "nix-colors": "nix-colors", + "nix-wallpaper": "nix-wallpaper", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_11", "nixpkgs-wayland": "nixpkgs-wayland", @@ -1998,7 +2070,7 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_4" + "nixpkgs-stable": "nixpkgs-stable_5" }, "locked": { "lastModified": 1711249319, @@ -2089,6 +2161,21 @@ "type": "github" } }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": "nixpkgs_5" diff --git a/flake.nix b/flake.nix index 524b48a..f9aff37 100644 --- a/flake.nix +++ b/flake.nix @@ -10,8 +10,11 @@ nixpkgs.url = "nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware"; custom-udev-rules.url = "github:MalteT/custom-udev-rules"; - nix-colors.url = "github:Misterio77/nix-colors"; + nix-wallpaper = { + url = "github:lunik1/nix-wallpaper"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixpkgs-wayland = { url = "github:nix-community/nixpkgs-wayland"; }; @@ -71,6 +74,7 @@ # TODO: Remove once hydra fixes these removed aliases inherit (super.perlPackages) buildPerlPackage; netcat-openbsd = super.libressl.nc; + nix-wallpaper = inputs.nix-wallpaper.packages.x86_64-linux.default; }) (import ./overlays/qmk-udev-rules.nix) ]; @@ -149,7 +153,6 @@ home-manager.verbose = true; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = {inherit (inputs) nix-colors;}; }; nixUnstable = {pkgs, ...}: { nix.registry.nixpkgs.flake = inputs.nixpkgs; diff --git a/modules/deck.nix b/modules/deck.nix index 6ea73ed..07f8c26 100644 --- a/modules/deck.nix +++ b/modules/deck.nix @@ -49,7 +49,7 @@ in { }; }; - home-manager.users.deck.imports = [../users/deck/default.nix inputs.nix-colors.homeManagerModule inputs.hyprland.homeManagerModules.default]; + home-manager.users.deck.imports = [../users/deck/default.nix inputs.hyprland.homeManagerModules.default]; programs.fish.enable = true; services.flatpak.enable = true; diff --git a/modules/malte.nix b/modules/malte.nix index 3400486..d7927c2 100644 --- a/modules/malte.nix +++ b/modules/malte.nix @@ -38,7 +38,7 @@ in { }; users.groups.adbusers = {}; - home-manager.users.malte.imports = [../users/malte/default.nix inputs.nix-colors.homeManagerModule inputs.hyprland.homeManagerModules.default]; + home-manager.users.malte.imports = [../users/malte/default.nix inputs.hyprland.homeManagerModules.default]; programs.fish.enable = true; services.udev.packages = [ diff --git a/pkgs/bemenu-configured.nix b/pkgs/bemenu-configured.nix deleted file mode 100644 index d996804..0000000 --- a/pkgs/bemenu-configured.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - writeShellApplication, - bemenu, - hack-nerdfont, - # Color config - color ? { - base00 = "000000"; - base05 = "ff0000"; - base08 = "00ff00"; - base0D = "0000ff"; - }, - # Command name, - cmd ? "bemenu-run", - ... -}: -writeShellApplication { - name = "bemenu-run-configured"; - runtimeInputs = [ - bemenu - hack-nerdfont - ]; - text = '' - exec ${cmd} -inl80 \ - --fn 'Hack Nerd Font Mono 11' \ - --tb=#${color.base08} \ - --tf=#${color.base00} \ - --fb=#${color.base00} \ - --ff=#${color.base05} \ - --nb=#${color.base00} \ - --nf=#${color.base05} \ - --hb=#${color.base0D} \ - --hf=#${color.base00} \ - "$@" - ''; -} diff --git a/users/malte/default.nix b/users/malte/default.nix index 191aaf9..1237a1b 100644 --- a/users/malte/default.nix +++ b/users/malte/default.nix @@ -1,7 +1,7 @@ { pkgs, + lib, nixosConfig, - nix-colors, ... }: let wrap = name: pkg: postBuild: @@ -115,11 +115,9 @@ in { ./modules/scarlett-solo.nix ./modules/helix.nix ./modules/mpv.nix - ./modules/broot.nix ./modules/hypr.nix ./modules/notes.nix ../modules/restic-backup.nix - ../modules/colors.nix ../modules/profiles-cleanup.nix ]; @@ -127,10 +125,6 @@ in { settings.hyprland.enable = true; settings.mail.enable = true; - # Define my color schemes - colorsLight = nix-colors.colorSchemes."papercolor-light"; - colorsDark = nix-colors.colorSchemes."gruvbox-dark-medium"; - home = { packages = [ @@ -268,6 +262,32 @@ in { include ${nixosConfig.sops.secrets.nix-conf-secrets.path} ''; + services.darkman.lightModeScripts."home-manager-generation" = lib.getExe (pkgs.writeShellApplication { + name = "darkman-switch-light-home-manager-generation"; + runtimeInputs = [pkgs.findutils pkgs.gawk pkgs.home-manager pkgs.coreutils pkgs.bash]; + text = '' + for path in $(home-manager generations | awk '{print $7}'); do + activate="$path/specialisation/light/activate" + if [ -x "$activate" ]; then + echo "$activate" + fi + done | head -n1 | xargs sh + ''; + }); + + services.darkman.darkModeScripts."home-manager-generation" = lib.getExe (pkgs.writeShellApplication { + name = "darkman-switch-dark-home-manager-generation"; + runtimeInputs = [pkgs.findutils pkgs.gawk pkgs.home-manager pkgs.coreutils pkgs.bash]; + text = '' + for path in $(home-manager generations | awk '{print $7}'); do + activate="$path/specialisation/dark/activate" + if [ -x "$activate" ]; then + echo "$activate" + fi + done | head -n1 | xargs sh + ''; + }); + home.stateVersion = "18.09"; }; } diff --git a/users/malte/modules/broot.nix b/users/malte/modules/broot.nix deleted file mode 100644 index 730a393..0000000 --- a/users/malte/modules/broot.nix +++ /dev/null @@ -1,69 +0,0 @@ -_: { - programs.broot = { - enable = true; - enableFishIntegration = true; - settings.skin = { - # TODO: Fix all these colors, make them dependent on config.colors - default = "rgb(235, 219, 178) rgb(40, 40, 40) / rgb(189, 174, 147) rgb(40, 40, 40)"; - tree = "rgb(168, 153, 132) None / rgb(102, 92, 84) None"; - file = "None None / None None Italic"; - directory = "rgb(131, 165, 152) None Bold / rgb(69, 133, 136) None"; - exe = "rgb(184, 187, 38) None"; - link = "rgb(104, 157, 106) None"; - pruning = "rgb(124, 111, 100) None Italic"; - perm__ = "None None"; - perm_r = "rgb(215, 153, 33) None"; - perm_w = "rgb(204, 36, 29) None"; - perm_x = "rgb(152, 151, 26) None"; - owner = "rgb(215, 153, 33) None Bold"; - group = "rgb(215, 153, 33) None"; - count = "rgb(69, 133, 136) rgb(50, 48, 47)"; - dates = "rgb(168, 153, 132) None"; - sparse = "rgb(250, 189,47) None"; - content_extract = "rgb(142, 192, 124) None Italic"; - content_match = "rgb(250, 189, 47) None Bold"; - git_branch = "rgb(250, 189, 47) None Italic"; - git_insertions = "rgb(152, 151, 26) None"; - git_deletions = "rgb(190, 15, 23) None"; - git_status_current = "rgb(60, 56, 54) None"; - git_status_modified = "rgb(152, 151, 26) None"; - git_status_new = "rgb(104, 187, 38) None Bold"; - git_status_ignored = "rgb(213, 196, 161) None"; - git_status_conflicted = "rgb(204, 36, 29) None"; - git_status_other = "rgb(204, 36, 29) None"; - selected_line = "None rgb(60, 56, 54) / None rgb(50, 48, 47)"; - char_match = "rgb(250, 189, 47) None"; - file_error = "rgb(251, 73, 52) None"; - flag_label = "rgb(189, 174, 147) None"; - flag_value = "rgb(211, 134, 155) None Bold"; - input = "cyan None / rgb(189, 174, 147) None Italic"; - status_error = "rgb(213, 196, 161) rgb(204, 36, 29)"; - status_job = "rgb(250, 189, 47) rgb(60, 56, 54)"; - status_normal = "None rgb(50, 48, 47) / None None"; - status_italic = "rgb(211, 134, 155) rgb(50, 48, 47) Italic / None None"; - status_bold = "rgb(211, 134, 155) rgb(50, 48, 47) Bold / None None"; - status_code = "rgb(251, 241, 199) rgb(50, 48, 47) / None None"; - status_ellipsis = "rgb(251, 241, 199) rgb(50, 48, 47) Bold / None None"; - purpose_normal = "None None"; - purpose_italic = "rgb(177, 98, 134) None Italic"; - purpose_bold = "rgb(177, 98, 134) None Bold"; - purpose_ellipsis = "None None"; - scrollbar_track = "rgb(80, 73, 69) None / rgb(50, 48, 47) None"; - scrollbar_thumb = "rgb(213, 196, 161) None / rgb(102, 92, 84) None"; - help_paragraph = "None None"; - help_bold = "rgb(214, 93, 14) None Bold"; - help_italic = "rgb(211, 134, 155) None Italic"; - help_code = "rgb(142, 192, 124) rgb(50, 48, 47)"; - help_headers = "rgb(254, 128, 25) None Bold"; - help_table_border = "rgb(80, 73, 69) None"; - preview = "rgb(235, 219, 178) rgb(40, 40, 40) / rgb(235, 219, 178) rgb(40, 40, 40)"; - preview_line_number = "rgb(124, 111, 100) None / rgb(124, 111, 100) rgb(40, 40, 40)"; - preview_match = "None rgb(80, 73, 69) Bold Underlined"; - hex_null = "rgb(189, 174, 147) None"; - hex_ascii_graphic = "rgb(213, 196, 161) None"; - hex_ascii_whitespace = "rgb(152, 151, 26) None"; - hex_ascii_other = "rgb(254, 128, 25) None"; - hex_non_ascii = "rgb(214, 93, 14) None"; - }; - }; -} diff --git a/users/malte/modules/git.nix b/users/malte/modules/git.nix index 6dc6cf3..0db1be7 100644 --- a/users/malte/modules/git.nix +++ b/users/malte/modules/git.nix @@ -1,7 +1,9 @@ -{pkgs, ...}: let +{ + pkgs, + lib, + ... +}: let conf = import ./conf.nix; - configDir = "~/.config/git"; - deltaConfig = "${configDir}/delta"; lightDeltaConf = pkgs.writeText "light-delta-conf" '' [delta] @@ -29,9 +31,6 @@ plus-style = "syntax '#302f29'" syntax-theme = "gruvbox-dark" ''; - linkDeltaConfig = conf: '' - ${pkgs.coreutils}/bin/ln -sf ${conf} ${deltaConfig} - ''; in { programs.git = { enable = true; @@ -44,7 +43,7 @@ in { extraConfig = { pull.rebase = true; init.defaultBranch = "main"; - include.path = deltaConfig; + include.path = "~/.config/git/delta"; rerere.enabled = true; }; @@ -56,12 +55,13 @@ in { }; programs.fish.shellAbbrs.lg = "lazygit"; - services.darkman.lightModeScripts."git-delta.sh" = '' - mkdir -p ${configDir} - ${linkDeltaConfig lightDeltaConf} - ''; - services.darkman.darkModeScripts."git-delta.sh" = '' - mkdir -p ${configDir} - ${linkDeltaConfig darkDeltaConf} - ''; + xdg.configFile."git/delta".source = lib.mkDefault darkDeltaConf; + + specialisation.light.configuration = { + xdg.configFile."git/delta".source = lightDeltaConf; + }; + + specialisation.dark.configuration = { + xdg.configFile."git/delta".source = darkDeltaConf; + }; } diff --git a/users/malte/modules/gruvbox_dark.conf b/users/malte/modules/gruvbox_dark.conf deleted file mode 100644 index 369da8d..0000000 --- a/users/malte/modules/gruvbox_dark.conf +++ /dev/null @@ -1,49 +0,0 @@ -# gruvbox dark by morhetz, https://github.com/morhetz/gruvbox -# This work is licensed under the terms of the MIT license. -# For a copy, see https://opensource.org/licenses/MIT. - -background #282828 -foreground #ebdbb2 - -cursor #928374 - -selection_foreground #928374 -selection_background #3c3836 - -color0 #282828 -color8 #928374 - -# red -color1 #cc241d -# light red -color9 #fb4934 - -# green -color2 #98971a -# light green -color10 #b8bb26 - -# yellow -color3 #d79921 -# light yellow -color11 #fabd2d - -# blue -color4 #458588 -# light blue -color12 #83a598 - -# magenta -color5 #b16286 -# light magenta -color13 #d3869b - -# cyan -color6 #689d6a -# lighy cyan -color14 #8ec07c - -# light gray -color7 #a89984 -# dark gray -color15 #928374 diff --git a/users/malte/modules/gruvbox_light.conf b/users/malte/modules/gruvbox_light.conf deleted file mode 100644 index 6d8b89b..0000000 --- a/users/malte/modules/gruvbox_light.conf +++ /dev/null @@ -1,49 +0,0 @@ -# gruvbox light by morhetz, https://github.com/morhetz/gruvbox -# This work is licensed under the terms of the MIT license. -# For a copy, see https://opensource.org/licenses/MIT. - -background #fbf1c7 -foreground #3c3836 - -cursor #928374 - -selection_foreground #3c3836 -selection_background #928374 - -color0 #fbf1c7 -color8 #282828 - -# red -color1 #cc241d -# light red -color9 #9d0006 - -# green -color2 #98971a -# light green -color10 #79740e - -# yellow -color3 #d79921 -# light yellow -color11 #b57614 - -# blue -color4 #458588 -# light blue -color12 #076678 - -# magenta -color5 #b16286 -# light magenta -color13 #8f3f71 - -# cyan -color6 #689d6a -# lighy cyan -color14 #427b58 - -# light gray -color7 #7c6f64 -# dark gray -color15 #928374 diff --git a/users/malte/modules/gtk.nix b/users/malte/modules/gtk.nix index 95d0ea1..5761cd4 100644 --- a/users/malte/modules/gtk.nix +++ b/users/malte/modules/gtk.nix @@ -1,22 +1,49 @@ { pkgs, + lib, config, - nix-colors, ... }: let - inherit (nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme; -in { - home.packages = [ - (gtkThemeFromScheme {scheme = config.colorsLight;}) - (gtkThemeFromScheme {scheme = config.colorsDark;}) - ]; + theme = { + dark = { + name = "Gruvbox-Dark-B"; + package = pkgs.gruvbox-gtk-theme; + }; + light = { + name = "Catppuccin-Latte-Compact-Teal-Light-hdpi"; + package = pkgs.catppuccin-gtk.override { + accents = ["teal"]; + size = "compact"; + variant = "macchiato"; + }; + }; + }; + icons = { + dark = { + name = "Gruvbox-Plus-Dark"; + package = pkgs.gruvbox-plus-icons; + }; + light = { + name = "Zafiro-icons-Light"; + package = pkgs.zafiro-icons; + }; + }; + + gtk4ExtraCss = { + light = ""; + dark = '' + .navigation-sidebar { + background-color: rgb(29,32,33); + } + ''; + }; +in { gtk = { enable = true; - iconTheme = { - package = pkgs.pop-icon-theme; - name = "Pop-Mono-Dark"; - }; + + theme = lib.mkDefault theme.dark; + iconTheme = lib.mkDefault icons.dark; gtk3.bookmarks = [ "file:///home/malte/repos" @@ -24,12 +51,26 @@ in { "sftp://games@dataship.tail6cfa3.ts.net:2022 TheGim-Games" "sftp://malte@dataship.tail6cfa3.ts.net:2022 TheGim-Data" ]; + + gtk4.extraCss = lib.mkDefault gtk4ExtraCss.dark; }; - services.darkman.lightModeScripts."gtk.sh" = '' - ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/gtk-theme "'${config.colorsLight.slug}'" - ''; - services.darkman.darkModeScripts."gtk.sh" = '' - ${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/gtk-theme "'${config.colorsDark.slug}'" - ''; + # Now symlink the `~/.config/gtk-4.0/` folder declaratively: + xdg.configFile = { + "gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets"; + "gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css"; + "gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css"; + }; + + specialisation.light.configuration = { + gtk.theme = theme.light; + gtk.iconTheme = icons.light; + gtk.gtk4.extraCss = gtk4ExtraCss.light; + }; + + specialisation.dark.configuration = { + gtk.theme = theme.dark; + gtk.iconTheme = icons.dark; + gtk.gtk4.extraCss = gtk4ExtraCss.dark; + }; } diff --git a/users/malte/modules/helix.nix b/users/malte/modules/helix.nix index e9e4bdd..cf98628 100644 --- a/users/malte/modules/helix.nix +++ b/users/malte/modules/helix.nix @@ -3,19 +3,13 @@ lib, ... }: let - tomlFormat = pkgs.formats.toml {}; - configFilePath = "~/.config/helix/config.toml"; - installConfig = file: '' - ${pkgs.coreutils}/bin/ln -sf ${file} ${configFilePath} - ''; - - lightConfig = { - theme = "papercolor-light"; + helixConfig = { + theme = lib.mkDefault "gruvbox"; editor = { line-number = "relative"; mouse = true; #cursorline = true; - #color-modes = true; + color-modes = true; cursor-shape = { insert = "bar"; }; @@ -28,14 +22,8 @@ o.j = ":pipe ${pkgs.jq}/bin/jq --sort-keys --indent 4"; }; }; - lightConfigFile = tomlFormat.generate "config.toml" lightConfig; - darkConfig = lib.recursiveUpdate lightConfig { - theme = "gruvbox"; - }; - darkConfigFile = tomlFormat.generate "config.toml" darkConfig; - - extraLanguages = (pkgs.formats.toml {}).generate "languages.toml" { + extraHelixLanguages = { language-server = { beancount-language-server = { name = "beancount-language-server"; @@ -105,28 +93,28 @@ ]; }; in { - home.packages = with pkgs; [ - helix - # Some helpful language servers - yaml-language-server - python311Packages.python-lsp-server - nodePackages.bash-language-server - taplo-lsp - ]; + programs.helix = { + enable = true; + defaultEditor = true; + languages = extraHelixLanguages; + settings = helixConfig; + extraPackages = [ + pkgs.yaml-language-server + pkgs.python311Packages.python-lsp-server + pkgs.nodePackages.bash-language-server + pkgs.taplo-lsp + ]; + }; home.sessionVariables = { - EDITOR = "${pkgs.helix}/bin/hx"; VISUAL = "${pkgs.kitty}/bin/kitty ${pkgs.helix}/bin/hx"; }; - xdg.configFile."helix/languages.toml".source = extraLanguages; + specialisation.light.configuration = { + programs.helix.settings.theme = "catppuccin_latte"; + }; - services.darkman.lightModeScripts."helix.sh" = '' - mkdir -p $(dirname ${configFilePath}) - ${installConfig lightConfigFile} - ''; - services.darkman.darkModeScripts."helix.sh" = '' - mkdir -p $(dirname ${configFilePath}) - ${installConfig darkConfigFile} - ''; + specialisation.dark.configuration = { + programs.helix.settings.theme = "gruvbox"; + }; } diff --git a/users/malte/modules/hypr.nix b/users/malte/modules/hypr.nix index f26b6d3..dc9dcbd 100644 --- a/users/malte/modules/hypr.nix +++ b/users/malte/modules/hypr.nix @@ -7,25 +7,42 @@ }: let cfg = config.settings.hyprland; - bemenu = pkgs.callPackage ../../../pkgs/bemenu-configured.nix {color = config.colorsDark.palette;}; doNotDisturb = pkgs.callPackage ../../../pkgs/do-not-disturb.nix {}; - wallpaper = [ - (pkgs.fetchurl { - url = "https://images.pexels.com/photos/7565653/pexels-photo-7565653.jpeg?cs=srgb&dl=pexels-shvets-production-7565653.jpg&fm=jpg"; - hash = "sha256-x84h0tjHXJw/7yP4Wh6j5oD4XSSs7V5nOyIJRTkEUJM="; - }) - (pkgs.fetchurl { - url = "https://images.pexels.com/photos/12604899/pexels-photo-12604899.jpeg?cs=srgb&dl=pexels-hilal-b%C3%BClb%C3%BCl-12604899.jpg&fm=jpg"; - hash = "sha256-dMNelRuFfvdqXOQHyoTFszFtN7+4bWUlRwg5+cRKnEQ="; - }) - ]; + background = { + light = pkgs.nix-wallpaper.override { + preset = "catppuccin-latte-rainbow"; + width = 3840; + height = 2160; + }; + dark = pkgs.nix-wallpaper.override { + preset = "gruvbox-dark-rainbow"; + width = 3840; + height = 2160; + }; + }; - hyprpaperConfig = '' - preload = ${builtins.elemAt wallpaper 0} - wallpaper = HDMI-A-1,${builtins.elemAt wallpaper 0} - preload = ${builtins.elemAt wallpaper 1} - wallpaper = HDMI-A-2,${builtins.elemAt wallpaper 1} + monitors = + if nixosConfig.networking.hostName == "helix-texta" + then { + eDP-1 = { + background.light = "${background.light}/share/wallpapers/nixos-wallpaper.png"; + background.dark = "${background.dark}/share/wallpapers/nixos-wallpaper.png"; + }; + } + else if nixosConfig.networking.hostName == "murex-pecten" + then { + } + else {}; + + hyprpaperConfig = builtins.concatStringsSep "\n" (lib.mapAttrsToList (_: config: '' + preload = ${config.background.light} + preload = ${config.background.dark} + '') + monitors); + + mkHyprpaperSwitch = monitor: bg: '' + ${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ${monitor},${bg} ''; wobFifo = "~/.local/share/wob/fifo"; @@ -113,9 +130,8 @@ "$green" = "98971a"; exec-once = [ "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" - "${pkgs.waybar}/bin/waybar" - "${pkgs.hyprpaper}/bin/hyprpaper" - "${runWob}/bin/run-wob" + "${lib.getExe pkgs.hyprpaper}" + "${lib.getExe runWob}" ]; input = { kb_variant = @@ -126,6 +142,7 @@ else ""; kb_options = "compose:ralt"; kb_rules = ""; + resolve_binds_by_sym = "1"; follow_mouse = "1"; sensitivity = "0"; @@ -158,11 +175,11 @@ general = { # See https://wiki.hyprland.org/Configuring/Variables/ for more - gaps_in = 3; - gaps_out = 3; + gaps_in = 5; + gaps_out = 5; border_size = 1; "col.active_border" = "rgba($bluecc) rgba($greencc) 45deg"; - "col.inactive_border" = "rgba(282828cc)"; + "col.inactive_border" = "rgba(bdae93cc)"; layout = "dwindle"; }; @@ -313,10 +330,10 @@ "bind = $mainMod, mouse_down, workspace, e+1" "bind = $mainMod, mouse_up, workspace, e-1" # Menu - "$mainMod, D, exec, ${bemenu}/bin/bemenu-run-configured -p 'Program:'" + "$mainMod, D, exec, ${lib.getExe pkgs.rofi-wayland} -show run" # Passwords - "$mainMod, P, exec, passmenu-bemenu" + "$mainMod, P, exec, ${lib.getExe pkgs.rofi-pass-wayland}" # Colorpicker "$mainMod SHIFT, C, exec, ${pkgs.hyprpicker}/bin/hyprpicker -a" @@ -377,14 +394,9 @@ in { home.packages = [ pkgs.hyprpicker pkgs.grimblast + pkgs.hyprpaper ]; - home.pointerCursor = { - package = pkgs.vanilla-dmz; - name = "Vanilla-DMZ"; - size = 48; - }; - # If running from tty1 start hyprland xdg.configFile."fish/conf.d/hyprland.fish".text = '' set TTY1 (tty) @@ -397,5 +409,8 @@ in { xdg.configFile."hypr/hyprpaper.conf".text = hyprpaperConfig; # Configure wob xdg.configFile."wob/wob.ini".text = wobConfig; + + services.darkman.lightModeScripts."hyprpaper" = builtins.concatStringsSep "\n" (lib.mapAttrsToList (monitor: config: mkHyprpaperSwitch monitor config.background.light) monitors); + services.darkman.darkModeScripts."hyprpaper" = builtins.concatStringsSep "\n" (lib.mapAttrsToList (monitor: config: mkHyprpaperSwitch monitor config.background.dark) monitors); }; } diff --git a/users/malte/modules/kitty.nix b/users/malte/modules/kitty.nix index a8d46ef..96c6a64 100644 --- a/users/malte/modules/kitty.nix +++ b/users/malte/modules/kitty.nix @@ -1,18 +1,11 @@ -{pkgs, ...}: let - darkTheme = pkgs.writeTextFile { - name = "kitty-dark"; - text = builtins.readFile ./gruvbox_dark.conf; - }; - lightTheme = pkgs.writeTextFile { - name = "kitty-light"; - text = builtins.readFile ./gruvbox_light.conf; - }; - configDir = "~/.config/kitty"; - themeConfigFile = "theme.conf"; - loadTheme = name: "${pkgs.kitty}/bin/kitty +kitten themes --reload-in=all --config-file-name=${themeConfigFile} '${name}'"; -in { +{ + pkgs, + lib, + ... +}: { programs.kitty = { enable = true; + theme = lib.mkDefault "Gruvbox Dark"; font = { name = "Hack Nerd Font Mono"; @@ -29,21 +22,13 @@ in { remember_window_size = false; text_composition_strategy = "2.0 0"; }; - - extraConfig = '' - include ${themeConfigFile} - ''; }; - xdg.configFile."kitty/themes/Light.conf".source = lightTheme; - xdg.configFile."kitty/themes/Dark.conf".source = darkTheme; + specialisation.light.configuration = { + programs.kitty.theme = "Catppuccin-Latte"; + }; - services.darkman.lightModeScripts."kitty.sh" = '' - mkdir -p ${configDir} - ${loadTheme "PaperColor Light"} - ''; - services.darkman.darkModeScripts."kitty.sh" = '' - mkdir -p ${configDir} - ${loadTheme "Gruvbox Dark"} - ''; + specialisation.dark.configuration = { + programs.kitty.theme = "Gruvbox Dark"; + }; } diff --git a/users/malte/modules/mail.nix b/users/malte/modules/mail.nix index 4128048..0d79ff9 100644 --- a/users/malte/modules/mail.nix +++ b/users/malte/modules/mail.nix @@ -34,14 +34,14 @@ # Virtual mailboxes governed by notmuch virtualMailboxes = '' unvirtual-mailboxes "My INBOX" - virtual-mailboxes " INBOX" "notmuch://?query=tag:inbox%20and%20not%20tag:trash%20and%20not%20tag:junk" + virtual-mailboxes "󰚇 INBOX" "notmuch://?query=tag:inbox%20and%20not%20tag:trash%20and%20not%20tag:junk" virtual-mailboxes " FLAGGED" "notmuch://?query=tag:flagged%20and%20not%20tag:trash%20and%20not%20tag:junk" - virtual-mailboxes " ARCHIVE" "notmuch://?query=tag:archive%20and%20not%20tag:trash%20and%20not%20tag:junk" - virtual-mailboxes "黎SENT" "notmuch://?query=tag:sent%20and%20not%20tag:trash%20and%20not%20tag:junk" - virtual-mailboxes " DRAFT" "notmuch://?query=tag:draft%20and%20not%20tag:trash%20and%20not%20tag:junk" - virtual-mailboxes " ATTACHMENT" "notmuch://?query=tag:attachment%20and%20not%20tag:trash%20and%20not%20tag:junk" + virtual-mailboxes " ARCHIVE" "notmuch://?query=tag:archive%20and%20not%20tag:trash%20and%20not%20tag:junk" + virtual-mailboxes "󰒊 SENT" "notmuch://?query=tag:sent%20and%20not%20tag:trash%20and%20not%20tag:junk" + virtual-mailboxes " DRAFT" "notmuch://?query=tag:draft%20and%20not%20tag:trash%20and%20not%20tag:junk" + virtual-mailboxes " ATTACHMENT" "notmuch://?query=tag:attachment%20and%20not%20tag:trash%20and%20not%20tag:junk" virtual-mailboxes " TRASH" "notmuch://?query=tag:trash" - virtual-mailboxes " JUNK" "notmuch://?query=tag:junk" + virtual-mailboxes " JUNK" "notmuch://?query=tag:junk" ''; # Color definitions for neomutt @@ -302,9 +302,9 @@ in { # Don't show the help menu help = "false"; # Configure some formats - to_chars = realStr " R"; - crypt_chars = realStr " "; - flag_chars = realStr "   "; + to_chars = realStr " 󰀄󰀎󰗍R"; + crypt_chars = realStr "󰷥󰏪 "; + flag_chars = realStr "DdOo- "; date_format = realStr "!%A, %b %d %Y %H:%M:%S %Z"; index_format = realStr " %S %T %zc %<[y?%<[m?%<[d?%{ %H:%M}&%{ %a %d}>&%{%b %d}>&%{ %m/%y}> %-25.25L %s %> %g"; pager_format = realStr "-%S %T %zc ---[%C/%m]---[%g]%*-(%P)-"; diff --git a/users/malte/modules/mako.nix b/users/malte/modules/mako.nix index a9fe96f..9731363 100644 --- a/users/malte/modules/mako.nix +++ b/users/malte/modules/mako.nix @@ -1,62 +1,104 @@ { pkgs, - config, + lib, ... }: let - colDark = name: "#${config.colorsDark.palette.${name}}"; doNotDisturb = pkgs.callPackage ../../../pkgs/do-not-disturb.nix {}; -in { - services.mako = { + + theme = { + dark = { + base00 = "282828"; + base01 = "3c3836"; + base02 = "504945"; + base03 = "665c54"; + base04 = "bdae93"; + base05 = "d5c4a1"; + base06 = "ebdbb2"; + base07 = "fbf1c7"; + base08 = "fb4934"; + base09 = "fe8019"; + base0A = "fabd2f"; + base0B = "b8bb26"; + base0C = "8ec07c"; + base0D = "83a598"; + base0E = "d3869b"; + base0F = "d65d0e"; + }; + light = { + base00 = "eff1f5"; + base01 = "e6e9ef"; + base02 = "ccd0da"; + base03 = "bcc0cc"; + base04 = "acb0be"; + base05 = "4c4f69"; + base06 = "dc8a78"; + base07 = "7287fd"; + base08 = "d20f39"; + base09 = "fe640b"; + base0A = "df8e1d"; + base0B = "40a02b"; + base0C = "179299"; + base0D = "1e66f5"; + base0E = "8839ef"; + base0F = "dd7878"; + }; + }; + + mkMakoConfig = theme: let + col = name: "#${theme.${name}}"; + in { enable = true; anchor = "top-right"; font = "Hack Nerd Font Mono 11"; - backgroundColor = colDark "base05"; - textColor = colDark "base00"; - borderColor = colDark "base00"; borderSize = 1; borderRadius = 3; defaultTimeout = 4000; width = 400; height = 500; - format = '' - %a\n%s %b''; layer = "overlay"; margin = "5"; padding = "6"; + backgroundColor = col "base05"; + textColor = col "base00"; + borderColor = col "base00"; + format = '' + %a\n%s %b''; extraConfig = '' outer-margin=0 [urgency=low] default-timeout=3000 - background-color=${colDark "base04"} + background-color=${col "base04"} [urgency=normal] - background-color=${colDark "base0E"} + background-color=${col "base0E"} [urgency=high] default-timeout=10000 - background-color=${colDark "base08"} + background-color=${col "base08"} [actionable] - format=%a  \n%s %b + format=%a 󰳽 \n%s %b [hidden] - background-color=${colDark "base04"} + background-color=${col "base04"} format=... %h more [mode=do-not-disturb] invisible=1 [app-name=fish urgency=normal] - background-color=${colDark "base0B"} + background-color=${col "base0B"} format= %s\n%b [app-name=fish urgency=critical] - background-color=${colDark "base08"} + background-color=${col "base08"} format= %s\n%b ''; }; +in { + services.mako = lib.mkDefault (mkMakoConfig theme.dark); # This should really use the upstream service file, but I'm too lazy # https://github.com/emersion/mako/blob/aafbc91da038e5a6ebab67a66a644487db3410d7/contrib/systemd/mako.service @@ -82,4 +124,12 @@ in { pkgs.hack-nerdfont doNotDisturb ]; + + specialisation.light.configuration = { + services.mako = mkMakoConfig theme.light; + }; + + specialisation.dark.configuration = { + services.mako = mkMakoConfig theme.dark; + }; } diff --git a/users/malte/modules/mpv.nix b/users/malte/modules/mpv.nix index d7f932e..fb6e963 100644 --- a/users/malte/modules/mpv.nix +++ b/users/malte/modules/mpv.nix @@ -1,16 +1,9 @@ -{ - pkgs, - config, - ... -}: let - colDark = config.colorsDark.palette; -in { +{pkgs, ...}: { programs.mpv = { enable = true; package = pkgs.mpv; config = { sub-color = "#fcc437"; - sub-border-color = "#${colDark.base00}"; sub-border-size = 1; sub-font-size = 45; af-add = "@normalize51:!lavfi=[pan=6c|c0=c0+0.2*c2|c1=c1+0.2*c2|c2=2*c2|c3=c3|c4=c4+0.2*c2|c5=c5+0.2*c2]"; diff --git a/users/malte/modules/pass.nix b/users/malte/modules/pass.nix index e916cae..4e1ebf2 100644 --- a/users/malte/modules/pass.nix +++ b/users/malte/modules/pass.nix @@ -1,38 +1,4 @@ -{ - pkgs, - config, - ... -}: let - bemenuConfigured = pkgs.callPackage ../../../pkgs/bemenu-configured.nix { - color = config.colorsDark.palette; - cmd = "bemenu"; - }; - - passmenu-bemenu = pkgs.writeShellApplication { - name = "passmenu-bemenu"; - runtimeInputs = [ - bemenuConfigured - pkgs.fd - pkgs.gnused - pkgs.libnotify - pkgs.pass - pkgs.wl-clipboard - ]; - text = '' - PREFIX=~/.local/share/password-store/ - SUFFIX=.gpg - - selection=$( fd '.gpg' "$PREFIX" \ - | sed "s|$PREFIX||" \ - | sed "s|$SUFFIX||" \ - | bemenu-run-configured -p 'Password:' ) - - PASSWORD_STORE_DIR="$PREFIX" pass show "$selection" | wl-copy -o || exit 2 - - notify-send -u low -a Pass "$selection" "Copied to clipboard" - ''; - }; -in { +{pkgs, ...}: { programs.password-store = { enable = true; package = pkgs.pass.withExtensions (exts: [ @@ -49,5 +15,5 @@ in { # Install pass-ff extension required file: home.file.".mozilla/native-messaging-hosts/passff.json".source = "${pkgs.passff-host}/share/passff-host/passff.json"; - home.packages = [passmenu-bemenu pkgs.hack-nerdfont]; + home.packages = [pkgs.rofi-pass-wayland pkgs.hack-nerdfont]; } diff --git a/users/malte/modules/qt.nix b/users/malte/modules/qt.nix index 9613ad1..c424c40 100644 --- a/users/malte/modules/qt.nix +++ b/users/malte/modules/qt.nix @@ -1,6 +1,6 @@ _: { qt = { enable = true; - platformTheme = "gtk"; + platformTheme = "gtk3"; }; } diff --git a/users/malte/modules/shell.nix b/users/malte/modules/shell.nix index 8bbf34f..4ed3ffa 100644 --- a/users/malte/modules/shell.nix +++ b/users/malte/modules/shell.nix @@ -1,9 +1,8 @@ -{pkgs, ...}: let - setBatTheme = theme: '' - mkdir -p ~/.config/bat - echo '--theme=${theme}' > ~/.config/bat/config - ''; -in { +{ + pkgs, + lib, + ... +}: { home.packages = with pkgs; [ bottom fd @@ -145,6 +144,20 @@ in { programs.bat = { enable = true; + config = { + theme = lib.mkDefault "gruvbox-dark"; + }; + themes = { + catppuccin-latte = { + src = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "bat"; + rev = "b8134f0"; + hash = "sha256-gzf0/Ltw8mGMsEFBTUuN33MSFtUP4xhdxfoZFntaycQ="; + }; + file = "themes/Catppuccin Latte.tmTheme"; + }; + }; }; programs.nix-index = { @@ -164,10 +177,11 @@ in { }; }; - services.darkman.darkModeScripts."bat.sh" = '' - ${setBatTheme "gruvbox-dark"} - ''; - services.darkman.lightModeScripts."bat.sh" = '' - ${setBatTheme "base16-256"} - ''; + specialisation.light.configuration = { + programs.bat.config.theme = "catppuccin-latte"; + }; + + specialisation.dark.configuration = { + programs.bat.config.theme = "gruvbox-dark"; + }; } diff --git a/users/malte/modules/waybar.nix b/users/malte/modules/waybar.nix index 5b4805d..bc04ec7 100644 --- a/users/malte/modules/waybar.nix +++ b/users/malte/modules/waybar.nix @@ -1,12 +1,240 @@ { pkgs, lib, - config, nixosConfig, ... }: let - mkBorder = hex: ((config.myLib.mkColor hex).darker 0.4).hashRgb; - col = config.colorsDark.palette; + rofi = let + raw = "${pkgs.rofi-wayland}/bin/rofi"; + themes = pkgs.fetchFromGitHub { + owner = "adi1090x"; + repo = "rofi"; + rev = "7e236dd"; + hash = "sha256-K6WQ+olSy6Rorof/EGi9hP2WQpRONjuGREby+aBlzYg="; + }; + theme = "${themes}/files/launchers/type-6/style-4.rasi"; + in { + launcher = pkgs.writeScript "rofi-launcher" '' + ${raw} -show drun -theme ${theme} + ''; + }; + + lightColors = pkgs.writeText "colors.scss" '' + $active: #40a02b; + $base: #dce0e8; + $clock: #209fb5; + $error: #e64553; + $muted: #7c7f93; + $relevant: #8839ef; + $text: #4c4f69; + $warn: #df8e1d; + ''; + + darkColors = pkgs.writeText "colors.scss" '' + $active: #b8bb26; + $base: #1d2021; + $clock: #458588; + $error: #fb4934; + $muted: #928374; + $relevant: #b16286; + $text: #ebdbb2; + $warn: #d65d0e; + ''; + + style = { + light = pkgs.concatTextFile { + name = "style.scss"; + files = [lightColors styleRaw]; + }; + dark = pkgs.concatTextFile { + name = "style.scss"; + files = [darkColors styleRaw]; + }; + }; + + compiledCssStyle = { + light = builtins.readFile ((pkgs.runCommand "compiled-waybar-sass" {} '' + mkdir "$out" + ${pkgs.dart-sass}/bin/dart-sass ${style.light} "$out/style.css" + '') + + /style.css); + dark = builtins.readFile ((pkgs.runCommand "compiled-waybar-sass" {} '' + mkdir "$out" + ${pkgs.dart-sass}/bin/dart-sass ${style.dark} "$out/style.css" + '') + + /style.css); + }; + + styleRaw = pkgs.writeText "style.scss" '' + $radius: 3px; + + @mixin block-left-end { + margin-left: 5px; + border-top-left-radius: $radius; + border-bottom-left-radius: $radius; + } + + @mixin block-right-end { + margin-right: 5px; + border-top-right-radius: $radius; + border-bottom-right-radius: $radius; + } + + @mixin element { + background: $base; + /*opacity: 0.9;*/ + padding: 0px 10px; + margin: 0px; + margin-top: 3px; + + } + + * { + border: none; + border-radius: 0; + font-family: "Hack Nerd Font"; + font-weight: bold; + font-size: 12px; + min-height: 0; + } + + window#waybar { + background: transparent; + color: $text; + } + + tooltip { + background: $base; + color: $text; + border-radius: $radius; + border-width: 2px; + border-style: solid; + border-color: $muted; + } + + #custom-rofi { + @include element; + @include block-left-end; + background-color: transparent; + } + + #clock { + @include element; + @include block-left-end; + @include block-right-end; + color: $clock; + } + + #workspaces { + @include element; + @include block-left-end; + @include block-right-end; + /*background: $base;*/ + + button { + padding: 3px; + color: $muted; + margin-right: 3px; + } + + button.active { + color: $active; + } + + button.focused { + color: $active; + background: $warn; + border-radius: $radius; + } + + button.urgent { + color: $base; + background: $warn; + border-radius: $radius; + } + + button:hover { + color: $active; + border-radius: $radius; + border: none; + } + } + + #window { + @include element; + @include block-left-end; + @include block-right-end; + + window#waybar.empty & { + padding: 0px; + margin: 0px; + background-color: transparent; + } + } + + #custom-new-mail { + @include element; + @include block-left-end; + @include block-right-end; + color: $warn; + } + + #network { + @include element; + @include block-left-end; + color: $muted; + + &.disconnected { + color: $error; + } + + &.wifi { + color: $relevant; + } + } + + #temperature { + @include element; + color: $muted; + + &.critical { + color: $warn; + } + } + + #memory { + @include element; + color: $muted; + } + + #battery { + @include element; + @include block-right-end; + color: $muted; + } + + #pulseaudio { + @include element; + @include block-left-end; + color: $relevant; + + &.muted { + color: $muted; + } + } + + #backlight { + @include element; + @include block-right-end; + color: $muted; + } + + #tray { + @include element; + @include block-left-end; + @include block-right-end; + } + ''; doNotDisturbJson = pkgs.writeShellApplication { name = "do-not-disturb-json"; @@ -18,7 +246,7 @@ text = '' state=$(do-not-disturb get-file) if [ -f "$state" ]; then - printf "{ \"text\": \" \", \ + printf "{ \"text\": \" \", \ \"tooltip\": \"DO NOT DISTURB!\" \ }" | jq --unbuffered --compact-output fi @@ -35,8 +263,8 @@ count=$(${notmuch} search tag:unread | ${wc} -l) if [[ $count -ne 0 ]]; then - echo "{ \"text\": \" \", \ - \"tooltip\": \"$count\" \ + echo "{ \"text\": \"󰛮 $count\", \ + \"tooltip\": \"New Mails: $count\" \ }" | ${jq} --unbuffered --compact-output fi ''; @@ -69,287 +297,165 @@ fi ''; in { - home.packages = [pkgs.hack-nerdfont]; - programs.waybar = { enable = true; + style = lib.mkDefault compiledCssStyle.dark; - settings = [ + settings = let + ordered = attrs: list: lib.throwIfNot (builtins.all (name: lib.throwIfNot (builtins.hasAttr name attrs) "Attrset missing member '${name}'" true) list) "Attrset missing member" list; + + modules-left = { + "custom/rofi" = { + format = " {icon} "; + format-icons = ""; + on-click = rofi.launcher; + }; + "clock" = { + format = "󰥔 {:%H:%M %A, %e. %B}"; + interval = 60; + }; + "hyprland/workspaces" = { + disable-scroll = true; + all-outputs = true; + on-click = "activate"; + format = "{icon}"; + format-icons = { + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + }; + }; + "hyprland/window" = { + tooltip = false; + max-length = 100; + }; + }; + + modules-center = {}; + + modules-right = { + "custom/check-system" = { + exec = "${checkSystem}/bin/check-system"; + return-type = "json"; + interval = 5; + }; + "custom/do-not-disturb" = { + exec = "${doNotDisturbJson}/bin/do-not-disturb-json"; + return-type = "json"; + interval = 1; + }; + "custom/new-mail" = { + exec = "${new-mail}/bin/new-mail"; + return-type = "json"; + interval = 1; + }; + "battery" = { + "states" = { + "good" = 95; + "warning" = 30; + "critical" = 20; + }; + "format" = "{icon} {capacity}%"; + "format-charging" = " {capacity}%"; + "format-plugged" = " {capacity}%"; + "format-alt" = "{time} {icon}"; + "format-icons" = ["󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󱈑"]; + }; + "memory" = { + "interval" = 30; + "format" = " {percentage}%"; + "max-length" = 10; + "tooltip" = true; + "tooltip-format" = "Memory - {used:0.1f}GB used"; + "on-click" = "${pkgs.kitty}/bin/kitty -e ${pkgs.btop}/bin/btop"; + }; + "network" = { + "format-wifi" = "󰘊 {essid} ({signalStrength}%)"; + "format-ethernet" = "{ipaddr}/{cidr} 󰈀 "; + "tooltip-format" = "{essid} - {ifname} via {gwaddr}"; + "format-linked" = "{ifname} (No IP)"; + "format-disconnected" = ""; + "format-alt" = "{ifname}={essid} {ipaddr}/{cidr}"; + "on-click-right" = "~/.config/rofi/bin/network"; + }; + backlight = { + device = "intel_backlight"; + format = "{icon} {percent}"; + format-icons = ["󰃞" "󰃟" "󰃠"]; + on-scroll-down = "${pkgs.light}/bin/light -A 1"; + on-scroll-up = "${pkgs.light}/bin/light -U 1"; + }; + + "pulseaudio" = { + "format" = "{icon} {volume}"; + "tooltip" = true; + "format-muted" = " Muted"; + "on-click" = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "on-click-right" = "pavucontrol"; + "on-scroll-up" = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+"; + "on-scroll-down" = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-"; + "scroll-step" = 5; + "format-icons" = { + "headphone" = ""; + "hands-free" = ""; + "headset" = ""; + "phone" = ""; + "portable" = ""; + "car" = ""; + "default" = ["" "" ""]; + }; + }; + "tray" = { + icon-size = 12; + spacing = 10; + }; + temperature = { + format = " {temperatureC}°C"; + critical-threshold = 70; + }; + }; + in [ { layer = "top"; position = "top"; - - modules-left = ["hyprland/workspaces" "hyprland/window"]; - modules-center = ["clock#time" "custom/check-system" "clock#date"]; - modules-right = - ["custom/do-not-disturb" "custom/new-mail" "network"] + mod = "dock"; + exclusive = true; + passthrough = false; + height = 30; + modules-left = ordered modules-left ["custom/rofi" "clock" "hyprland/workspaces" "hyprland/window"]; + modules-center = ordered modules-center []; + modules-right = ordered modules-right ([ + "custom/do-not-disturb" + "custom/new-mail" + "network" + "temperature" + "memory" + ] ++ (lib.optional nixosConfig.settings.batteryStuff.enable "battery") - ++ ["tray"]; + ++ [ + "pulseaudio" + "backlight" + "tray" + ]); - modules = { - "hyprland/workspaces" = { - disable-scroll = true; - all-outputs = true; - on-click = "activate"; - }; - "hyprland/window" = {tooltip = false;}; - - "clock#time" = { - interval = 1; - format = "{:%T}"; - tooltip = false; - }; - "custom/check-system" = { - exec = "${checkSystem}/bin/check-system"; - return-type = "json"; - interval = 5; - }; - "clock#date" = { - format = "{:%d.%m.%y}"; - tooltip = false; - }; - - "custom/do-not-disturb" = { - exec = "${doNotDisturbJson}/bin/do-not-disturb-json"; - return-type = "json"; - interval = 1; - }; - "custom/new-mail" = { - exec = "${new-mail}/bin/new-mail"; - return-type = "json"; - interval = 1; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = " "; - deactivated = " "; - }; - tooltip = false; - }; - "battery" = { - states = { - good = 95; - warning = 30; - critical = 15; - }; - format = "{icon} {capacity}%"; - format-charging = " {capacity}%"; - format-plugged = ""; - design-capacity = true; - format-icons = ["" "" "" "" ""]; - tooltip = false; - }; - "network" = { - format-wifi = " {essid} ({signalStrength}%)"; - format-ethernet = "酪 {ifname} {ipaddr}/{cidr}"; - format-linked = "酪 {ifname}"; - format-disconnected = " "; - tooltip = false; - interval = 5; - }; - "tray" = { - spacing = 5; - }; - }; + modules = modules-left // modules-center // modules-right; } ]; - style = '' - @import "${config.myLib.mkCSSVariables config.colorsDark}"; + systemd.enable = true; + }; - * { - border: none; - border-radius: 0; - font-family: Hack Nerd Font; - font-size: 11px; - min-height: 20px; - } + specialisation.light.configuration = { + programs.waybar.style = compiledCssStyle.light; + }; - window#waybar { - background-color: @base00; - border-bottom: 3px solid ${mkBorder col.base00}; - color: @base0D; - } - - window#waybar.hidden { - opacity: 0.2; - } - - tooltip { - margin: 0; - padding: 0; - background-color: @base00; - color: @base0D; - border: 1px solid ${mkBorder col.base00}; - } - - tooltip label { - margin: 0; - padding: 0; - color: @base0D; - font-weight: bolder; - } - - /* Workspace basics, existing workspaces on other displays */ - #workspaces button { - padding: 0 5px; - background-color: transparent; - color: @base01; - font-weight: bolder; - min-width: 20px; - /* border-bottom: 3px solid ${mkBorder col.base00}; */ - } - - #workspaces button.active { - color: @base00; - background-color: @base0D; - border-bottom: 3px solid ${mkBorder col.base0D}; - } - - #workspaces button.urgent { - color: @base00; - background-color: @base08; - border-bottom: 3px solid ${mkBorder col.base08}; - } - - #mode { - background-color: @base08; - color: @base00; - border-bottom: 3px solid ${mkBorder col.base08}; - } - - #workspaces button:hover { - color: @base00; - background-color: @base0D; - border-bottom: 3px solid ${mkBorder col.base0D}; - } - - #clock, - #battery, - #network, - #mode, - #custom-do-not-disturb, - #custom-new-mail, - #custom-check-system { - padding: 0 10px; - color: @base05; - } - - #custom-do-not-disturb, - #custom-new-mail { - padding: 0px 10px 0px 13px; - margin-right: 10px; - font-weight: bolder; - background-color: @base09; - color: @base00; - border-bottom: 3px solid ${mkBorder col.base09}; - } - - #custom-do-not-disturb { - background-color: @base0B; - border-bottom: 3px solid ${mkBorder col.base0B}; - } - - #custom-check-system { - margin: 0 5px; - padding: 0 10px 0 13px; - font-weight: bolder; - color: @base08; - } - - #network { - margin-right: 10px; - background-color: @base04; - color: @base00; - border-bottom: 3px solid ${mkBorder col.base04}; - } - - #network.disconnected { - padding: 0px 10px 0px 13px; - background-color: @base08; - color: @base00; - border-bottom: 3px solid ${mkBorder col.base08}; - } - - #clock { - color: @base05; - border-bottom: 3px solid transparent; - } - - #clock.time { - font-weight: bolder; - padding-right: 2px; - } - - #clock.date { - padding-left: 2px; - } - - #window, - #workspaces { - margin: 0 4px; - } - - #window { - border-bottom: 3px solid transparent; - } - - /* If workspaces is the leftmost module, omit left margin */ - .modules-left > widget:first-child > #workspaces { - margin-left: 0; - } - - /* If workspaces is the rightmost module, omit right margin */ - .modules-right > widget:last-child > #workspaces { - margin-right: 0; - } - - #battery { - background-color: @base05; - border-bottom: 3px solid ${mkBorder col.base05}; - color: @base00; - } - - #battery.warning:not(.charging) { - background-color: @base08; - border-bottom: 3px solid ${mkBorder col.base08}; - } - - #battery.critical:not(.charging) { - background-color: @base0F; - border-bottom: 3px solid ${mkBorder col.base0F}; - } - - label:focus { - background-color: #000000; - } - - #tray { - padding: 0 10px; - } - - #tray menu { - background-color: @base00; - color: @base0D; - border: 1px solid @base0D; - padding: 0; - margin: 10px; - font-weight: bold; - } - - #tray menu menuitem { - border-bottom: 1px solid @base00; - } - - #tray menu menuitem:last-child { - border-bottom: none; - } - - #tray menu menuitem:hover { - background-color: @base0D; - color: @base00; - } - ''; + specialisation.dark.configuration = { + programs.waybar.style = compiledCssStyle.dark; }; } diff --git a/users/malte/modules/zathura.nix b/users/malte/modules/zathura.nix index 13bb4b2..4bfbc16 100644 --- a/users/malte/modules/zathura.nix +++ b/users/malte/modules/zathura.nix @@ -1,15 +1,21 @@ { pkgs, - config, + lib, ... }: let - configDir = "~/.config/zathura"; - themeConfigFile = "themerc"; - linkTheme = theme: '' - ${pkgs.coreutils}/bin/ln -sf ${theme} ${configDir}/${themeConfigFile} - ''; - lightTheme = config.myLib.mkZathuraTheme config.colorsLight; - darkTheme = config.myLib.mkZathuraTheme config.colorsDark; + catppuccinZathura = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "zathura"; + rev = "0adc53028d81bf047461bc61c43a484d11b15220"; + hash = "sha256-/vD/hOi6KcaGyAp6Az7jL5/tQSGRzIrf0oHjAJf4QbI="; + }; + + gruvboxZathura = pkgs.fetchFromGitHub { + owner = "MiragianCycle"; + repo = "zathura-gruvbox"; + rev = "0b49904fe77e6eb676a6318c1acb03afeb2965bb"; + hash = "sha256-h7CIPjW2DjkDHetJM/EASaGQNUpMp8joOo1ghKIorN4="; + }; in { home.packages = [pkgs.hack-nerdfont]; programs.zathura = { @@ -26,16 +32,17 @@ in { extraConfig = '' map navigate next map navigate previous - include ${themeConfigFile} + include themerc ''; }; - services.darkman.lightModeScripts."zathura.sh" = '' - mkdir -p ${configDir} - ${linkTheme lightTheme} - ''; - services.darkman.darkModeScripts."zathura.sh" = '' - mkdir -p ${configDir} - ${linkTheme darkTheme} - ''; + xdg.configFile."zathura/themerc".source = lib.mkDefault (gruvboxZathura + /zathura-gruvbox-dark); + + specialisation.light.configuration = { + xdg.configFile."zathura/themerc".source = catppuccinZathura + /src/catppuccin-latte; + }; + + specialisation.dark.configuration = { + xdg.configFile."zathura/themerc".source = gruvboxZathura + /zathura-gruvbox-dark; + }; } diff --git a/users/marie/default.nix b/users/marie/default.nix index 967e537..095946d 100644 --- a/users/marie/default.nix +++ b/users/marie/default.nix @@ -45,8 +45,6 @@ in { unzip ]; - # TODO: Improve - programs.broot.enable = true; programs.fish.enable = true; xdg.enable = true; diff --git a/users/modules/colors.nix b/users/modules/colors.nix deleted file mode 100644 index c2e9a1e..0000000 --- a/users/modules/colors.nix +++ /dev/null @@ -1,199 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - # Create a color from a hexadezimal 6 digit description, like 'FF0000' for pure red - # mkcolor :: hex -> Color - mkColor = rgb: let - # Mapping hex digits to actual numbers - hexDigitMap = { - "0" = 0; - "1" = 1; - "2" = 2; - "3" = 3; - "4" = 4; - "5" = 5; - "6" = 6; - "7" = 7; - "8" = 8; - "9" = 9; - "A" = 10; - "B" = 11; - "C" = 12; - "D" = 13; - "E" = 14; - "F" = 15; - }; - - # Convert a single hexadezimal character to a number - # hexCharToInt :: char -> int - hexCharToInt = char: hexDigitMap.${lib.strings.toUpper char}; - - # Convert a hexadezimal string to a number - # hexStringToInt :: string -> int - hexStringToInt = string: let - chars = lib.strings.stringToCharacters string; - nums = map hexCharToInt chars; - fun = sum: el: sum * 16 + el; - in - lib.foldl fun 0 nums; - - # Convert a float from [0.0, 1.0] to a hex string from [0, 255] - # floatToFF :: float -> string - floatToFF = float: lib.toHexString (builtins.floor (255 * float)); - - # Red part of the given color - # red :: int - red = hexStringToInt (lib.strings.substring 0 2 rgb); - - # Green part of the given color - # green :: int - green = hexStringToInt (lib.strings.substring 2 2 rgb); - - # Blue part of the given color - # blue :: int - blue = hexStringToInt (lib.strings.substring 4 2 rgb); - - # Create an RGB hex string from red, green, and blue parts - # rgbFromParts :: int -> int -> int -> string - rgbFromParts = r: g: b: let - rHex = lib.strings.fixedWidthString 2 "0" (lib.toHexString r); - gHex = lib.strings.fixedWidthString 2 "0" (lib.toHexString g); - bHex = lib.strings.fixedWidthString 2 "0" (lib.toHexString b); - in - rHex + gHex + bHex; - - # Create a Color darker than the color given by the rgb parts. - # amount is in range [0.0, 1.0], r,g, and b in range [0, 255] - # darkenColor :: int -> int -> int -> float -> Color - darkenColor = r: g: b: amount: let - r' = builtins.floor ((1.0 - amount) * r); - g' = builtins.floor ((1.0 - amount) * g); - b' = builtins.floor ((1.0 - amount) * b); - in - mkColor (rgbFromParts r' g' b'); - - # Create a Color lighter than the color given by the rgb parts. See darkenColor. - # darkenColor :: int -> int -> int -> float -> Color - lightenColor = r: g: b: amount: let - r' = lib.min (builtins.floor ((1.0 + amount) * r)) 255; - g' = lib.min (builtins.floor ((1.0 + amount) * g)) 255; - b' = lib.min (builtins.floor ((1.0 + amount) * b)) 255; - in - mkColor (rgbFromParts r' g' b'); - in { - inherit rgb red green blue; - # e.g. "#FF0000" - hashRgb = "#" + rgb; - # e.g. rgbWithAlpha 1.0 -> "FF0000FF" - # rgbWithAlpha :: float -> string - rgbWithAlpha = alpha: rgb + (floatToFF alpha); - # e.g. hashRgbWithAlpha 1.0 -> "#FF0000FF" - # rgbWithAlpha :: float -> string - hashRgbWithAlpha = alpha: "#" + rgb + (floatToFF alpha); - # darker :: float -> Color - darker = darkenColor red green blue; - # lighter :: float -> Color - lighter = lightenColor red green blue; - }; -in { - # Dark and light colorschemes as provided by the nix-colors flake input - options.colorsLight = lib.mkOption {default = null;}; - options.colorsDark = lib.mkOption {default = null;}; - # Internal library functions - # TODO: This could probably be done more elegantly. - options.myLib = with lib; mkOption {type = with types; attrsOf anything;}; - - # === myLib functions === - config.myLib = { - inherit mkColor; - mkKittyTheme = colorscheme: let - color = name: "#${colorscheme.palette.${name}}"; - in - pkgs.writeText "kitty-theme-${colorscheme.slug}" '' - # https://github.com/kdrag0n/base16-kitty/blob/fe5862cec41bfd0b46a1ac3d7565a50680051226/templates/default.mustache - background ${color "base00"} - foreground ${color "base05"} - selection_background ${color "base05"} - selection_foreground ${color "base00"} - url_color ${color "base04"} - cursor ${color "base05"} - active_border_color ${color "base03"} - inactive_border_color ${color "base01"} - active_tab_background ${color "base00"} - active_tab_foreground ${color "base05"} - inactive_tab_background ${color "base01"} - inactive_tab_foreground ${color "base04"} - tab_bar_background ${color "base01"} - - # normal - color0 ${color "base00"} - color1 ${color "base08"} - color2 ${color "base0B"} - color3 ${color "base0A"} - color4 ${color "base0D"} - color5 ${color "base0E"} - color6 ${color "base0C"} - color7 ${color "base05"} - # bright - color8 ${color "base03"} - color9 ${color "base09"} - color10 ${color "base01"} - color11 ${color "base02"} - color12 ${color "base04"} - color13 ${color "base06"} - color14 ${color "base0F"} - color15 ${color "base07"} - ''; - mkZathuraTheme = colorscheme: let - color = name: "#${colorscheme.palette.${name}}"; - in - pkgs.writeText "zathura-theme-${colorscheme.slug}" '' - # https://github.com/HaoZeke/base16-zathura/blob/9f148b4001dc67d399e645919225943d47e50125/templates/recolor.mustache - set default-bg "${color "base00"}" - set default-fg "${color "base01"}" - set statusbar-fg "${color "base04"}" - set statusbar-bg "${color "base02"}" - set inputbar-bg "${color "base00"}" - set inputbar-fg "${color "base07"}" - set notification-bg "${color "base00"}" - set notification-fg "${color "base07"}" - set notification-error-bg "${color "base00"}" - set notification-error-fg "${color "base08"}" - set notification-warning-bg "${color "base00"}" - set notification-warning-fg "${color "base08"}" - set highlight-color "${color "base0A"}" - set highlight-active-color "${color "base0D"}" - set completion-bg "${color "base01"}" - set completion-fg "${color "base0D"}" - set completion-highlight-fg "${color "base07"}" - set completion-highlight-bg "${color "base0D"}" - set recolor-lightcolor "${color "base00"}" - set recolor-darkcolor "${color "base06"}" - ''; - - # https://github.com/mnussbaum/base16-waybar - mkCSSVariables = colorscheme: let - color = name: "#${colorscheme.palette.${name}}"; - in - pkgs.writeText "css-theme-${colorscheme.slug}" '' - @define-color base00 ${color "base00"}; - @define-color base01 ${color "base01"}; - @define-color base02 ${color "base02"}; - @define-color base03 ${color "base03"}; - @define-color base04 ${color "base04"}; - @define-color base05 ${color "base05"}; - @define-color base06 ${color "base06"}; - @define-color base07 ${color "base07"}; - @define-color base08 ${color "base08"}; - @define-color base09 ${color "base09"}; - @define-color base0A ${color "base0A"}; - @define-color base0B ${color "base0B"}; - @define-color base0C ${color "base0C"}; - @define-color base0D ${color "base0D"}; - @define-color base0E ${color "base0E"}; - @define-color base0F ${color "base0F"}; - ''; - }; -} diff --git a/users/modules/profiles-cleanup.nix b/users/modules/profiles-cleanup.nix index ea801e7..2e3ccc2 100644 --- a/users/modules/profiles-cleanup.nix +++ b/users/modules/profiles-cleanup.nix @@ -5,7 +5,7 @@ ... }: { # This is a fix for https://github.com/nix-community/home-manager/issues/4672 - systemd.user = { + systemd.user = lib.trace "Clean up HM systemd service configured. Has https://github.com/nix-community/home-manager/issues/4672 been fixed yet?" { services = { home-manager-profiles-cleanup = { Unit.Description = "Clean up HM user profiles.";