Regenerated
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
|
||||
let
|
||||
# --- Module variables ---
|
||||
moduleName = "kitty";
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
# Path to program assets (relative, self-contained)
|
||||
assetPath = ../../../assets/system/conf/${moduleName};
|
||||
|
||||
# Read all files in the assets directory
|
||||
programFiles = builtins.readDir assetPath;
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${assetPath}/${name}";
|
||||
});
|
||||
|
||||
# Top-level toggle for this module
|
||||
enableProgram = config.enableKitty or true;
|
||||
in
|
||||
{
|
||||
# --- Declare the top-level toggle ---
|
||||
options.enableKitty = lib.mkEnableOption "Enable Kitty terminal integration";
|
||||
|
||||
# --- Only apply configuration if enabled ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# Install kitty package system-wide
|
||||
environment.systemPackages = [ pkgs.kitty ];
|
||||
|
||||
# Kitty program configuration (home-manager)
|
||||
programs.kitty.enable = true;
|
||||
programs.kitty.extraConfig = ''
|
||||
# Include the Catppuccin-Mocha theme
|
||||
include themes/Catppuccin-Mocha.conf
|
||||
'';
|
||||
|
||||
# Deploy all config files to user's XDG config
|
||||
home-manager.users.${username} = {
|
||||
xdg.configFile =
|
||||
lib.mapAttrs' (name: value: {
|
||||
name = "${moduleName}/${name}";
|
||||
value.source = value.src;
|
||||
}) files;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
# Path to your Starship config inside the flake
|
||||
starshipAssets = ../../../assets/system/conf/starship.toml;
|
||||
|
||||
# Read and parse the TOML file as a symbolic value
|
||||
starshipConfig = lib.importTOML starshipAssets;
|
||||
|
||||
# Toggle on/off
|
||||
enableStarship = true;
|
||||
in
|
||||
{
|
||||
# Declare a top-level module option
|
||||
options.starship = {
|
||||
enable = lib.mkEnableOption "Enable Starship prompt";
|
||||
configFiles = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.any;
|
||||
default = {};
|
||||
description = "Symbolic Starship configuration files";
|
||||
};
|
||||
};
|
||||
|
||||
# Populate the option safely
|
||||
config = lib.mkIf enableStarship {
|
||||
starship.enable = true;
|
||||
starship.configFiles = {
|
||||
"starship.toml" = starshipConfig;
|
||||
assetsDir = ../../../assets/system/conf;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
# --- Program-specific paths/assets ---
|
||||
programName = "zsh";
|
||||
programAssets = ../../../assets/system/conf/${programName};
|
||||
programFiles = builtins.readDir programAssets;
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${programAssets}/${name}";
|
||||
});
|
||||
in
|
||||
{
|
||||
# Top-level toggle for this program
|
||||
options.enableZsh =
|
||||
lib.mkEnableOption "Enable Zsh terminal with Oh-My-Zsh";
|
||||
|
||||
# Wrap everything in config if enabled
|
||||
config = { config, ... }: let
|
||||
# Enable flag now safely references the toggle option
|
||||
enableProgram = config.enableZsh or false;
|
||||
|
||||
# Safe reference to defaultUser inside mkIf
|
||||
username = config.defaultUser or "henrov";
|
||||
in lib.mkIf enableProgram {
|
||||
mySystem = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
assetsDir = programAssets;
|
||||
files = files;
|
||||
user = username;
|
||||
|
||||
# Zsh-specific settings
|
||||
ohMyZsh = {
|
||||
enable = true;
|
||||
theme = "catppuccin-mocha";
|
||||
plugins = [
|
||||
"git"
|
||||
"docker"
|
||||
"direnv"
|
||||
"zsh-autosuggestions"
|
||||
"zsh-completions"
|
||||
"zsh-history-substring-search"
|
||||
# zsh-syntax-highlighting is sourced in initExtra
|
||||
];
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
# Catppuccin Mocha colors
|
||||
local mocha_base="#1E1E2E"
|
||||
local mocha_surface0="#313244"
|
||||
local mocha_text="#CDD6F4"
|
||||
local mocha_lavender="#B4BEFE"
|
||||
local mocha_blue="#89B4FA"
|
||||
local mocha_sapphire="#74C7EC"
|
||||
local mocha_teal="#94D2D5"
|
||||
local mocha_green="#A6E3A1"
|
||||
local mocha_yellow="#F9E2AF"
|
||||
local mocha_peach="#FAB387"
|
||||
local mocha_maroon="#EBA0AC"
|
||||
local mocha_red="#F38BA8"
|
||||
local mocha_mauve="#CBA6F7"
|
||||
local mocha_pink="#F5E2C7"
|
||||
local mocha_flamingo="#F2CDCD"
|
||||
local mocha_rosewater="#F5E0DC"
|
||||
|
||||
# Prompt
|
||||
PROMPT='%{$fg[$mocha_blue]%}%n%{$reset_color%}@%{$fg[$mocha_peach]%}%m%{$reset_color%} %{$fg[$mocha_lavender]%}%~%{$reset_color%} %{$fg[$mocha_red]%}$%{$reset_color%} '
|
||||
RPROMPT='%{$fg[$mocha_green]%}%T%{$reset_color%}'
|
||||
|
||||
# Source zsh-syntax-highlighting if present
|
||||
if [ -f ${files."zsh-syntax-highlighting".src} ]; then
|
||||
source ${files."zsh-syntax-highlighting".src}
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user