move custom noctalia shell to packages/
This commit is contained in:
parent
96a0745a6d
commit
99e8b1ae67
3 changed files with 98 additions and 76 deletions
|
|
@ -1,85 +1,12 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
# Get the actual color palettes
|
customPackage = pkgs.mkNoctaliaShellCustom {
|
||||||
darkPalette = pkgs.catppuccin.${config.catppuccin.flavor};
|
catppuccin-flavor = config.catppuccin.flavor;
|
||||||
lightPalette = pkgs.catppuccin.latte;
|
catppuccin-accent = config.catppuccin.accent;
|
||||||
|
|
||||||
# Create theme from palette
|
|
||||||
mkTheme = palette: accent: {
|
|
||||||
mPrimary = palette.${accent};
|
|
||||||
mOnPrimary = palette.crust;
|
|
||||||
mSecondary = palette.subtext0;
|
|
||||||
mOnSecondary = palette.crust;
|
|
||||||
mTertiary = palette.teal;
|
|
||||||
mOnTertiary = palette.crust;
|
|
||||||
mError = palette.red;
|
|
||||||
mOnError = palette.crust;
|
|
||||||
mSurface = palette.mantle;
|
|
||||||
mOnSurface = palette.text;
|
|
||||||
mSurfaceVariant = palette.surface0;
|
|
||||||
mOnSurfaceVariant = palette.lavender;
|
|
||||||
mOutline = palette.surface2;
|
|
||||||
mShadow = palette.crust;
|
|
||||||
mHover = palette.subtext1;
|
|
||||||
mOnHover = palette.crust;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Build the complete color scheme
|
|
||||||
customScheme = {
|
|
||||||
dark = mkTheme darkPalette config.catppuccin.accent;
|
|
||||||
light = mkTheme lightPalette config.catppuccin.accent;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Convert to JSON
|
|
||||||
schemeJson = builtins.toJSON customScheme;
|
|
||||||
|
|
||||||
customPackage = pkgs.noctalia-shell.overrideAttrs (oldAttrs: {
|
|
||||||
pname = "noctalia-shell-custom";
|
|
||||||
nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [pkgs.jq];
|
|
||||||
|
|
||||||
postPatch =
|
|
||||||
(oldAttrs.postPatch or "")
|
|
||||||
+ ''
|
|
||||||
echo "Patching noctalia-shell with Cat-Custom theme..."
|
|
||||||
echo " Dark: ${config.catppuccin.flavor} / Light: latte"
|
|
||||||
echo " Accent: ${config.catppuccin.accent}"
|
|
||||||
|
|
||||||
if [ -d Assets/ColorScheme/Catppuccin ]; then
|
|
||||||
mkdir -p Assets/ColorScheme/Cat-Custom
|
|
||||||
|
|
||||||
# Write the JSON directly
|
|
||||||
cat > Assets/ColorScheme/Cat-Custom/Cat-Custom.json << 'COLORSCHEME_EOF'
|
|
||||||
${schemeJson}
|
|
||||||
COLORSCHEME_EOF
|
|
||||||
|
|
||||||
echo "Created Cat-Custom color scheme:"
|
|
||||||
${pkgs.jq}/bin/jq -C '.' Assets/ColorScheme/Cat-Custom/Cat-Custom.json || true
|
|
||||||
|
|
||||||
# Add translation entries
|
|
||||||
for lang in en fr de es pt zh-CN; do
|
|
||||||
if [ -f "Assets/Translations/$lang.json" ]; then
|
|
||||||
${pkgs.jq}/bin/jq \
|
|
||||||
'.["color-scheme"].predefined.schemes["Cat-Custom"] = "Cat-Custom"' \
|
|
||||||
"Assets/Translations/$lang.json" > "Assets/Translations/$lang.json.tmp" \
|
|
||||||
&& mv "Assets/Translations/$lang.json.tmp" "Assets/Translations/$lang.json"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
|
||||||
echo "ERROR: ColorScheme directory not found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta =
|
|
||||||
oldAttrs.meta
|
|
||||||
// {
|
|
||||||
description = "${oldAttrs.meta.description} (Cat-Custom: ${config.catppuccin.flavor}/${config.catppuccin.accent})";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
in {
|
in {
|
||||||
programs.noctalia-shell = {
|
programs.noctalia-shell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
82
packages/noctalia-shell/default.nix
Normal file
82
packages/noctalia-shell/default.nix
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
noctalia-shell,
|
||||||
|
catppuccin-flavor,
|
||||||
|
catppuccin-accent,
|
||||||
|
}: let
|
||||||
|
# Get the actual color palettes
|
||||||
|
darkPalette = pkgs.catppuccin.${catppuccin-flavor};
|
||||||
|
lightPalette = pkgs.catppuccin.latte;
|
||||||
|
|
||||||
|
# Create theme from palette
|
||||||
|
mkTheme = palette: accent: {
|
||||||
|
mPrimary = palette.${accent};
|
||||||
|
mOnPrimary = palette.crust;
|
||||||
|
mSecondary = palette.subtext0;
|
||||||
|
mOnSecondary = palette.crust;
|
||||||
|
mTertiary = palette.teal;
|
||||||
|
mOnTertiary = palette.crust;
|
||||||
|
mError = palette.red;
|
||||||
|
mOnError = palette.crust;
|
||||||
|
mSurface = palette.mantle;
|
||||||
|
mOnSurface = palette.text;
|
||||||
|
mSurfaceVariant = palette.surface0;
|
||||||
|
mOnSurfaceVariant = palette.lavender;
|
||||||
|
mOutline = palette.surface2;
|
||||||
|
mShadow = palette.crust;
|
||||||
|
mHover = palette.subtext1;
|
||||||
|
mOnHover = palette.crust;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Build the complete color scheme
|
||||||
|
customScheme = {
|
||||||
|
dark = mkTheme darkPalette catppuccin-accent;
|
||||||
|
light = mkTheme lightPalette catppuccin-accent;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Convert to JSON
|
||||||
|
schemeJson = builtins.toJSON customScheme;
|
||||||
|
in
|
||||||
|
noctalia-shell.overrideAttrs (oldAttrs: {
|
||||||
|
pname = "noctalia-shell-custom";
|
||||||
|
nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [pkgs.jq];
|
||||||
|
|
||||||
|
postPatch =
|
||||||
|
(oldAttrs.postPatch or "")
|
||||||
|
+ ''
|
||||||
|
echo "Patching noctalia-shell with Cat-Custom theme..."
|
||||||
|
echo " Dark: ${catppuccin-flavor} / Light: latte"
|
||||||
|
echo " Accent: ${catppuccin-accent}"
|
||||||
|
|
||||||
|
if [ -d Assets/ColorScheme/Catppuccin ]; then
|
||||||
|
mkdir -p Assets/ColorScheme/Cat-Custom
|
||||||
|
|
||||||
|
# Write the JSON directly
|
||||||
|
cat > Assets/ColorScheme/Cat-Custom/Cat-Custom.json << 'COLORSCHEME_EOF'
|
||||||
|
${schemeJson}
|
||||||
|
COLORSCHEME_EOF
|
||||||
|
|
||||||
|
echo "Created Cat-Custom color scheme:"
|
||||||
|
${pkgs.jq}/bin/jq -C '.' Assets/ColorScheme/Cat-Custom/Cat-Custom.json || true
|
||||||
|
|
||||||
|
# Add translation entries
|
||||||
|
for lang in en fr de es pt zh-CN; do
|
||||||
|
if [ -f "Assets/Translations/$lang.json" ]; then
|
||||||
|
${pkgs.jq}/bin/jq \
|
||||||
|
'.["color-scheme"].predefined.schemes["Cat-Custom"] = "Cat-Custom"' \
|
||||||
|
"Assets/Translations/$lang.json" > "Assets/Translations/$lang.json.tmp" \
|
||||||
|
&& mv "Assets/Translations/$lang.json.tmp" "Assets/Translations/$lang.json"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "ERROR: ColorScheme directory not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta =
|
||||||
|
oldAttrs.meta
|
||||||
|
// {
|
||||||
|
description = "${oldAttrs.meta.description} (Cat-Custom: ${catppuccin-flavor}/${catppuccin-accent})";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
@ -1,13 +1,26 @@
|
||||||
final: prev: {
|
final: prev: {
|
||||||
spotify-webapp = final.callPackage ./spotify-webapp {};
|
spotify-webapp = final.callPackage ./spotify-webapp {};
|
||||||
|
|
||||||
catppuccin-discord = final.callPackage ./catppuccin-discord {
|
catppuccin-discord = final.callPackage ./catppuccin-discord {
|
||||||
inherit (final) catppuccin-discord-git;
|
inherit (final) catppuccin-discord-git;
|
||||||
};
|
};
|
||||||
|
|
||||||
openmw = final.callPackage ./openmw {
|
openmw = final.callPackage ./openmw {
|
||||||
openmw = prev.openmw;
|
openmw = prev.openmw;
|
||||||
inherit (final) openmw-git;
|
inherit (final) openmw-git;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Noctalia shell is parameterized by catppuccin theme, so we create a function
|
||||||
|
# that home-manager configs can call with their specific theme settings
|
||||||
|
mkNoctaliaShellCustom = {
|
||||||
|
catppuccin-flavor,
|
||||||
|
catppuccin-accent,
|
||||||
|
}:
|
||||||
|
final.callPackage ./noctalia-shell {
|
||||||
|
noctalia-shell = final.noctalia-shell;
|
||||||
|
inherit catppuccin-flavor catppuccin-accent;
|
||||||
|
};
|
||||||
|
|
||||||
linuxPackages_asahi = prev.linuxPackages_asahi.override {
|
linuxPackages_asahi = prev.linuxPackages_asahi.override {
|
||||||
_kernelPatches = [
|
_kernelPatches = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue