[home] Refactor into roles
This commit is contained in:
86
home/roles/base/default.nix
Normal file
86
home/roles/base/default.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.base;
|
||||
in
|
||||
{
|
||||
options.home.roles.base = {
|
||||
enable = mkEnableOption "Enable base CLI tools and essential programs";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
# Core CLI utilities
|
||||
fd
|
||||
gzip
|
||||
htop
|
||||
killall
|
||||
less
|
||||
ncdu
|
||||
shellcheck
|
||||
tmux
|
||||
|
||||
# Development/automation tools that are widely used
|
||||
claude-code
|
||||
codex
|
||||
goose-cli
|
||||
pandoc
|
||||
];
|
||||
|
||||
# Essential programs everyone needs
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
codex() {
|
||||
local key
|
||||
key="$(rbw get openai-api-key-codex)"
|
||||
OPENAI_API_KEY="$key" command codex "$@"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
programs.command-not-found.enable = true;
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "John Ogle";
|
||||
userEmail = "john@ogle.fyi";
|
||||
extraConfig = {
|
||||
safe.directory = "/etc/nixos";
|
||||
};
|
||||
};
|
||||
|
||||
programs.jq.enable = true;
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
matchBlocks = {
|
||||
"nucdeb1" = {
|
||||
hostname = "nucdeb1.oglehome";
|
||||
user = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
email = "john@johnogle.info";
|
||||
base_url = "https://bitwarden.johnogle.info";
|
||||
pinentry = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
|
||||
# Note: modules must be imported at top-level home config
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user