Added assets

This commit is contained in:
2025-12-29 20:35:53 -07:00
parent f108de09bb
commit 53da378e59
8 changed files with 1231 additions and 40 deletions

32
modules/assets.nix Normal file
View File

@@ -0,0 +1,32 @@
{ config, pkgs, lib, ... }:
let
# The assets folder from the project root
assetsPath = ../assets;
in
{
systemd.user.services.sync-assets = {
description = "Sync assets to home directory";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
script = ''
# Remove existing Assets folder to ensure clean sync
rm -rf %h/Assets
# Create the directory
mkdir -p %h/Assets
# Copy contents from the nix store to the home directory
# -L dereferences symlinks (if any)
# --no-preserve=mode,ownership to ensure the user owns the files and can write to them
${pkgs.coreutils}/bin/cp -rL --no-preserve=mode,ownership ${assetsPath}/* %h/Assets/
# Ensure permissions are correct (u+rw)
chmod -R u+rw %h/Assets
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
};
}

View File

@@ -1,39 +0,0 @@
{ pkgs, config, lib, ... }:
let
# URL for the theme
themeUrl = "https://raw.githubusercontent.com/catppuccin/cosmic-desktop/main/themes/cosmic-settings/catppuccin-macchiato-blue%2Bround.ron";
themeFile = pkgs.fetchurl {
url = themeUrl;
sha256 = "00hkydzjy87g18xqbg2a07hlh96akwnlbl1pdn006f3kkscyfkmr";
};
in
{
# Create a systemd user service to apply the theme
systemd.user.services.apply-cosmic-theme = {
description = "Apply Catppuccin Macchiato theme to Cosmic";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
script = ''
mkdir -p %h/.config/cosmic/com.system76.CosmicTheme.Dark.Builder
# The theme file from the repo is the "entries" part of the config.
# We need to wrap it in the structure Cosmic expects: ( entries: ..., version: 1 )
echo "(" > %h/.config/cosmic/com.system76.CosmicTheme.Dark.Builder/v1
echo " entries: " >> %h/.config/cosmic/com.system76.CosmicTheme.Dark.Builder/v1
cat ${themeFile} >> %h/.config/cosmic/com.system76.CosmicTheme.Dark.Builder/v1
echo "," >> %h/.config/cosmic/com.system76.CosmicTheme.Dark.Builder/v1
echo " version: 1" >> %h/.config/cosmic/com.system76.CosmicTheme.Dark.Builder/v1
echo ")" >> %h/.config/cosmic/com.system76.CosmicTheme.Dark.Builder/v1
# Ensure Dark Mode is enabled
mkdir -p %h/.config/cosmic/com.system76.CosmicTheme.Mode
echo '( entries: ( is_dark: true ), version: 1 )' > %h/.config/cosmic/com.system76.CosmicTheme.Mode/v1
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
};
}