use common home

This commit is contained in:
2025-10-09 10:26:34 +02:00
parent 2c6299e326
commit 3680f878e2
5 changed files with 45 additions and 137 deletions

View File

@@ -15,7 +15,10 @@ let
shellAliases = { shellAliases = {
hm = "nix run home-manager/master -- switch --flake github:cupcakearmy/nix?dir=cli#${name} -b backup"; hm = "nix run home-manager/master -- switch --flake github:cupcakearmy/nix?dir=cli#${name} -b backup";
}; };
# Lists are not recursively updated, need to do by hand
packages = common.home.packages ++ [ ];
}; };
}; };
merged = lib.recursiveUpdate common overwrite;
in in
lib.recursiveUpdate common overwrite merged

View File

@@ -2,7 +2,6 @@
pkgs, pkgs,
... ...
}: }:
{ {
home.stateVersion = "25.11"; home.stateVersion = "25.11";
@@ -19,12 +18,12 @@
btop btop
rclone rclone
rename rename
tmux
tree tree
wget wget
rsync rsync
yq yq
delta delta
kubectl
# Rust utils # Rust utils
bat bat
@@ -38,15 +37,14 @@
yazi yazi
starship starship
# Dev # TUI
lazydocker lazydocker
lazygit
k9s k9s
kubectl
# Editor # Editor
neovim neovim
fzf fzf
lazygit
# Fonts # Fonts
nerd-fonts.jetbrains-mono nerd-fonts.jetbrains-mono
@@ -78,6 +76,7 @@
}; };
programs = { programs = {
home-manager.enable = true;
direnv.enable = true; direnv.enable = true;
zoxide.enable = true; zoxide.enable = true;

6
flake.lock generated
View File

@@ -42,11 +42,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1759826507, "lastModified": 1759917807,
"narHash": "sha256-vwXL9H5zDHEQA0oFpww2one0/hkwnPAjc47LRph6d0I=", "narHash": "sha256-WoSazth5EXIJmveWf0zbTMycrgpbLYOth6KhmltMuv0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bce5fe2bb998488d8e7e7856315f90496723793c", "rev": "fb5cf53218b987f2703a5bbc292a030c0fe33443",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -5,103 +5,46 @@
config, config,
... ...
}: }:
{ let
# https://nix-community.github.io/home-manager common = (import ../common/home.nix) { inherit pkgs; };
home.stateVersion = "25.05"; overwrite = {
programs.home-manager.enable = true; home.username = host.username;
home.homeDirectory = "/Users/${host.username}";
home.username = host.username; home.packages =
home.homeDirectory = "/Users/${host.username}"; common.home.packages
++ (import ./pkgs.nix { inherit pkgs; })
++ ((lib.attrByPath [ "extras" "pkgs" ] (pkgs: [ ]) host) pkgs);
home.packages = fonts.fontconfig.enable = true;
(import ./pkgs.nix { inherit pkgs; })
++ ((lib.attrByPath [ "extras" "pkgs" ] (pkgs: [ ]) host) pkgs);
fonts.fontconfig.enable = true; home = {
home = { file = {
sessionVariables = { ".config/ghostty/config".source = ../files/ghostty/config;
EDITOR = "nvim"; ".gitconfig".source = ../files/git/gitconfig;
}; ".gitignore_global".source = ../files/git/gitignore_global;
".gitconfig.local".source = ../secrets/git/config.${host.hostName};
".config/nvim".source = ../files/nvim;
"Library/Application Support/lazydocker/config.yml".source = ../files/lazydocker/config.yml;
file = { # Secrets
".config/ghostty/config".source = ../files/ghostty/config; ".ssh/config".text = builtins.replaceStrings [ "@SSH_KEY@" ] [ host.sshKey ] (
".gitconfig".source = ../files/git/gitconfig; builtins.readFile ../secrets/ssh/config.template
".gitignore_global".source = ../files/git/gitignore_global; );
".gitconfig.local".source = ../secrets/git/config.${host.hostName}; };
".config/nvim".source = ../files/nvim;
"Library/Application Support/lazydocker/config.yml".source = ../files/lazydocker/config.yml;
# Secrets shellAliases = {
".ssh/config".text = builtins.replaceStrings [ "@SSH_KEY@" ] [ host.sshKey ] ( p = "pnpm";
builtins.readFile ../secrets/ssh/config.template px = "pnpm -s dlx";
); n = "fnm use --install-if-missing";
}; c = "pwd | pbcopy";
shellAliases = { vai = "sudo darwin-rebuild switch --flake ~/.config/nix-macos#${host.hostName}";
# Rust re-maps };
l = "eza -a1lh";
ls = "eza";
cat = "bat";
cd = "z";
# QOL
dc = "docker compose";
rsync = "rsync -az --info=progress2";
t = "tmux new-session -A -s main";
e = "nvim";
g = "lazygit";
d = "lazydocker";
p = "pnpm";
px = "pnpm -s dlx";
n = "fnm use --install-if-missing";
c = "pwd | pbcopy";
k = "kubectl";
vai = "sudo darwin-rebuild switch --flake ~/.config/nix-macos#${host.hostName}";
}; };
}; };
programs = { merged = lib.recursiveUpdate common overwrite;
direnv.enable = true; in
zoxide.enable = true; merged
fish = {
enable = true;
interactiveShellInit = ''
if type -q starship
starship init fish | source
end
if type -q fnm
fnm env --use-on-cd | source
end
if type -q nvs
nvs env --source | source
end
'';
};
bash = {
enable = true;
};
tmux = {
enable = true;
clock24 = true;
mouse = true;
extraConfig = ''
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# switch panes using jkhl
bind h select-pane -L
bind l select-pane -R
bind j select-pane -U
bind k select-pane -D
'';
shell = "${pkgs.fish}/bin/fish";
terminal = "tmux-256color";
};
};
}

View File

@@ -2,56 +2,20 @@
with pkgs; with pkgs;
[ [
# Base # Base
tmux
git
git-lfs
git-crypt
gh gh
bfg-repo-cleaner bfg-repo-cleaner
gnutar
gnupg
htop
btop
rclone
rename
tmux
tree
wget
woff2 woff2
rsync
yq
delta
# Rust utils
bat
eza
fd
ripgrep
ripgrep-all
zoxide
uutils-coreutils-noprefix
dust
yazi
starship
# Dev # Dev
devenv devenv
nixpacks nixpacks
ollama
colima
lazydocker
exercism
posting posting
terraform terraform
k9s
kubectl
claude-code claude-code
opencode
# Editor # Editor
nvs nvs
neovim
fzf
lazygit
lua lua
luajitPackages.luarocks luajitPackages.luarocks
ast-grep ast-grep
@@ -71,6 +35,5 @@ with pkgs;
go go
# Fonts # Fonts
nerd-fonts.jetbrains-mono
karla karla
] ]