feat: create new home/ directory structure for profile-based config
New structure:
- home/base/ - Always loaded (shell, cli-tools, secrets)
- home/coding/ - Profile-independent dev tooling (editor, lsp, git, agents)
- home/profiles/ - Freely combinable profiles (gaming, media)
- home/desktop/ - Desktop-only (wm, apps, theme)
- home/server/ - Minimal server stub
Migration sources:
- home/features/cli/ → home/base/{shell,cli-tools,secrets}
- home/features/desktop/hyprland,wayland,rofi → home/desktop/wm/
- home/features/desktop/obsidian,office,webapps,crypto → home/desktop/apps/
- home/features/desktop/fonts,theme,wallpapers → home/desktop/theme/
- gaming.nix split → home/profiles/gaming/{steam,gamescope}
- media.nix split → home/profiles/media/{obs,ffmpeg,yt-dlp,kdenlive,handbrake}
Option namespaces updated:
- features.cli.* → base.shell.* / base.cliTools.* / base.secrets
- features.desktop.* → desktop.wm.* / desktop.apps.* / desktop.theme.*
- features.desktop.gaming → profiles.gaming.*
- features.desktop.media → profiles.media.*
Verified: nix flake check passes (warnings only)
This commit is contained in:
7
home/base/shell/default.nix
Normal file
7
home/base/shell/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
# Shell aggregator — imports Nushell (primary) and Starship prompt.
|
||||
{...}: {
|
||||
imports = [
|
||||
./nushell.nix
|
||||
./starship.nix
|
||||
];
|
||||
}
|
||||
85
home/base/shell/nushell.nix
Normal file
85
home/base/shell/nushell.nix
Normal file
@@ -0,0 +1,85 @@
|
||||
# Primary shell configuration — Nushell with environment, aliases, and integrations.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.base.shell.nushell;
|
||||
in {
|
||||
options.base.shell.nushell.enable = mkEnableOption "enable nushell";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
envFile.text = ''
|
||||
$env.config.show_banner = false
|
||||
$env.NIX_PATH = "nixpkgs=channel:nixos-unstable"
|
||||
$env.NIX_LOG = "iunfo"
|
||||
$env.WEBKIT_DISABLE_COMPOSITING_MODE = "1"
|
||||
$env.TERMINAL = "ghostty"
|
||||
$env.EDITOR = "nvim"
|
||||
$env.VISUAL = "zeditor"
|
||||
$env.FZF_DEFAULT_COMMAND = "fd --type f --exclude .git --follow --hidden"
|
||||
$env.FZF_DEFAULT_OPTS = "--preview='bat --color=always -n {}' --bind 'ctrl-/:toggle-preview' --header 'Press CTRL-Y to copy command into clipboard' --bind 'ctrl-/:toggle-preview' --bind 'ctrl-y:execute-silent(echo -n {2..} | wl-copy)+abort' --color bg:#282a36,bg+:#44475a,fg:#f8f8f2,fg+:#f8f8f2,header:#6272a4,hl:#bd93f9,hl+:#bd93f9,info:#ffb86c,marker:#ff79c6,pointer:#ff79c6,prompt:#50fa7b,spinner:#ffb86c"
|
||||
$env.XDG_DATA_HOME = $"($env.HOME)/.local/share"
|
||||
$env.SSH_AUTH_SOCK = "/run/user/1000/gnupg/S.gpg-agent.ssh"
|
||||
$env.PATH = ($env.PATH | split row (char esep) | append $"($env.HOME)/.cache/.bun/bin" | append $"($env.HOME)/.npm-global/bin" | uniq)
|
||||
$env.NPM_CONFIG_PREFIX = $"($env.HOME)/.npm-global"
|
||||
$env.FLAKE = $"($env.HOME)/p/NIX/nixos-config"
|
||||
|
||||
# Load kestractl-env from agenix
|
||||
if ("/run/agenix/kestractl-env" | path exists) {
|
||||
open /run/agenix/kestractl-env
|
||||
| lines
|
||||
| where {($in | str trim | str length) > 0}
|
||||
| parse "{key}={value}"
|
||||
| update value {str trim -c '"'}
|
||||
| transpose -r -d
|
||||
| load-env
|
||||
}
|
||||
'';
|
||||
|
||||
configFile.text = ''
|
||||
# Aliases
|
||||
alias .. = cd ..
|
||||
alias ... = cd ...
|
||||
alias h = cd $env.HOME
|
||||
alias b = yazi
|
||||
alias lt = eza --tree --level=2 --long --icons --git
|
||||
alias grep = rg
|
||||
alias just = just --unstable
|
||||
|
||||
alias node = bun
|
||||
alias npx = bunx
|
||||
|
||||
alias n = nix
|
||||
alias nd = nix develop -c $nu.current-shell
|
||||
alias ns = nix shell
|
||||
alias nsn = nix shell nixpkgs#
|
||||
alias nb = nix build
|
||||
alias nbn = nix build nixpkgs#
|
||||
alias nf = nix flake
|
||||
|
||||
alias nr = sudo nixos-rebuild --flake .
|
||||
alias nrs = sudo nixos-rebuild switch --flake .#(sys host | get hostname)
|
||||
alias snr = sudo nixos-rebuild --flake .
|
||||
alias snrs = sudo nixos-rebuild --flake . switch
|
||||
alias hm = home-manager --flake .
|
||||
alias hms = home-manager --flake . switch
|
||||
alias hmr = do { cd ~/projects/nix-configurations; nix flake lock --update-input dotfiles; home-manager --flake .#(whoami)@(hostname) switch }
|
||||
|
||||
alias tsu = sudo tailscale up
|
||||
alias tsd = sudo tailscale down
|
||||
|
||||
alias vi = nvim
|
||||
alias vim = nvim
|
||||
|
||||
if (which tv | is-not-empty) {
|
||||
mkdir ($nu.data-dir | path join "vendor/autoload")
|
||||
tv init nu | save -f ($nu.data-dir | path join "vendor/autoload/tv.nu")
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
69
home/base/shell/starship.nix
Normal file
69
home/base/shell/starship.nix
Normal file
@@ -0,0 +1,69 @@
|
||||
# Starship cross-shell prompt with nix-colors theming.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.base.shell.starship;
|
||||
in {
|
||||
options.base.shell.starship.enable = mkEnableOption "enable starship prompt";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
settings = {
|
||||
format = "$all$character";
|
||||
palette = "universal";
|
||||
|
||||
palettes.universal = {
|
||||
background = "#${config.colorScheme.palette.base00}";
|
||||
surface = "#${config.colorScheme.palette.base01}";
|
||||
muted = "#${config.colorScheme.palette.base03}";
|
||||
text = "#${config.colorScheme.palette.base05}";
|
||||
bright = "#${config.colorScheme.palette.base07}";
|
||||
accent1 = "#${config.colorScheme.palette.base08}";
|
||||
accent2 = "#${config.colorScheme.palette.base09}";
|
||||
accent3 = "#${config.colorScheme.palette.base0A}";
|
||||
accent4 = "#${config.colorScheme.palette.base0B}";
|
||||
accent5 = "#${config.colorScheme.palette.base0C}";
|
||||
accent6 = "#${config.colorScheme.palette.base0D}";
|
||||
accent7 = "#${config.colorScheme.palette.base0E}";
|
||||
};
|
||||
|
||||
character = {
|
||||
success_symbol = "[❯](accent7)";
|
||||
error_symbol = "[❯](accent1)";
|
||||
};
|
||||
|
||||
directory = {
|
||||
style = "accent6";
|
||||
truncation_length = 3;
|
||||
truncate_to_repo = false;
|
||||
};
|
||||
|
||||
git_branch = {
|
||||
style = "accent7";
|
||||
};
|
||||
|
||||
git_status = {
|
||||
style = "accent5";
|
||||
};
|
||||
|
||||
cmd_duration = {
|
||||
style = "accent3";
|
||||
};
|
||||
|
||||
hostname = {
|
||||
style = "accent4";
|
||||
};
|
||||
|
||||
username = {
|
||||
style_user = "accent2";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user