Compare commits

..

17 Commits

Author SHA1 Message Date
henrov 9533a9e235 Working on terminals 2026-03-07 23:41:43 +01:00
henrov a7e2955b66 Working on terminal stuff 2026-03-07 23:37:54 +01:00
henrov 82a9f9d9b9 Working on terminal stuff 2026-03-07 23:35:28 +01:00
henrov 4291649cf2 Working on shell stuff 2026-03-07 23:35:04 +01:00
henrov 039b1501cc Working on terminal stuff 2026-03-07 23:30:55 +01:00
henrov 4f8d49a48c Working on termonal stuff 2026-03-07 23:29:39 +01:00
henrov 775f591394 Working on termonal stuff 2026-03-07 23:27:49 +01:00
henrov 06c226f7cd Working on termonal stuff 2026-03-07 23:24:44 +01:00
henrov 1de7d93147 Working on termonal stuff 2026-03-07 23:23:46 +01:00
henrov 539dfb9059 Update zsh.nix 2026-03-07 23:22:41 +01:00
henrov 3a55272ec1 Working on termonal stuff 2026-03-07 23:21:51 +01:00
henrov f215d14817 . 2026-03-07 23:21:09 +01:00
henrov e2ebac9bbd Working on termonal stuff 2026-03-07 23:20:18 +01:00
henrov 98e5b9a9ef typo 2026-03-07 23:19:49 +01:00
henrov e5ba7f8a95 Working on termonal stuff 2026-03-07 23:18:59 +01:00
henrov 9ca8142ce8 Working on termonal stuff 2026-03-07 23:18:19 +01:00
henrov 08580a1cf3 Working on termonal stuff 2026-03-07 23:16:45 +01:00
6 changed files with 561 additions and 545 deletions
+389 -332
View File
File diff suppressed because it is too large Load Diff
+80 -35
View File
@@ -1082,22 +1082,29 @@ This is top file of this level which contains just an import statement for all r
** =generated/system/applications/terminal_shell/kitty.nix=
This is top file of this level which contains just an import statement for all relevant files and/or the subfolder in this folder
#+BEGIN_SRC nix :tangle generated/system/applications/terminal_shell/kitty.nix :noweb tangle :mkdirp yes :eval never-html
{ config, pkgs, lib, user, inputs, flakeRoot, ... }:
{ config, pkgs, lib, user, ... }:
let
kittyConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/kitty";
in
{
# NixOS-level packages (optional, if you want Kitty installed system-wide)
environment.systemPackages = with pkgs; [ kitty ];
# Home Manager configuration for Kitty
home-manager.users.${user.username} = {
programs.kitty = {
enable = true;
settings = {
font_family = "FiraCode Nerd Font Mono";
include = [ "${flakeRoot}/assets/kitty/themes/Catppuccin-Mocha.conf" ];
background_opacity = 0.60;
dynamic_background_opacity = true;
font_family = "JetBrainsMono Nerd Font";
font_size = 12.0;
cursor = "Beam";
cursor_blink_interval = -1;
shell = "${pkgs.zsh}/bin/zsh";
};
};
# Catppuccin Mocha theme for Kitty
xdg.configFile."kitty/theme.conf".source = "${pkgs.catppuccin-kitty}/share/kitty/themes/Catppuccin-Mocha.conf";
xdg.configFile."kitty/kitty.conf".text = ''
include ${kittyConfigDir}/theme.conf
background_opacity 0.9
'';
};
}
#+END_SRC
@@ -1110,16 +1117,26 @@ This is top file of this level which contains just an import statement for all r
home-manager.users.${user.username} = {
programs.starship = {
enable = true;
# Starship settings (e.g., theme, modules)
settings = {
addNewline = false;
# Other settings...
};
# Enable Starship for specific shells
bash.enable = true;
zsh.enable = true;
fish.enable = true;
};
# Catppuccin Mocha theme for Starship
xdg.configFile."starship.toml".text = ''
format = "$all"
[character]
success_symbol = "[](bold green)"
error_symbol = "[](bold red)"
[directory]
style = "bold lavender"
[git_branch]
symbol = " "
style = "bold maroon"
[package]
disabled = true
'';
};
}
#+END_SRC
@@ -1127,37 +1144,65 @@ This is top file of this level which contains just an import statement for all r
** =generated/system/applications/terminal_shell/zsh.nix=
This is top file of this level which contains just an import statement for all relevant files and/or the subfolder in this folder
#+BEGIN_SRC nix :tangle generated/system/applications/terminal_shell/zsh.nix :noweb tangle :mkdirp yes :eval never-html
{
config,
pkgs,
lib,
user,
...
}:
{ config, pkgs, lib, user, ... }:
let
zshConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/zsh";
in
{
home-manager.users.${user.username} = {
programs.zsh = {
enable = true;
enableCompletion = true;
dotDir = "${config.xdg.configHome}/zsh"; # Now correct: inside Home Manager scope
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
enable = true;
theme = "";
theme = "agnoster";
plugins = [
"git"
"sudo"
"extract"
"colored-man-pages"
"command-not-found"
"history"
"zsh-autosuggestions"
"zsh-syntax-highlighting"
"docker"
"kubectl"
"history"
"command-not-found"
"extract"
];
};
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
zshoptions = [ "AUTO_CD" ];
shellAliases = {
ls = "exa --icons -a --group-directories-first";
ll = "exa --icons -la --group-directories-first";
};
};
# Consolidated .zshrc
xdg.configFile."zsh/.zshrc".text = lib.concatStringsSep "\n" [
"# Oh-My-Zsh"
"export ZSH=\"${zshConfigDir}\""
"source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\""
"source \"${zshConfigDir}/oh-my-zsh.sh\""
""
"# Zsh options"
"setopt AUTO_CD"
"setopt CORRECT"
"setopt INTERACTIVE_COMMENTS"
""
"# Starship"
"eval \"$(starship init zsh)\""
""
"# fzf"
"source \"${pkgs.fzf}/shell/key-bindings.zsh\""
"source \"${pkgs.fzf}/shell/completion.zsh\""
""
"# User customizations"
"source \"${zshConfigDir}/custom.zsh\" 2>/dev/null"
];
# User customizations
xdg.configFile."zsh/custom.zsh".text = ''
export EDITOR="nvim"
export PATH="$HOME/.local/bin:$PATH"
'';
};
}
+12 -12
View File
@@ -61,11 +61,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1772818138,
"narHash": "sha256-Q/zaIhzvvjCN6/oPcOsyljP0LO0RUvB90BSuDNVYNF8=",
"lastModified": 1772903801,
"narHash": "sha256-S7r7clnIcoVqpDZwlnXwALm47xkOOGWECAak/wv1LwQ=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "594ce4b67cd089110785a9c23731f61767d233d3",
"rev": "02de28837fe7e824bdb6bae4d5c18c28ff500f0d",
"type": "github"
},
"original": {
@@ -119,11 +119,11 @@
]
},
"locked": {
"lastModified": 1772807318,
"narHash": "sha256-Qjw6ILt8cb2HQQpCmWNLMZZ63wEo1KjTQt+1BcQBr7k=",
"lastModified": 1772845525,
"narHash": "sha256-Dp5Ir2u4jJDGCgeMRviHvEQDe+U37hMxp6RSNOoMMPc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "daa2c221320809f5514edde74d0ad0193ad54ed8",
"rev": "27b93804fbef1544cb07718d3f0a451f4c4cd6c0",
"type": "github"
},
"original": {
@@ -207,11 +207,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1772833450,
"narHash": "sha256-XuuvhTD/72mH8MBncTeOyN0JzLCtwav7lkwBQlIofd4=",
"lastModified": 1772913214,
"narHash": "sha256-lI361+KhTUerHMYJOaDzVhIikAX1PNcZMNY1WEx/+dc=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "4152ac76d0813d9d0f67d2f04653a13fa6e17433",
"rev": "a4ecae91600d7e8ceb31610176d6b40cb816711b",
"type": "github"
},
"original": {
@@ -485,11 +485,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1772624091,
"narHash": "sha256-QKyJ0QGWBn6r0invrMAK8dmJoBYWoOWy7lN+UHzW1jc=",
"lastModified": 1772773019,
"narHash": "sha256-E1bxHxNKfDoQUuvriG71+f+s/NT0qWkImXsYZNFFfCs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "80bdc1e5ce51f56b19791b52b2901187931f5353",
"rev": "aca4d95fce4914b3892661bcb80b8087293536c6",
"type": "github"
},
"original": {
@@ -1,38 +1,30 @@
{ config, pkgs, lib, user, ... }:
{
# NixOS: Install Starship system-wide (optional)
environment.systemPackages = with pkgs; [ starship ];
# Home Manager: Configure Starship for the user
config,
pkgs,
lib,
user,
...
}:
{
home-manager.users.${user.username} = {
programs.starship = {
enable = true; # Enables Starship and adds init to shell configs
enable = true; # Globally enables Starship for all shells
settings = {
addNewline = false;
# Example: Catppuccin Mocha theme
add_newline = false;
format = "$all";
[character]
success_symbol = "[](bold green)"
error_symbol = "[](bold red)"
vicmd_symbol = "[](bold blue)"
[directory]
truncation_length = 3
style = "bold blue"
[git_branch]
symbol = " "
style = "bold purple"
format = "[$symbol$branch]($style) "
};
};
# Optional: Manually ensure Starship init is in shell configs
# Optional: Ensure Starship init is in shell configs (if not auto-added)
xdg.configFile."bashrc".text = lib.concatStringsSep "\n" [
"${config.programs.starship.extraInit}"
"eval \"$(starship init bash)\""
];
xdg.configFile."zshrc".text = lib.concatStringsSep "\n" [
"${config.programs.starship.extraInit}"
"eval \"$(starship init zsh)\""
];
xdg.configFile."config/fish/config.fish".text = ''
starship init fish | source
'';
};
}
@@ -5,29 +5,87 @@
user,
...
}:
let
zshConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/zsh";
in
{
home-manager.users.${user.username} = {
# Install and enable Zsh
programs.zsh = {
enable = true;
enableCompletion = true;
dotDir = "${config.xdg.configHome}/zsh"; # Now correct: inside Home Manager scope
dotDir = zshConfigDir;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
enable = true;
theme = "";
theme = "agnoster"; # Popular minimal theme
plugins = [
"git"
"sudo"
"extract"
"colored-man-pages"
"command-not-found"
"history"
"docker"
"kubectl"
"zsh-autosuggestions"
"zsh-syntax-highlighting"
"history"
"command-not-found"
"extract"
"colored-man-pages"
];
};
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
zshoptions = [ "AUTO_CD" ];
# Shell options (setopt)
shellAliases = {
ls = "exa --icons -a --group-directories-first";
ll = "exa --icons -la --group-directories-first";
grep = "grep --color=auto";
};
};
# Consolidated .zshrc with best practices
xdg.configFile."zsh/.zshrc".text = lib.concatStringsSep "\n" [
"# Enable Powerlevel10k (if installed)"
"${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"
"# Oh-My-Zsh"
"export ZSH=\"${zshConfigDir}\""
"source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\""
"source \"${zshConfigDir}/oh-my-zsh.sh\""
""
"# Zsh options"
"setopt AUTO_CD"
"setopt CORRECT"
"setopt INTERACTIVE_COMMENTS"
"setopt APPEND_HISTORY"
"setopt INC_APPEND_HISTORY"
"setopt HIST_IGNORE_ALL_DUPS"
"setopt HIST_REDUCE_BLANKS"
"setopt HIST_SAVE_NO_DUPS"
"setopt HIST_VERIFY"
"setopt SHARE_HISTORY"
""
"# Starship prompt (if enabled)"
"eval \"$(starship init zsh)\""
""
"# fzf key bindings and completion"
"source \"${pkgs.fzf}/shell/key-bindings.zsh\""
"source \"${pkgs.fzf}/shell/completion.zsh\""
""
"# Load direnv"
"eval \"$(direnv hook zsh)\""
""
"# Load nix-direnv (if using direnv with Nix)"
"if [ -f \"${pkgs.nix-direnv}/share/nix-direnv/direnvrc\" ]; then"
" source \"${pkgs.nix-direnv}/share/nix-direnv/direnvrc\""
"fi"
""
"# User-specific customizations"
"source \"${zshConfigDir}/custom.zsh\" 2>/dev/null"
];
# Optional: User customizations (managed separately)
xdg.configFile."zsh/custom.zsh".text = ''
# Add your custom aliases, functions, and exports here
export EDITOR="nvim"
export PATH="$HOME/.local/bin:$PATH"
'';
};
}
@@ -1,136 +0,0 @@
{ config, pkgs, lib, ... }:
let
lightdmConf = builtins.readFile ../../assets/conf/core/lightdm.conf;
lockPng = ../../assets/lockscreen.png;
greeterConfPath = ../../assets/conf/core/lightdm-gtk-greeter.conf;
greeterRaw = builtins.readFile greeterConfPath;
# Extract "key = value" from the greeter conf.
# Returns null if not found.
getIniValue = key:
let
lines = lib.splitString "\n" greeterRaw;
# Captures the value part (group 0) from a single line.
# We match line-by-line because Nix regex does NOT support PCRE flags like (?s).
m =
let
ms = builtins.filter (x: x != null) (map (line:
builtins.match
("^[[:space:]]*" + key + "[[:space:]]*=[[:space:]]*([^#;]+).*$")
line
) lines);
in
if ms == [] then null else builtins.elemAt ms 0;
in
if m == null then null else lib.strings.trim (builtins.elemAt m 0);
# In your greeter.conf these are *package keys*, not theme names.
themePkgKey = getIniValue "theme-name";
iconPkgKey = getIniValue "icon-theme-name";
cursorPkgKey = getIniValue "cursor-theme-name";
cursorSizeStr = getIniValue "cursor-theme-size";
cursorSize =
if cursorSizeStr == null then null
else lib.toInt (lib.strings.trim cursorSizeStr);
# Map package-keys (from greeter.conf) -> { package, name }
#
# IMPORTANT:
# - "name" must be the real theme/icon/cursor NAME as seen under share/themes or share/icons.
# - "package" is the Nixpkgs derivation providing it.
pkgMap = {
catppuccinThemePkg = {
package = pkgs.catppuccin-gtk.override {
accents = [ "blue" ];
variant = "mocha";
size = "standard";
tweaks = [ ];
};
name = "Catppuccin-Mocha-Standard-Blue-Dark";
};
papirus-icon-theme = {
package = pkgs.papirus-icon-theme;
name = "Papirus-Dark";
};
bibata-cursors = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
};
};
pick = key:
if key == null then
throw "lightdm: missing required key in ${toString greeterConfPath}"
else if !(pkgMap ? "${key}") then
throw "lightdm: unknown package key '${key}' in ${toString greeterConfPath}. Known keys: ${lib.concatStringsSep ", " (builtins.attrNames pkgMap)}"
else
pkgMap."${key}";
themeSel = pick themePkgKey;
iconSel = pick iconPkgKey;
cursorSel = pick cursorPkgKey;
# Rewrite greeter.conf so LightDM sees REAL names, not package keys.
# Also force background to lockPng.
greeterFixed =
''
[greeter]
theme-name = ${themeSel.name}
icon-theme-name = ${iconSel.name}
cursor-theme-name = ${cursorSel.name}
${lib.optionalString (cursorSize != null) "cursor-theme-size = ${toString cursorSize}"}
''
+ "\n"
+ greeterRaw;
in
{
services.greetd.enable = false;
services.xserver = {
enable = true;
desktopManager.xterm.enable = false;
displayManager.lightdm = {
enable = true;
background = lockPng;
greeters.gtk = {
enable = true;
theme = {
name = themeSel.name;
package = themeSel.package;
};
iconTheme = {
name = iconSel.name;
package = iconSel.package;
};
cursorTheme = {
name = cursorSel.name;
package = cursorSel.package;
} // lib.optionalAttrs (cursorSize != null) {
size = cursorSize;
};
# This includes your (rewritten) greeter config.
extraConfig = greeterFixed;
};
extraConfig = lightdmConf;
};
};
programs.hyprland.enable = true;
# Optional: make them available system-wide as well
environment.systemPackages = [
themeSel.package
iconSel.package
cursorSel.package
];
}