diff --git a/home/themes/default.nix b/home/themes/default.nix index 9f799a7..1e091a9 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -1,6 +1,7 @@ { imports = [ ./qt.nix + ./kdeglobals.nix ./oxiced.nix ]; } diff --git a/home/themes/kdeglobals.nix b/home/themes/kdeglobals.nix new file mode 100644 index 0000000..1a7f217 --- /dev/null +++ b/home/themes/kdeglobals.nix @@ -0,0 +1,259 @@ +# This is ABSOLUTE GARGABE, KDE srsly, remove this! +# props to catppuccin mocha for sparing me from doing this manually: https://github.com/catppuccin/kde/blob/main/Resources/Base.colors +{ + pkgs, + config, + lib, + inputs, + ... +}: +let + base16 = pkgs.callPackage inputs.base16.lib { }; + + baseScheme = (base16.mkSchemeAttrs config.stylix.base16Scheme); + power = + number: powerIndex: + if powerIndex == 1 then + number + else if powerIndex == 0 then + 1 + else + number * power number (powerIndex - 1); + + lookupTable = powerIndex: { + "0" = 0 * (power 16 powerIndex); + "1" = 1 * (power 16 powerIndex); + "2" = 2 * (power 16 powerIndex); + "3" = 3 * (power 16 powerIndex); + "4" = 4 * (power 16 powerIndex); + "5" = 5 * (power 16 powerIndex); + "6" = 6 * (power 16 powerIndex); + "7" = 7 * (power 16 powerIndex); + "8" = 8 * (power 16 powerIndex); + "9" = 9 * (power 16 powerIndex); + "a" = 10 * (power 16 powerIndex); + "b" = 11 * (power 16 powerIndex); + "c" = 12 * (power 16 powerIndex); + "d" = 13 * (power 16 powerIndex); + "e" = 14 * (power 16 powerIndex); + "f" = 15 * (power 16 powerIndex); + }; + + convertHex = + hexChars: + recombineColors [ + (convertColor (lib.lists.take 2 hexChars)) + (convertColor (lib.lists.take 2 (lib.lists.drop 2 hexChars))) + (convertColor (lib.lists.take 2 (lib.lists.drop 4 hexChars))) + ]; + + convertColor = + color: (lookupTable 1).${(lib.lists.head color)} + (lookupTable 0).${(lib.lists.last color)}; + recombineColors = colors: lib.lists.foldr (a: b: (toString a) + "," + (toString b)) "end" colors; + + scheme = { + base00 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base00) + ); + base01 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base01) + ); + base02 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base02) + ); + base03 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base03) + ); + base04 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base04) + ); + base05 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base05) + ); + base06 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base06) + ); + base07 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base07) + ); + base08 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base08) + ); + base09 = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base09) + ); + base0A = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base0A) + ); + base0B = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base0B) + ); + base0C = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base0C) + ); + base0D = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base0D) + ); + base0E = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base0E) + ); + base0F = lib.strings.removeSuffix ",end" ( + convertHex (lib.strings.stringToCharacters baseScheme.base0F) + ); + }; + +in +{ + # temp + # crust -> surface1 + # subtext0 -> surface2 + # accentColor -> lavender + xdg.configFile."kdeglobals" = { + text = '' + [ColorEffects:Disabled] + Color=${scheme.base01} + ColorAmount=0.30000000000000004 + ColorEffect=2 + ContrastAmount=0.1 + ContrastEffect=0 + IntensityAmount=-1 + IntensityEffect=0 + + [ColorEffects:Inactive] + ChangeSelectionColor=true + Color=${scheme.base01} + ColorAmount=0.5 + ColorEffect=3 + ContrastAmount=0 + ContrastEffect=0 + Enable=true + IntensityAmount=0 + IntensityEffect=0 + + [Colors:Button] + BackgroundAlternate=${scheme.base07} + BackgroundNormal=${scheme.base02} + DecorationFocus=${scheme.base07} + DecorationHover=${scheme.base02} + ForegroundActive=${scheme.base09} + ForegroundInactive=${scheme.base04} + ForegroundLink=${scheme.base07} + ForegroundNegative=${scheme.base08} + ForegroundNeutral=${scheme.base0A} + ForegroundNormal=${scheme.base05} + ForegroundPositive=${scheme.base0B} + ForegroundVisited=${scheme.base0E} + + + [Colors:Complementary] + BackgroundAlternate=${scheme.base03} + BackgroundNormal=${scheme.base00} + DecorationFocus=${scheme.base07} + DecorationHover=${scheme.base02} + ForegroundActive=${scheme.base09} + ForegroundInactive=${scheme.base04} + ForegroundLink=${scheme.base07} + ForegroundNegative=${scheme.base08} + ForegroundNeutral=${scheme.base0A} + ForegroundNormal=${scheme.base05} + ForegroundPositive=${scheme.base0B} + ForegroundVisited=${scheme.base0E} + + + [Colors:Header] + BackgroundAlternate=${scheme.base03} + BackgroundNormal=${scheme.base00} + DecorationFocus=${scheme.base07} + DecorationHover=${scheme.base02} + ForegroundActive=${scheme.base09} + ForegroundInactive=${scheme.base04} + ForegroundLink=${scheme.base07} + ForegroundNegative=${scheme.base08} + ForegroundNeutral=${scheme.base0A} + ForegroundNormal=${scheme.base05} + ForegroundPositive=${scheme.base0B} + ForegroundVisited=${scheme.base0E} + + + [Colors:Selection] + BackgroundAlternate=${scheme.base07} + BackgroundNormal=${scheme.base07} + DecorationFocus=${scheme.base07} + DecorationHover=${scheme.base02} + ForegroundLink=${scheme.base07} + ForegroundInactive=${scheme.base00} + ForegroundActive=${scheme.base09} + ForegroundLink=${scheme.base07} + ForegroundNegative=${scheme.base08} + ForegroundNeutral=${scheme.base0A} + ForegroundNormal=${scheme.base03} + ForegroundPositive=${scheme.base0B} + ForegroundVisited=${scheme.base0E} + + + [Colors:Tooltip] + BackgroundAlternate=27,25,35 + BackgroundNormal=${scheme.base01} + DecorationFocus=${scheme.base07} + DecorationHover=${scheme.base02} + ForegroundActive=${scheme.base09} + ForegroundInactive=${scheme.base04} + ForegroundLink=${scheme.base07} + ForegroundNegative=${scheme.base08} + ForegroundNeutral=${scheme.base0A} + ForegroundNormal=${scheme.base05} + ForegroundPositive=${scheme.base0B} + ForegroundVisited=${scheme.base0E} + + + [Colors:View] + BackgroundAlternate=${scheme.base00} + BackgroundNormal=${scheme.base01} + DecorationFocus=${scheme.base07} + DecorationHover=${scheme.base02} + ForegroundActive=${scheme.base09} + ForegroundInactive=${scheme.base04} + ForegroundLink=${scheme.base07} + ForegroundNegative=${scheme.base08} + ForegroundNeutral=${scheme.base0A} + ForegroundNormal=${scheme.base05} + ForegroundPositive=${scheme.base0B} + ForegroundVisited=${scheme.base0E} + + + [Colors:Window] + BackgroundAlternate=${scheme.base03} + BackgroundNormal=${scheme.base00} + DecorationFocus=${scheme.base07} + DecorationHover=${scheme.base02} + ForegroundActive=${scheme.base09} + ForegroundInactive=${scheme.base04} + ForegroundLink=${scheme.base07} + ForegroundNegative=${scheme.base08} + ForegroundNeutral=${scheme.base0A} + ForegroundNormal=${scheme.base05} + ForegroundPositive=${scheme.base0B} + ForegroundVisited=${scheme.base0E} + + + [General] + ColorScheme=CustomBase16Nix + Name=CustomBase16Nix + accentActiveTitlebar=false + shadeSortColumn=true + + + [KDE] + contrast=4 + + + [WM] + activeBackground=${scheme.base01} + activeBlend=${scheme.base05} + activeForeground=${scheme.base05} + inactiveBackground=${scheme.base03} + inactiveBlend=${scheme.base04} + inactiveForeground=${scheme.base04} + ''; + }; +} diff --git a/home/themes/qt.nix b/home/themes/qt.nix index c0d11db..5f77b89 100644 --- a/home/themes/qt.nix +++ b/home/themes/qt.nix @@ -27,6 +27,31 @@ let border: none; } ''; + + ## test + #cfg = config.stylix.targets.qt; + kvconfig = config.lib.stylix.colors { + template = ./kvconfig.mustache; + extension = ".kvconfig"; + }; + svg = config.lib.stylix.colors { + template = ./kvantum-svg.mustache; + extension = "svg"; + }; + kvantumPackage = pkgs.runCommandLocal "base16-kvantum" { } '' + directory="$out/share/Kvantum/Base16Kvantum" + mkdir --parents "$directory" + cat ${kvconfig} >>"$directory/Base16Kvantum.kvconfig" + cat ${svg} >>"$directory/Base16Kvantum.svg" + ''; + + xdg.configFile."Kvantum/kvantum.kvconfig".source = + (pkgs.formats.ini { }).generate "kvantum.kvconfig" + { + General.theme = "Base16Kvantum"; + }; + + xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum"; in { xdg.configFile."qt5ct/colors/tokyonight.conf" = { @@ -38,6 +63,32 @@ in xdg.configFile."qt5ct/qss/tab.qss" = { text = "${qss}"; }; + qt = { + enable = true; + style.package = pkgs.libsForQt5.breeze-qt5; + style.name = "breeze-dark"; + }; + + # ## test + # xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" { + # General.theme = "Base16Kvantum"; + # }; + + # xdg.configFile."Kvantum/Base16Kvantum".source = "${kvantumPackage}/share/Kvantum/Base16Kvantum"; + + # xdg.configFile."qt5ct/qt5ct.conf".text = '' + # [Appearance] + # style=kvantum + # ''; + + # #icon_theme=${cfg.iconThemeName} + + # xdg.configFile."qt6ct/qt6ct.conf".text = '' + # [Appearance] + # style=kvantum + # ''; + # #icon_theme=${cfg.iconThemeName} + xdg.configFile."qt5ct/qt5ct.conf" = { text = '' [Appearance] diff --git a/modules/programs/basePackages.nix b/modules/programs/basePackages.nix index cd0a501..5fa0aff 100644 --- a/modules/programs/basePackages.nix +++ b/modules/programs/basePackages.nix @@ -65,6 +65,9 @@ icon-library kdePackages.breeze-icons kdePackages.breeze + libsForQt5.breeze-qt5 + kdePackages.qtstyleplugin-kvantum + libsForQt5.qtstyleplugin-kvantum libadwaita libxkbcommon nixfmt-rfc-style diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 7c7d8a9..0b74286 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -27,6 +27,7 @@ ./oxi ./piper.nix ./podman.nix + ./docker.nix ./printing.nix ./scripts.nix ./sddm.nix diff --git a/modules/programs/docker.nix b/modules/programs/docker.nix new file mode 100644 index 0000000..7045050 --- /dev/null +++ b/modules/programs/docker.nix @@ -0,0 +1,32 @@ +{ + lib, + config, + options, + pkgs, + ... +}: +{ + # TODO make exclusive with docker + options.mods.docker = { + enable = lib.mkOption { + default = false; + example = false; + type = lib.types.bool; + description = "Enables and configures docker"; + }; + }; + config = lib.mkIf config.mods.docker.enable ( + lib.optionalAttrs (options ? virtualisation.docker) { + environment.systemPackages = with pkgs; [ + docker-compose + dive + ]; + virtualisation = { + containers.enable = true; + docker = { + enable = true; + }; + }; + } + ); +}