Finalised Terminal Config

This commit is contained in:
2025-12-27 13:35:09 +01:00
parent f39de85d57
commit 9a777def2f
12 changed files with 165 additions and 212 deletions

View File

@@ -1,26 +1,15 @@
{
pkgs,
inputs,
self,
primaryUser,
...
}:
{
{ pkgs, inputs, self, primaryUser, ... }: {
imports = [
# ./homebrew.nix
./settings.nix
inputs.home-manager.darwinModules.home-manager
inputs.nix-homebrew.darwinModules.nix-homebrew
# inputs.catppuccin.nixosModules.catppuccin
];
# nix config
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
experimental-features = [ "nix-command" "flakes" ];
# disabled due to https://github.com/NixOS/nix/issues/7273
# auto-optimise-store = true;
};
@@ -39,26 +28,19 @@
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${primaryUser} = {
imports = [
../home
];
};
extraSpecialArgs = {
inherit inputs self primaryUser;
};
users.${primaryUser} = { imports = [ ../home ]; };
extraSpecialArgs = { inherit inputs self primaryUser; };
};
# macOS-specific settings
programs.fish.enable = true;
system.primaryUser = primaryUser;
users.users.${primaryUser} = {
home = "/Users/${primaryUser}";
shell = pkgs.zsh;
shell = pkgs.fish;
};
environment = {
systemPath = [
"/opt/homebrew/bin"
];
systemPath = [ "/opt/homebrew/bin" ];
pathsToLink = [ "/Applications" ];
};
}

41
flake.lock generated
View File

@@ -17,24 +17,6 @@
"type": "github"
}
},
"catppuccin": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1765990358,
"narHash": "sha256-l8x0gU8mnYaGMl+gWrsSHKBJlZWD8KXJfHTkRlFiPI0=",
"owner": "catppuccin",
"repo": "nix",
"rev": "de1b60ca45a578f59f7d84c8d338b346017b2161",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nix",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@@ -116,22 +98,6 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1763966396,
"narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5ae3b07d8d6527c42f17c876e404993199144b6a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1751949589,
"narHash": "sha256-mgFxAPLWw0Kq+C8P3dRrZrOYEQXOtKuYVlo9xvPntt8=",
@@ -147,7 +113,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_2": {
"locked": {
"lastModified": 1766653575,
"narHash": "sha256-TPgxCS7+hWc4kPhzkU5dD2M5UuPhLuuaMNZ/IpwKQvI=",
@@ -166,7 +132,7 @@
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_2",
"systems": "systems"
},
"locked": {
@@ -185,11 +151,10 @@
},
"root": {
"inputs": {
"catppuccin": "catppuccin",
"darwin": "darwin",
"home-manager": "home-manager",
"nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim"
}
},

View File

@@ -18,34 +18,19 @@
# declarative Neovim
nixvim.url = "github:nix-community/nixvim";
# declarative Themeing
catppuccin.url = "github:catppuccin/nix";
};
outputs =
{
self,
darwin,
nixpkgs,
home-manager,
nix-homebrew,
nixvim,
catppuccin,
...
}@inputs:
{ self, darwin, nixpkgs, home-manager, nix-homebrew, nixvim, ... }@inputs:
let
# TODO: replace with your username
primaryUser = "phil";
in
{
in {
# build darwin flake using:
# $ darwin-rebuild build --flake .#<name>
darwinConfigurations."cyper-mac" = darwin.lib.darwinSystem {
system = "x86_64-darwin"; # aarch64-darwin
modules = [
./darwin
./hosts/cyper-mac/configuration.nix
];
modules = [ ./darwin ./hosts/cyper-mac/configuration.nix ];
specialArgs = { inherit inputs self primaryUser; };
};

View File

@@ -1,6 +0,0 @@
_: {
catppuccin = {
enable = false;
flavor = "mocha";
};
}

View File

@@ -1,13 +1,10 @@
{ primaryUser, inputs, ... }:
{
{ primaryUser, inputs, ... }: {
imports = [
inputs.nixvim.homeModules.nixvim
# inputs.catppuccin.homeModules.catppuccin
./neovim
./packages.nix
./git.nix
./shell.nix
# ./catppuccin.nix
];
home = {
@@ -16,8 +13,5 @@
sessionVariables = {
# shared environment variables
};
# create .hushlogin file to suppress login messages
file.".hushlogin".text = "";
};
}

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
# Alpha: Start screen/dashboard for Neovim
# Shows a custom ASCII art header and quick action buttons on startup.
programs.nixvim.plugins.alpha = {
@@ -47,14 +46,10 @@
{
type = "button";
val = "[+] New file";
on_press.__raw = "function() vim.cmd[[ene]] vim.cmd[[startinsert]] end";
on_press.__raw =
"function() vim.cmd[[ene]] vim.cmd[[startinsert]] end";
opts = {
keymap = [
"n"
"e"
":ene <BAR> startinsert <CR>"
{ }
];
keymap = [ "n" "e" ":ene <BAR> startinsert <CR>" { } ];
shortcut = "e";
position = "center";
cursor = 3;
@@ -68,12 +63,7 @@
val = "[?] Find file";
on_press.__raw = "function() vim.cmd[[Telescope find_files]] end";
opts = {
keymap = [
"n"
"f"
":Telescope find_files <CR>"
{ }
];
keymap = [ "n" "f" ":Telescope find_files <CR>" { } ];
shortcut = "f";
position = "center";
cursor = 3;
@@ -87,12 +77,7 @@
val = "[~] Recent files";
on_press.__raw = "function() vim.cmd[[Telescope oldfiles]] end";
opts = {
keymap = [
"n"
"r"
":Telescope oldfiles <CR>"
{ }
];
keymap = [ "n" "r" ":Telescope oldfiles <CR>" { } ];
shortcut = "r";
position = "center";
cursor = 3;
@@ -104,14 +89,9 @@
{
type = "button";
val = "[Y] Yazi";
on_press.__raw = "function() vim.cmd[[Yazi]] end";
on_press.__raw = "function() require('yazi').yazi() end";
opts = {
keymap = [
"n"
"y"
":Yazi<CR>"
{ }
];
keymap = [ "n" "y" ":Yazi<CR>" { } ];
shortcut = "y";
position = "center";
cursor = 3;
@@ -125,12 +105,7 @@
val = "[X] Quit";
on_press.__raw = "function() vim.cmd[[qa]] end";
opts = {
keymap = [
"n"
"q"
":qa<CR>"
{ }
];
keymap = [ "n" "q" ":qa<CR>" { } ];
shortcut = "q";
position = "center";
cursor = 3;

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
# Conform: Code formatter that runs external formatting tools
# Automatically formats code on save for consistent style.
programs.nixvim = {
@@ -16,7 +15,7 @@
};
format_on_save = {
timeout_ms = 500;
timeout_ms = 2000;
lsp_fallback = true;
};
};

View File

@@ -1,7 +1,5 @@
{ ... }:
{
{ ... }: {
imports = [
./alpha.nix
./treesitter.nix
./lint.nix
./lsp.nix
@@ -11,6 +9,7 @@
./toggleterm.nix
./telescope.nix
./catppuccin.nix
./alpha.nix
];
programs.nixvim = {
@@ -23,13 +22,13 @@
plugins.web-devicons.enable = true;
opts = {
number = true; # Show line numbers
cursorline = true; # Highlight current line
showmode = true; # already in statusline
hlsearch = true; # Highlight search result
incsearch = true; # Incremental Search
tabstop = 4;
termguicolors = true; # Enable 24-bit colormode
number = true; # Show line numbers
cursorline = true; # Highlight current line
showmode = true; # already in statusline
hlsearch = true; # Highlight search result
incsearch = true; # Incremental Search
tabstop = 4;
termguicolors = true; # Enable 24-bit colormode
};
# Clipboard keymaps - yank to system clipboard
@@ -38,51 +37,51 @@ termguicolors = true; # Enable 24-bit colormode
{
mode = "n";
key = "y";
action = "\"+y";
action = ''"+y'';
options.desc = "Yank to clipboard";
}
{
mode = "v";
key = "y";
action = "\"+y";
action = ''"+y'';
options.desc = "Yank to clipboard";
}
{
mode = "n";
key = "Y";
action = "\"+Y";
action = ''"+Y'';
options.desc = "Yank line to clipboard";
}
# Delete operations
{
mode = "n";
key = "d";
action = "\"+d";
action = ''"+d'';
options.desc = "Delete to clipboard";
}
{
mode = "v";
key = "d";
action = "\"+d";
action = ''"+d'';
options.desc = "Delete to clipboard";
}
{
mode = "n";
key = "D";
action = "\"+D";
action = ''"+D'';
options.desc = "Delete line to clipboard";
}
# Paste operations
{
mode = "n";
key = "p";
action = "\"+p";
action = ''"+p'';
options.desc = "Paste from clipboard";
}
{
mode = "v";
key = "p";
action = "\"+p";
action = ''"+p'';
options.desc = "Paste from clipboard";
}
];

View File

@@ -1,12 +1,16 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
# Yazi: Terminal file manager integration for Neovim
# Provides a fast, visual way to browse and manage files.
programs.nixvim = {
yazi = {
enable = true;
settings = {
open_for_directories = true;
};
};
# Use extraPlugins to manually load yazi.nvim
extraPlugins = with pkgs.vimPlugins; [ yazi-nvim ];
# Configure yazi after it's loaded
extraConfigLua = ''
require('yazi').setup({
open_for_directories = true,
})
'';
keymaps = [
{
@@ -31,7 +35,7 @@
}
];
# Install yazi terminal program
extraPackages = with pkgs; [ yazi ];
};
}

View File

@@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{ pkgs, ... }: {
home = {
packages = with pkgs; [
# dev tools
@@ -26,6 +25,7 @@
# fonts
nerd-fonts.fira-code
nerd-fonts.fira-mono
nerd-fonts.hack
];
};
}

View File

@@ -1,21 +1,26 @@
{pkgs, ...}: {
{ pkgs, ... }: {
home.packages = with pkgs; [
eza # ls replacement
fzf # FuzzyFinder
tdf # terminal pdf viewer
jq # json parser
tree
fastfetch # system stats
# Fun stuff
lolcat
cmatrix
];
programs.kitty = {
enable = true;
themeFile = "Catppuccin-Mocha";
font = {
name = "Fira Code Nerd Font";
size = 12;
};
settings = {
confirm_os_window_close = 0;
dynamic_background_opacity = true; # ctrl+shift+a>m/l
@@ -28,12 +33,11 @@
tab_bar_min_tabs = 1;
tab_bar_edge = "bottom";
tab_bar_style = "powerline"; # Should be changed to custom
tab_powerline_style = "slanted";
tab_title_template = "{title}{' :{}:'.format(num_windows) if num_windows > 1 else ''}";
tab_bar_style = "custom"; # Should be changed to custom
tab_title_template =
"{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}";
symbol_map =
let
symbol_map = let
mappings = [
"U+23FB-U+23FE"
"U+2B58"
@@ -54,20 +58,19 @@
"U+F300-U+F313"
"U+E5FA-U+E62B"
];
in
(builtins.concatStringsSep "," mappings) + " Symbols Nerd Font";
in (builtins.concatStringsSep "," mappings) + " Symbols Nerd Font Mono";
};
};
home.file.".config/kitty/tab_bar.py".source = ./tab_bar.py;
programs.yazi = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
settings = {
ration = [1 3 4];
};
settings = { ration = [ 1 3 4 ]; };
};
programs.zsh = {
@@ -77,20 +80,34 @@
syntaxHighlighting.enable = true;
shellAliases = {
la = "ls -la";
".." = "cd ..";
ls = "eza";
la = "eza -la";
f = "fzf";
i = "kitty +kitten icat";
"nix-switch" = "sudo darwin-rebuild switch --flake ~/.config/nix";
};
initContent = "fastfetch";
};
programs.fish = {
enable = true;
shellAliases = {
la = "ls -la";
".." = "cd ..";
ls = "eza";
la = "eza -la";
f = "fzf";
i = "kitty +kitten icat";
"nix-switch" = "sudo darwin-rebuild switch --flake ~/.config/nix";
};
interactiveShellInit = ''
starship init fish | source
fzf --fish | source
function fish_greeting
fastfetch
end
'';
};
programs.starship = {
@@ -99,7 +116,9 @@
add_newline = true;
command_timeout = 500;
format = "$username$hostname $directory $git_branch$git_status\n$character ";
format = ''
$username$hostname $directory $git_branch$git_status
$character '';
right_format = "$cmd_duration";
username = {
@@ -129,7 +148,8 @@
# Git status module settings
git_status = {
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](red) ($ahead_behind$stashed)]($style)";
format =
"[[(*$conflicted$untracked$modified$staged$renamed$deleted)](red) ($ahead_behind$stashed)]($style)";
style = "bold #a6e3a1";
conflicted = "";
untracked = "";
@@ -153,7 +173,7 @@
};
nix_shell = {
format = "[$symbol$state( \($name\))]($style)";
format = "[$symbol$state( ($name))]($style)";
symbol = "U+02744";
style = "bold #89dceb";
};
@@ -161,4 +181,6 @@
};
home.file.".config/fastfetch/config.jsonc".source = ./fastfetch.jsonc;
home.file.".hushlogin".text = ""; # Suppress login
}

34
home/tab_bar.py Normal file
View File

@@ -0,0 +1,34 @@
from datetime import datetime
from kitty.tab_bar import DrawData, ExtraData, TabBarData, as_rgb
from kitty.fast_data_types import Screen
def draw_tab(
draw_data: DrawData,
screen: Screen,
tab: TabBarData,
before: int,
max_title_length: int,
index: int,
is_last: bool,
extra_data: ExtraData,
) -> int:
# Left side: Current directory or command
screen.cursor.fg = as_rgb(int("a6e3a1", 16))
screen.cursor.bg = as_rgb(int("1e1e2e", 16))
# Get the foreground process (command) or use title
title = tab.active_fg or tab.title or "shell"
screen.draw(f" {title} ")
# Middle: Nix icon
screen.cursor.fg = as_rgb(int("89dceb", 16))
screen.draw("")
# Right: Current time
screen.cursor.fg = as_rgb(int("cdd6f4", 16))
current_time = datetime.now().strftime("%H:%M")
screen.draw(f"{current_time} ")
return screen.cursor.x