with one click
home-manager
Home Manager Skill
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Home Manager Skill
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Read, write, search and reorganise notes in the local Obsidian vaults. Use for anything touching ~/Documents/R3_vault, ~/Documents/Synechron or ~/Documents/My_Obsidian_Vault/Privat — finding notes, adding or editing content, renaming/moving notes without breaking links, and daily notes. Triggers on "my notes", "my vault", "Obsidian", "write this up in my notes", or a request to look something up in personal documentation.
Manage DNS records for the user's GoDaddy-registered domains. Add/upsert, delete, list, look up specific records, verify a stored record matches an expected value, and check public DNS resolution via dig. Triggers on `/dns`, requests to add/change/check A, AAAA, CNAME, MX, TXT, NS, SRV records on the user's domains, debugging DNS propagation, or auditing what's set at GoDaddy vs what's resolving in the wild.
Operate Google Workspace from the terminal via the `gog` CLI (gogcli). Use for checking and replying to Gmail, managing Google Tasks, reading and creating Calendar events, Google Chat (spaces/DMs/messages), Meet spaces, Contacts, Drive/Docs/Sheets, and more. Triggers on `/gog`, `/gog mail`, `/gog tasks`, `/gog events`, `/gog chat`, `/gog meet`, or any request to check/read/reply/send email, list or add tasks, see today's agenda, or message someone on Chat for the user's Google account.
Agenix Skill
cargo2nix Skill
COSMIC Desktop Environment Skill
| name | home-manager |
| version | 1 |
| description | Home Manager Skill |
A specialized skill for working with Home Manager in NixOS, providing expert guidance on user environment configuration, dotfile management, and declarative home directory setup.
Purpose: Provide comprehensive support for Home Manager configuration, module creation, and user environment management.
Invoke When:
{ config, pkgs, ... }:
{
# Required settings
home.username = "username";
home.homeDirectory = "/home/username";
home.stateVersion = "24.11"; # Set once, never change
# Package installation
home.packages = with pkgs; [
# Packages not managed by programs.*
ripgrep
fd
jq
];
# Program configurations
programs = { ... };
# Service management
services = { ... };
# File management
home.file = { ... };
# Session variables
home.sessionVariables = { ... };
}
# /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
imports = [ <home-manager/nixos> ];
users.users.myuser = {
isNormalUser = true;
# ... other user settings
};
home-manager.users.myuser = { pkgs, ... }: {
home.stateVersion = "24.11";
# User's home-manager configuration
};
# Optional: Use user's pkgs
home-manager.useUserPackages = true;
# Optional: Use global pkgs
home-manager.useGlobalPkgs = true;
}
# Add channel
nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager
nix-channel --update
# Install
nix-shell '<home-manager>' -A install
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }:
{
nixosConfigurations.hostname = nixpkgs.lib.nixosSystem {
modules = [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.myuser = import ./home.nix;
}
];
};
};
}
programs.zsh = {
enable = true;
# Aliases
shellAliases = {
ll = "ls -la";
update = "sudo nixos-rebuild switch";
hm = "home-manager switch";
};
# Oh My Zsh
oh-my-zsh = {
enable = true;
plugins = [ "git" "docker" "kubectl" ];
theme = "robbyrussell";
};
# Additional configuration
initExtra = ''
export PATH=$HOME/.local/bin:$PATH
# Custom functions
mkcd() {
mkdir -p "$1" && cd "$1"
}
'';
# Environment variables
sessionVariables = {
EDITOR = "vim";
};
# History settings
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
ignoreDups = true;
share = true;
};
};
programs.git = {
enable = true;
userName = "Your Name";
userEmail = "your.email@example.com";
# Aliases
aliases = {
co = "checkout";
ci = "commit";
st = "status";
br = "branch";
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'";
};
# Extra config
extraConfig = {
init.defaultBranch = "main";
pull.rebase = true;
push.autoSetupRemote = true;
core.editor = "vim";
# Signing
commit.gpgsign = true;
user.signingkey = "YOUR_GPG_KEY";
};
# Delta (diff viewer)
delta = {
enable = true;
options = {
navigate = true;
line-numbers = true;
syntax-theme = "Dracula";
};
};
# Git LFS
lfs.enable = true;
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
# Plugins
plugins = with pkgs.vimPlugins;
[
vim-nix
vim-surround
vim-commentary
fzf-vim
lightline-vim
gruvbox
];
# Extra configuration
extraConfig = ''
set number relativenumber
set tabstop=2 shiftwidth=2 expandtab
set ignorecase smartcase
set clipboard=unnamedplus
colorscheme gruvbox
set background=dark
" Leader key
let mapleader = " "
" Quick save
nnoremap <leader>w :w<CR>
" FZF mappings
nnoremap <C-p> :Files<CR>
nnoremap <leader>f :Rg<CR>
'';
# Packages available in nvim
extraPackages = with pkgs;
[
ripgrep
fd
nodejs # For LSP
];
};
programs.alacritty = {
enable = true;
settings = {
window = {
opacity = 0.95;
padding = {
x = 10;
y = 10;
};
};
font = {
normal = {
family = "JetBrains Mono";
style = "Regular";
};
size = 12.0;
};
colors = {
primary = {
background = "#1e1e1e";
foreground = "#d4d4d4";
};
# ... more colors
};
keyboard.bindings = [
{ key = "V"; mods = "Control|Shift"; action = "Paste"; }
{ key = "C"; mods = "Control|Shift"; action = "Copy"; }
];
};
};
programs.ssh = {
enable = true;
# SSH config
matchBlocks = {
"github.com" = {
hostname = "github.com";
user = "git";
identityFile = "~/.ssh/id_ed25519";
};
"work-server" = {
hostname = "work.example.com";
user = "workuser";
port = 2222;
identityFile = "~/.ssh/work_key";
forwardAgent = true;
};
"home-*" = {
user = "homeuser";
identityFile = "~/.ssh/home_key";
};
};
# SSH control master for faster connections
controlMaster = "auto";
controlPath = "~/.ssh/master-%r@%n:%p";
controlPersist = "10m";
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 3600;
maxCacheTtl = 7200;
enableSshSupport = true;
pinentryPackage = pkgs.pinentry-curses;
# For graphical pinentry
# pinentryPackage = pkgs.pinentry-gnome3;
};
services.syncthing = {
enable = true;
tray.enable = true; # System tray icon
};
services.dunst = {
enable = true;
settings = {
global = {
monitor = 0;
geometry = "300x50-30+20";
transparency = 10;
font = "JetBrains Mono 10";
format = "<b>%s</b>\n%b";
};
urgency_low = {
background = "#1e1e1e";
foreground = "#d4d4d4";
timeout = 5;
};
urgency_normal = {
background = "#1e1e1e";
foreground = "#d4d4d4";
timeout = 10;
};
urgency_critical = {
background = "#900000";
foreground = "#ffffff";
timeout = 0;
};
};
};
systemd.user.services.my-backup = {
Unit = {
Description = "Personal backup service";
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.rsync}/bin/rsync -av /home/user/important/ /backup/";
};
};
systemd.user.timers.my-backup = {
Unit = {
Description = "Run backup daily";
};
Timer = {
OnCalendar = "daily";
Persistent = true;
};
Install = {
WantedBy = [ "timers.target" ];
};
};
home.file = {
# Simple file from string
".config/myapp/config.yml".text = ''
setting: value
another: setting
'';
# File from source
".config/myapp/theme.conf".source = ./dotfiles/myapp-theme.conf;
# Executable file
".local/bin/my-script" = {
text = ''
#!/usr/bin/env bash
echo "Hello from my script"
'';
executable = true;
};
# Recursive directory
".config/doom" = {
source = ./doom-config;
recursive = true;
};
# With onChange hook
".config/example/config.ini" = {
text = "config content";
onChange = ''
# Restart service when config changes
systemctl --user restart example.service
'';
};
};
xdg = {
enable = true;
# XDG base directories
configHome = "${config.home.homeDirectory}/.config";
dataHome = "${config.home.homeDirectory}/.local/share";
cacheHome = "${config.home.homeDirectory}/.cache";
# XDG user directories
userDirs = {
enable = true;
createDirectories = true;
desktop = "${config.home.homeDirectory}/Desktop";
documents = "${config.home.homeDirectory}/Documents";
download = "${config.home.homeDirectory}/Downloads";
music = "${config.home.homeDirectory}/Music";
pictures = "${config.home.homeDirectory}/Pictures";
videos = "${config.home.homeDirectory}/Videos";
};
# XDG MIME types
mimeApps = {
enable = true;
defaultApplications = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"application/pdf" = "org.gnome.Evince.desktop";
};
};
};
gtk = {
enable = true;
theme = {
name = "Adwaita-dark";
package = pkgs.gnome.gnome-themes-extra;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
font = {
name = "Ubuntu 11";
package = pkgs.ubuntu_font_family;
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
};
qt = {
enable = true;
platformTheme.name = "gtk";
style.name = "adwaita-dark";
};
home.pointerCursor = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
size = 24;
gtk.enable = true;
x11.enable = true;
};
fonts.fontconfig.enable = true;
home.packages = with pkgs;
[
(nerdfonts.override { fonts = [ "JetBrainsMono" "FiraCode" ]; })
ubuntu_font_family
dejavu_fonts
liberation_ttf
];
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
home.packages = with pkgs;
[
nodejs_20
nodePackages.npm
nodePackages.pnpm
nodePackages.yarn
];
home.sessionVariables = {
NPM_CONFIG_PREFIX = "${config.home.homeDirectory}/.npm-global";
};
home.packages = with pkgs;
[
python311
python311Packages.pip
python311Packages.virtualenv
poetry
];
home.packages = with pkgs;
[
rustc
cargo
rust-analyzer
rustfmt
clippy
];
home.sessionVariables = {
CARGO_HOME = "${config.home.homeDirectory}/.cargo";
RUSTUP_HOME = "${config.home.homeDirectory}/.rustup";
};
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
BROWSER = "firefox";
TERMINAL = "alacritty";
# Development
GOPATH = "${config.home.homeDirectory}/go";
CARGO_HOME = "${config.home.homeDirectory}/.cargo";
# XDG compliance
DOCKER_CONFIG = "${config.xdg.configHome}/docker";
GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle";
# Custom paths
PATH = "$HOME/.local/bin:$PATH";
};
# Shell-specific variables
programs.zsh.sessionVariables = {
# ZSH-specific vars
HISTFILE = "${config.xdg.dataHome}/zsh/history";
};
home.sessionPath = [
"${config.home.homeDirectory}/.local/bin"
"${config.home.homeDirectory}/.cargo/bin"
"${config.home.homeDirectory}/go/bin"
];
# common.nix - Shared across all machines
{ pkgs, ... }:
{
home.packages = with pkgs;
[
# Common tools
vim
git
htop
];
programs.git = {
enable = true;
userName = "Your Name";
userEmail = "your.email@example.com";
};
}
# laptop.nix - Laptop-specific
{ pkgs, ... }:
{
imports = [ ./common.nix ];
# Laptop-specific packages
home.packages = with pkgs;
[
brightnessctl
acpi
];
# Battery management
services.auto-cpufreq.enable = true;
}
# desktop.nix - Desktop-specific
{ pkgs, ... }:
{
imports = [ ./common.nix ];
# Desktop-specific packages
home.packages = with pkgs;
[
steam
obs-studio
];
# Multi-monitor setup
# ... display configuration
}
{ pkgs, lib, ... }:
let
hostname = builtins.readFile /etc/hostname;
isLaptop = hostname == "my-laptop";
isDesktop = hostname == "my-desktop";
in
{
imports = [ ./common.nix ]
++ lib.optional isLaptop ./laptop.nix
++ lib.optional isDesktop ./desktop.nix;
}
# modules/programs/my-tool.nix
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.my-tool;
in
{
options.programs.my-tool = {
enable = mkEnableOption "My Tool";
package = mkOption {
type = types.package;
default = pkgs.my-tool;
description = "The my-tool package to use";
};
settings = mkOption {
type = types.attrs;
default = {};
example = {
option1 = "value1";
option2 = true;
};
description = "Configuration for my-tool";
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
home.file.".config/my-tool/config.toml".text =
lib.generators.toTOML {} cfg.settings;
};
}
Usage:
{
imports = [ ./modules/programs/my-tool.nix ];
programs.my-tool = {
enable = true;
settings = {
theme = "dark";
font = "monospace";
};
};
}
home.activation = {
# Simple command
myActivationAction = lib.hm.dag.entryAfter ["writeBoundary"] ''
run echo "Running custom activation"
run mkdir -p $HOME/custom-dir
'';
# With dependencies
setupSymlinks = lib.hm.dag.entryAfter ["linkGeneration"] ''
run ln -sf $HOME/dotfiles/special $HOME/.special
'';
# Conditional activation
conditionalSetup = lib.hm.dag.entryAfter ["writeBoundary"] ''
if [ ! -f $HOME/.initialized ]; then
run echo "First-time setup"
run touch $HOME/.initialized
fi
'';
};
{
imports = [ <sops-nix/modules/home-manager> ];
sops = {
age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml;
secrets = {
github_token = {
path = "${config.home.homeDirectory}/.github-token";
};
aws_credentials = {
path = "${config.home.homeDirectory}/.aws/credentials";
};
};
};
}
{
imports = [ agenix.homeManagerModules.age ];
age.secrets.ssh-key = {
file = ./secrets/ssh-key.age;
path = "${config.home.homeDirectory}/.ssh/id_ed25519";
mode = "600";
};
}
{ lib, ... }:
let
hostname = builtins.readFile /etc/hostname;
in
{
programs.git.extraConfig = lib.mkIf (hostname == "work-laptop") {
user.email = "work@company.com";
};
}
{ config, lib, ... }:
{
options.my.features = {
gaming = lib.mkEnableOption "gaming setup";
development = lib.mkEnableOption "development tools";
};
config = {
home.packages = with pkgs;
lib.optionals config.my.features.gaming [
steam
discord
] ++ lib.optionals config.my.features.development [
vscode
docker
];
};
}
{ pkgs, ... }:
{
nixpkgs.overlays = [
(self: super: {
my-custom-package = super.callPackage ./pkgs/my-package {};
})
];
home.packages = [ pkgs.my-custom-package ];
}
programs.neovim = {
enable = true;
package = pkgs.neovim-unwrapped.overrideAttrs (oldAttrs: {
version = "nightly";
src = pkgs.fetchFromGitHub {
owner = "neovim";
repo = "neovim";
rev = "nightly";
sha256 = "...";
};
});
};
Problem: "Existing file at..." error
Solution:
# Remove conflicting packages installed with nix-env
nix-env --uninstall package-name
# Or remove all
nix-env --uninstall '*'
# Then switch
home-manager switch
Problem: Environment variables not available in new shells
Solution:
# Ensure sourcing in shell config
programs.zsh.initContent = ''
if [ -f ~/.nix-profile/etc/profile.d/hm-session-vars.sh ]; then
. ~/.nix-profile/etc/profile.d/hm-session-vars.sh
fi
'';
Problem: "The name ca.desrt.dconf was not provided by any .service files"
Solution:
programs.dconf.enable = true;
# Or system-wide in NixOS config
programs.dconf.enable = true;
Problem: Git can't access credentials
Solution:
programs.git = {
enable = true;
extraConfig = {
credential.helper = "store";
# Or use git-credential-manager
# credential.helper = "${pkgs.git-credential-manager}/bin/git-credential-manager";
};
};
Problem: Custom fonts not showing up
Solution:
# Ensure fontconfig is enabled
fonts.fontconfig.enable = true;
# Rebuild font cache
home.activation.rebuildFontCache = lib.hm.dag.entryAfter ["writeBoundary"] ''
run ${pkgs.fontconfig}/bin/fc-cache -f
'';
Set stateVersion once and never change it
home.stateVersion = "24.11"; # Leave this unchanged
Use program modules when available
# ✅ Good - uses program module
programs.git.enable = true;
# ❌ Bad - manual configuration
home.packages = [ pkgs.git ];
home.file.".gitconfig".text = "...";
Import from central configuration
imports = [
./modules/shell.nix
./modules/editor.nix
./modules/desktop.nix
];
Use XDG directories
xdg.enable = true;
# Configs go to ~/.config
# Data goes to ~/.local/share
Enable rollback capability
# Home Manager keeps generations automatically
home-manager generations
home-manager switch --rollback
Version control your configuration
cd ~/.config/home-manager
git init
git add .
git commit -m "Initial home-manager config"
Test changes before committing
home-manager switch --dry-run
home-manager switch
Use lib functions for conditionals
home.packages = lib.optionals stdenv.isLinux [ ... ];
Document custom modules
options.my.feature = mkOption {
description = "Clear description of what this does";
# ...
};
Use activation scripts for side effects
home.activation.setupDirs = lib.hm.dag.entryAfter ["writeBoundary"] ''
run mkdir -p $HOME/projects
'';
Don't change stateVersion casually
# ❌ Don't do this
home.stateVersion = "24.11"; # Changed from 23.11
Don't mix nix-env and Home Manager
# ❌ Don't use nix-env with Home Manager
nix-env -iA nixpkgs.package
# ✅ Use home.packages instead
home.packages = [ pkgs.package ];
Don't hardcode paths
# ❌ Bad
home.file."/home/user/.config/app/config".text = "...";
# ✅ Good
home.file."${config.xdg.configHome}/app/config".text = "...";
Don't ignore collision errors
# ❌ Don't force
home-manager switch --force
# ✅ Investigate and fix
nix-env --query
nix-env --uninstall conflicting-package
Don't put secrets in Nix store
# ❌ Never do this
home.file.".ssh/id_rsa".text = "secret key content";
# ✅ Use secrets management
sops.secrets.ssh_key.path = "~/.ssh/id_rsa";
Don't use mutable configuration
# ❌ Avoid programs.*.extraConfig when possible
programs.git.extraConfig = { ... };
# ✅ Use structured options
programs.git.aliases = { ... };
Don't skip documentation
# Read options before configuring
home-manager option search git
# Apply configuration
home-manager switch
# Build without activating
home-manager build
# Show generations
home-manager generations
# Rollback to previous
home-manager switch --rollback
# Remove old generations
home-manager expire-generations "-7 days"
# Search options
home-manager option search <term>
# Show option details
home-manager option <option-name>
# Help
home-manager --help
# Rebuild with home-manager
sudo nixos-rebuild switch
# Test without activating
sudo nixos-rebuild test
# Build without activating
sudo nixos-rebuild build
# List generations
ls -l ~/.local/state/nix/profiles/home-manager*
# Remove old generations (free space)
nix-collect-garbage --delete-old
# Remove generations older than 30 days
home-manager expire-generations "-30 days"
nix-collect-garbage
--dry-run flag# 1. Edit configuration
vim ~/.config/home-manager/home.nix
# 2. Check syntax
nix-instantiate --parse ~/.config/home-manager/home.nix
# 3. Dry run
home-manager switch --dry-run
# 4. Build
home-manager build
# 5. Switch
home-manager switch
# 6. Verify
# Test the changed program/service
# 7. Rollback if needed
home-manager switch --rollback
Complete setup for software development with multiple languages, tools, and environments.
Lightweight configuration for server users with just essentials.
Full desktop setup with GUI applications, theming, and customization.
Base configuration shared across team with host-specific overrides.
Ready to work with Home Manager! Let me know what you need help with. 🏠