Home manager applied to caesium
This commit is contained in:
+111
-2
@@ -1,3 +1,112 @@
|
||||
{
|
||||
home.backupFileExtension = "before-nix";
|
||||
{ pkgs, hostname, userConfig, ... }:
|
||||
let
|
||||
onePassPath = if pkgs.stdenv.isDarwin
|
||||
then "${userConfig.homeDirectory}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
|
||||
else "${userConfig.homeDirectory}/.1password/agent.sock";
|
||||
ghosttyPkg = if pkgs.stdenv.isDarwin
|
||||
then pkgs."ghostty-bin"
|
||||
else pkgs.ghostty;
|
||||
in {
|
||||
home.stateVersion = "26.05";
|
||||
home.username = userConfig.username;
|
||||
home.homeDirectory = userConfig.homeDirectory;
|
||||
home.sessionVariables.SSH_AUTH_SOCK = onePassPath;
|
||||
|
||||
xdg.enable = true;
|
||||
xdg.configFile."ssh.conf".source = ./config.ssh.conf;
|
||||
xdg.configFile."1Password/ssh/agent.toml".text = ''
|
||||
[[ssh-keys]]
|
||||
item = "${userConfig._1PassKeyName}"
|
||||
vault = "${userConfig._1PassKeyVault}"
|
||||
'';
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
initContent = ''
|
||||
export SSH_AUTH_SOCK=~/.1password/agent.sock
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
ll = "ls -l";
|
||||
gst = "git status";
|
||||
nix-update = "sudo nixos-rebuild switch --flake ~/nixos#${hostname}";
|
||||
home-update = "home-manager switch --flake ~/nixos#${userConfig.username}@${hostname}";
|
||||
};
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
# Optional custom settings (translates to ~/.config/starship.toml)
|
||||
settings = {
|
||||
# Line 1: ➜ folder git:(branch) [status]
|
||||
format = "$character$directory$git_branch\${custom.git_dirty} ";
|
||||
|
||||
# Show current directory name only
|
||||
directory = {
|
||||
style = "bold cyan";
|
||||
truncation_length = 1;
|
||||
truncate_to_repo = false;
|
||||
};
|
||||
|
||||
# git:(branch) styling
|
||||
git_branch = {
|
||||
format = "[git:\\([$branch](red)\\)](bold blue)";
|
||||
};
|
||||
|
||||
# Bottom line prompt arrow
|
||||
character = {
|
||||
success_symbol = "[➜](bold green)";
|
||||
error_symbol = "[➜](bold red)";
|
||||
vicmd_symbol = "[➜](bold yellow)";
|
||||
};
|
||||
|
||||
custom.git_dirty = {
|
||||
when = "test -n \"$(git status --porcelain 2>/dev/null)\"";
|
||||
format = " [✘](yellow)";
|
||||
};
|
||||
|
||||
# Nix shell indicator module configuration
|
||||
nix_shell = {
|
||||
symbol = "❄️ ";
|
||||
format = "via [$symbol$state]($style) ";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
extraConfig = builtins.readFile ./config.ssh.conf;
|
||||
settings = {
|
||||
"*" = {
|
||||
controlMaster = "auto";
|
||||
controlPath = "~/.ssh/master-%r@%h:%p";
|
||||
identityAgent = onePassPath;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user.name = userConfig.gitName;
|
||||
user.email = userConfig.gitEmail;
|
||||
init.defaultBranch = "main";
|
||||
pull.rebase = false;
|
||||
core.sshCommand = "ssh";
|
||||
};
|
||||
};
|
||||
|
||||
programs.ghostty = {
|
||||
enable = true;
|
||||
package = ghosttyPkg;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user