Personal Nix setup

Migrate home/ to module system

+10 -2
home/apps/default.nix
···
-
{ ... }:
+
{ lib, ... }:
-
{
+
with lib; {
+
options.modules.apps = {
+
enable = mkOption {
+
default = true;
+
description = "Whether to enable Apps options.";
+
type = types.bool;
+
};
+
};
+
imports = [
./firefox.nix
./obsidian.nix
+18 -3
home/apps/firefox.nix
···
-
{ helpers, ... }:
+
{ lib, config, helpers, ... }:
+
+
with lib;
+
let
+
cfg = config.modules.apps;
+
in {
+
options.modules.apps.firefox = {
+
enable = mkOption {
+
default = false;
+
description = "Whether to enable Firefox.";
+
type = types.bool;
+
};
+
};
-
{
-
config = helpers.mkIfLinux {
+
config.modules.apps.firefox = {
+
enable = if helpers.isLinux then (mkDefault false) else (mkForce false);
+
};
+
} // helpers.linuxAttrs {
+
config = mkIf (cfg.enable && cfg.firefox.enable) {
programs.firefox = {
enable = true;
profiles.default = {
+16 -3
home/apps/obsidian.nix
···
-
{ pkgs, ... }:
+
{ lib, config, pkgs, ... }:
+
+
with lib;
+
let
+
cfg = config.modules.apps;
+
in {
+
options.modules.apps.obsidian = {
+
enable = mkOption {
+
default = false;
+
description = "Whether to enable Obsidian.";
+
type = types.bool;
+
};
+
};
-
{
-
home.packages = [pkgs.obsidian];
+
config = mkIf (cfg.enable && cfg.obsidian.enable) {
+
home.packages = [pkgs.obsidian];
+
};
}
+17 -5
home/apps/ollama.nix
···
-
{ helpers, lib, pkgs, ... }:
+
{ lib, config, helpers, pkgs, ... }:
+
with lib;
let
+
cfg = config.modules.apps;
ollamaArgs = [
"${pkgs.ollama}/bin/ollama"
"serve"
];
in {
-
config = lib.mkMerge [
-
{ home.packages = [ pkgs.ollama ]; }
+
options.modules.apps.ollama = {
+
enable = mkOption {
+
default = false;
+
description = "Whether to enable Ollama.";
+
type = types.bool;
+
};
+
};
+
+
config = mkIf (cfg.enable && cfg.ollama.enable) (mkMerge [
+
{
+
home.packages = [ pkgs.ollama ];
+
}
(helpers.mkIfLinux {
systemd.user.services.ollama = {
···
};
Install.WantedBy = [ "default.target" ];
Service = {
-
ExecStart = lib.escapeShellArgs ollamaArgs;
+
ExecStart = escapeShellArgs ollamaArgs;
Restart = "on-failure";
RestartSec = 5;
};
···
};
};
})
-
];
+
]);
}
+18 -5
home/apps/wezterm/default.nix
···
-
{ pkgs, helpers, lib, ... } @ inputs:
+
{ lib, config, pkgs, helpers, ... } @ inputs:
+
with lib;
let
inherit (pkgs) stdenv;
inherit (import ../../../lib/colors.nix inputs) colors mkLuaSyntax;
+
cfg = config.modules.apps;
+
wezterm = pkgs.wezterm.overrideAttrs (_: {
-
preFixup = lib.optionalString stdenv.isLinux ''
+
preFixup = optionalString stdenv.isLinux ''
patchelf \
--add-needed "${pkgs.libGL}/lib/libEGL.so.1" \
--add-needed "${pkgs.vulkan-loader}/lib/libvulkan.so.1" \
···
source "${wezterm}/etc/profile.d/wezterm.sh"
'';
in {
-
home.packages = [ wezterm ];
-
xdg.configFile."wezterm/wezterm.lua".text = configStr;
-
programs.zsh.initExtra = shellIntegrationStr;
+
options.modules.apps.wezterm = {
+
enable = mkOption {
+
default = false;
+
description = "Whether to enable Wezterm.";
+
type = types.bool;
+
};
+
};
+
+
config = mkIf (cfg.enable && cfg.wezterm.enable) {
+
home.packages = [ wezterm ];
+
xdg.configFile."wezterm/wezterm.lua".text = configStr;
+
programs.zsh.initExtra = shellIntegrationStr;
+
};
}
+4
home/base/default.nix
···
{
imports = [
./nix-config.nix
+
./gpg.nix
+
./git.nix
+
./shell.nix
+
./tmux.nix
];
}
+153
home/base/git.nix
···
+
{ lib, config, pkgs, ... }:
+
+
with lib;
+
let
+
cfg = config.modules.git;
+
home = config.home.homeDirectory;
+
+
userType = types.submodule {
+
options = {
+
name = mkOption {
+
type = types.str;
+
example = "Sample Name";
+
};
+
email = mkOption {
+
type = types.str;
+
example = "sample@name.com";
+
};
+
};
+
};
+
in {
+
options.modules.git = {
+
enable = mkOption {
+
default = true;
+
description = "Git Configuration";
+
type = types.bool;
+
};
+
+
user = mkOption {
+
default = {
+
name = "Phil Pluckthun";
+
email = "phil@kitten.sh";
+
};
+
description = "Git user information";
+
type = userType;
+
};
+
+
signingKey = mkOption {
+
description = "Git Signing key";
+
type = types.nullOr types.str;
+
};
+
};
+
+
config = mkIf cfg.enable {
+
home.packages = with pkgs; [ git-crypt git-get ];
+
+
programs.git = {
+
enable = true;
+
userName = cfg.user.name;
+
userEmail = cfg.user.email;
+
+
signing = mkIf (cfg.signingKey != null) {
+
signByDefault = true;
+
key = cfg.signingKey;
+
};
+
+
ignores = [
+
".DS_Store"
+
"*.sw[nop]"
+
"*.undodir"
+
".env"
+
"*.orig"
+
];
+
+
lfs = {
+
enable = true;
+
};
+
+
aliases = {
+
s = "status -s";
+
last = "log -1";
+
lol = "log --pretty=longline";
+
recommit = "commit -a --amend --no-edit";
+
pushf = "push --force-with-lease";
+
glog = "log --pretty=longline --decorate --all --graph --date=relative";
+
journal = "!f() { git commit -a -m \"$(date +'%Y-%m-%d %H:%M:%S')\"; }; f";
+
};
+
+
extraConfig = {
+
commit.gpgSign = true;
+
tag.gpgSign = true;
+
push.gpgSign = "if-asked";
+
+
color.ui = "auto";
+
init.defaultBranch = "main";
+
+
branch.sort = "-committerdate";
+
tag.sort = "-taggerdate";
+
+
status = {
+
showUntrackedFiles = "all";
+
submoduleSummary = true;
+
};
+
+
diff = {
+
tool = "vimdiff";
+
submodule = "log";
+
algorithm = "histogram";
+
colorMovedWS = "allow-indentation-change";
+
compactionHeuristic = true;
+
context = 10;
+
};
+
+
push = {
+
default = "simple";
+
autoSetupRemote = true;
+
followtags = true;
+
};
+
+
rebase = {
+
autosquash = true;
+
autostash = true;
+
updateRefs = true;
+
missingCommitsCheck = "error";
+
};
+
+
merge = {
+
ff = "only";
+
tool = "vimdiff";
+
keepbackup = false;
+
};
+
+
fetch = {
+
prune = true;
+
prunetags = true;
+
};
+
+
gitget = {
+
root = "${home}/git";
+
host = "github.com";
+
skip-host = true;
+
};
+
+
core.autocrlf = false;
+
pull.rebase = true;
+
rerere.enabled = true;
+
difftool.prompt = false;
+
mergetool.prompt = true;
+
transfer.fsckobjects = true;
+
fetch.fsckobjects = true;
+
receive.fsckObjects = true;
+
submodule.recurse = true;
+
+
"mergetool \"vimdiff\"".cmd = "nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'";
+
pretty.longline = "tformat:%Cgreen%h %Cred%D %Creset%s %Cblue(%cd, by %an)";
+
+
"remote \"origin\"" = {
+
fetch = "+refs/pull/*/head:refs/remotes/origin/pr/*";
+
pruneTags = true;
+
};
+
};
+
};
+
};
+
}
+48
home/base/gpg.nix
···
+
{ lib, config, ... }:
+
+
with lib;
+
let
+
cfg = config.modules.gpg;
+
home = config.home.homeDirectory;
+
in {
+
options.modules.gpg = {
+
enable = mkOption {
+
default = true;
+
description = "GnuPG";
+
type = types.bool;
+
};
+
};
+
+
config = mkIf cfg.enable {
+
modules.git.signingKey = mkDefault "303B6A9A312AA035";
+
+
age.secrets."pubring.kbx" = {
+
symlink = true;
+
path = "${home}/.gnupg/pubring.kbx";
+
file = ./encrypt/pubring.kbx.age;
+
};
+
+
age.secrets."75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key" = {
+
symlink = true;
+
path = "${home}/.gnupg/private-keys-v1.d/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key";
+
file = ./encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age;
+
};
+
+
age.secrets."E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key" = {
+
symlink = true;
+
path = "${home}/.gnupg/private-keys-v1.d/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key";
+
file = ./encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age;
+
};
+
+
age.secrets."CA84692E3CC846C8EC7272468E962B63FC599E49.key" = {
+
symlink = true;
+
path = "${home}/.gnupg/private-keys-v1.d/CA84692E3CC846C8EC7272468E962B63FC599E49.key";
+
file = ./encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age;
+
};
+
+
home.file.".gnupg/sshcontrol".text = ''
+
E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6
+
75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7
+
'';
+
};
+
}
+4 -2
home/base/nix-config.nix
···
{ config, ... }:
-
{
+
let
+
home = config.home.homeDirectory;
+
in {
age.secrets."nix-access-tokens.conf" = {
symlink = true;
-
path = "${config.home.homeDirectory}/.cache/nix-access-tokens.conf";
+
path = "${home}/.cache/nix-access-tokens.conf";
file = ../../modules/base/encrypt/nix-access-tokens.conf.age;
};
+106
home/base/shell.nix
···
+
{ lib, config, pkgs, ... }:
+
+
with lib;
+
let
+
cfg = config.modules.shell;
+
in {
+
options.modules.shell = {
+
enable = mkOption {
+
default = true;
+
description = "Shell";
+
type = types.bool;
+
};
+
+
enableStarship = mkOption {
+
default = cfg.enable;
+
description = "Starship";
+
type = types.bool;
+
};
+
};
+
+
config = mkIf cfg.enable {
+
programs.zsh = {
+
enable = true;
+
enableAutosuggestions = true;
+
+
enableCompletion = false;
+
+
shellAliases = {
+
ls = "ls --color=auto";
+
ll = "ls -l";
+
wx = "wezmux";
+
http = "xh";
+
};
+
+
initExtra = ''
+
function update_title_preexec {
+
emulate -L zsh
+
setopt extended_glob
+
local title=''${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
+
printf "\e]0;%s\e\\" "$title"
+
}
+
function update_title_precmd {
+
emulate -L zsh
+
setopt extended_glob
+
local title=''${PWD##*/}
+
printf "\e]0;%s\e\\" "$title"
+
}
+
+
add-zsh-hook preexec update_title_preexec
+
add-zsh-hook precmd update_title_precmd
+
'';
+
+
plugins = [
+
{
+
name = "zsh-syntax-highlighting";
+
src = pkgs.fetchFromGitHub {
+
owner = "zsh-users";
+
repo = "zsh-syntax-highlighting";
+
rev = "91d2eeaf23c47341e8dc7ad66dbf85e38c2674de";
+
sha256 = "1160bbhpd2p6qlw1b5k86z243iv0yhv6x7pf414sr8q4cm59x2h0";
+
};
+
}
+
];
+
};
+
+
programs.direnv = {
+
enable = true;
+
enableZshIntegration = true;
+
nix-direnv.enable = true;
+
};
+
+
programs.zoxide = {
+
enable = true;
+
enableZshIntegration = true;
+
enableNushellIntegration = mkDefault false;
+
enableFishIntegration = mkDefault false;
+
};
+
+
programs.starship = mkIf cfg.enableStarship {
+
enable = true;
+
enableZshIntegration = true;
+
+
settings = {
+
add_newline = false;
+
gcloud.disabled = true;
+
aws.disabled = true;
+
cmd_duration.disabled = true;
+
battery.disabled = true;
+
nodejs.disabled = true;
+
deno.disabled = true;
+
character.success_symbol = "[➜](green)";
+
character.error_symbol = "[➜](bold red)";
+
git_branch.symbol = " ";
+
git_commit.tag_symbol = " ";
+
git_status.format = "([$all_status]($style))";
+
git_status.conflicted = " ";
+
git_status.untracked = " ";
+
git_status.modified = " ";
+
git_status.staged = " ";
+
git_status.deleted = " ";
+
git_status.renamed = " ";
+
git_status.stashed = " ";
+
};
+
};
+
};
+
}
+98
home/base/tmux.nix
···
+
{ lib, config, pkgs, ... } @ inputs:
+
+
with lib;
+
let
+
inherit (pkgs) stdenv;
+
inherit (import ../../lib/colors.nix inputs) colors;
+
+
cfg = config.modules.git;
+
+
defaultActiveColor = colors.yellow.gui;
+
defaultInactiveColor = colors.muted.gui;
+
defaultFeatureColor = colors.blue.gui;
+
defaultBorderColor = colors.green.gui;
+
defaultSplitColor = colors.split.gui;
+
in {
+
options.modules.tmux = {
+
enable = mkOption {
+
default = true;
+
description = "Tmux Configuration";
+
type = types.bool;
+
};
+
};
+
+
config = mkIf cfg.enable {
+
programs.tmux = {
+
enable = true;
+
aggressiveResize = true;
+
baseIndex = 1;
+
escapeTime = 0;
+
historyLimit = 5000;
+
keyMode = "vi";
+
shortcut = "a";
+
terminal = "xterm-256color";
+
sensibleOnTop = false;
+
+
secureSocket = stdenv.hostPlatform.isLinux;
+
+
plugins = [ ];
+
+
extraConfig = ''
+
set -g mouse on
+
set -g set-clipboard on
+
+
set-option -g focus-events on
+
+
set -g status-left-length 32
+
set -g status-right-length 150
+
set -g status-interval 5
+
+
set-option -ga terminal-overrides ",xterm-256color*:Tc:smso"
+
+
set-option -g status-style fg="${defaultActiveColor}",bg=default
+
+
set-window-option -g window-status-style fg="${defaultInactiveColor}",bg=default
+
set-window-option -g aggressive-resize on
+
set-window-option -g window-status-current-style fg="${defaultActiveColor}",bg=default
+
set-window-option -g window-status-current-format "#[bold]#I #W"
+
set-option -g pane-border-style fg="${defaultInactiveColor}"
+
set-option -g pane-active-border-style fg="${defaultBorderColor}"
+
set-option -g message-style fg="${defaultActiveColor}",bg=default
+
set-option -g display-panes-active-colour "${defaultActiveColor}"
+
set-option -g display-panes-colour "${defaultInactiveColor}"
+
set-window-option -g clock-mode-colour "${defaultActiveColor}"
+
+
set -g window-status-format "#I #W"
+
+
set -g status-left "#[fg=${defaultFeatureColor},bold]#S "
+
set -g status-right "#[fg=${defaultInactiveColor}] %R %d %b"
+
+
set -g pane-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}"
+
set -g pane-active-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}"
+
+
unbind C-p
+
bind C-p paste-buffer
+
+
bind -n C-h select-pane -L
+
bind -n C-j select-pane -D
+
bind -n C-k select-pane -U
+
bind -n C-l select-pane -R
+
+
bind -r h resize-pane -L 2
+
bind -r j resize-pane -D 2
+
bind -r k resize-pane -U 2
+
bind -r l resize-pane -R 2
+
+
bind b kill-pane
+
'';
+
};
+
+
programs.zsh.shellAliases = mkIf config.modules.shell.enable {
+
ta = "tmux attach -t";
+
ts = "tmux new-session -s";
+
tl = "tmux list-sessions";
+
tksv = "tmux kill-server";
+
tkss = "tmux kill-session -t";
+
};
+
};
+
}
+3 -5
home/default.nix
···
{
imports = [
./base
-
./git.nix
-
./zsh.nix
-
./tmux.nix
-
./gpg
-
./js
+
./development
+
./desktop
+
./apps
];
}
+15 -2
home/desktop/default.nix
···
-
{ ... }:
+
{ lib, helpers, ... }:
+
+
with lib; {
+
options.modules.desktop = {
+
enable = mkOption {
+
default = false;
+
example = true;
+
description = "Whether to enable Desktop options.";
+
type = types.bool;
+
};
+
};
-
{
+
config.modules.desktop = {
+
enable = if helpers.isLinux then (mkDefault false) else (mkForce false);
+
};
+
} // helpers.linuxAttrs {
imports = [
./theme.nix
];
+33 -19
home/desktop/theme.nix
···
-
{ pkgs, ... } @ inputs:
+
{ lib, config, pkgs, ... }:
-
{
-
fonts.fontconfig.enable = true;
-
-
services.xsettingsd = {
-
enable = true;
-
settings = {
-
"Gtk/CursorThemeName" = "Bibata-Modern-Classic";
-
"Xft/Antialias" = true;
-
"Xft/Hinting" = true;
-
"Xft/HintStyle" = "hintslight";
-
"Xft/RGBA" = "rgb";
-
"Xft/dpi" = 163;
+
with lib;
+
let
+
cfg = config.modules.desktop;
+
in {
+
options.modules.desktop.theme = {
+
enable = mkOption {
+
default = cfg.enable;
+
example = true;
+
description = "Whether to enable default theme.";
+
type = types.bool;
};
};
-
home.pointerCursor = {
-
name = "Bibata-Modern-Classic";
-
package = pkgs.bibata-cursors;
-
size = 24;
-
gtk.enable = true;
-
x11.enable = true;
+
config = mkIf cfg.theme.enable {
+
fonts.fontconfig.enable = true;
+
+
services.xsettingsd = {
+
enable = true;
+
settings = {
+
"Gtk/CursorThemeName" = "Bibata-Modern-Classic";
+
"Xft/Antialias" = true;
+
"Xft/Hinting" = true;
+
"Xft/HintStyle" = "hintslight";
+
"Xft/RGBA" = "rgb";
+
"Xft/dpi" = 163;
+
};
+
};
+
+
home.pointerCursor = {
+
name = "Bibata-Modern-Classic";
+
package = pkgs.bibata-cursors;
+
size = 24;
+
gtk.enable = true;
+
x11.enable = true;
+
};
};
}
+16
home/development/default.nix
···
+
{ lib, ... }:
+
+
with lib; {
+
options.modules.development = {
+
enable = mkOption {
+
default = false;
+
example = true;
+
description = "Whether to enable Development options.";
+
type = types.bool;
+
};
+
};
+
+
imports = [
+
./js.nix
+
];
+
}
+40
home/development/js.nix
···
+
{ lib, config, ... }:
+
+
with lib;
+
let
+
cfg = config.modules.development;
+
home = config.home.homeDirectory;
+
in {
+
options.modules.development.js = {
+
enable = mkOption {
+
default = cfg.enable;
+
example = true;
+
description = "Whether to enable JS configuration.";
+
type = types.bool;
+
};
+
};
+
+
config = mkIf cfg.js.enable {
+
age.secrets."npmrc" = {
+
symlink = true;
+
path = "${home}/.npmrc";
+
file = ./encrypt/npmrc.age;
+
};
+
+
home.file.".yarnrc".text = ''
+
disable-self-update-check true
+
'';
+
+
home.file.".bunfig.toml".text = ''
+
telemetry = false
+
+
[install]
+
auto = "disable"
+
globalDir = "~/.local/share/bun/global"
+
globalBinDir = "~/.local/share/bun"
+
+
[install.cache]
+
dir = "~/.cache/bun/install/cache"
+
'';
+
};
+
}
-115
home/git.nix
···
-
{ pkgs, lib, config, ... } @ inputs:
-
-
{
-
home.packages = [
-
pkgs.git-crypt
-
pkgs.git-get
-
];
-
-
programs.git = {
-
enable = true;
-
userName = "Phil Pluckthun";
-
userEmail = "phil@kitten.sh";
-
-
signing = {
-
signByDefault = true;
-
key = "303B6A9A312AA035";
-
};
-
-
ignores = [
-
".DS_Store"
-
"*.sw[nop]"
-
"*.undodir"
-
".env"
-
"*.orig"
-
];
-
-
lfs = {
-
enable = true;
-
};
-
-
aliases = {
-
s = "status -s";
-
last = "log -1";
-
lol = "log --pretty=longline";
-
recommit = "commit -a --amend --no-edit";
-
pushf = "push --force-with-lease";
-
glog = "log --pretty=longline --decorate --all --graph --date=relative";
-
journal = "!f() { git commit -a -m \"$(date +'%Y-%m-%d %H:%M:%S')\"; }; f";
-
};
-
-
extraConfig = {
-
commit.gpgSign = true;
-
tag.gpgSign = true;
-
push.gpgSign = "if-asked";
-
-
color.ui = "auto";
-
init.defaultBranch = "main";
-
-
branch.sort = "-committerdate";
-
tag.sort = "-taggerdate";
-
-
status = {
-
showUntrackedFiles = "all";
-
submoduleSummary = true;
-
};
-
-
diff = {
-
tool = "vimdiff";
-
submodule = "log";
-
algorithm = "histogram";
-
colorMovedWS = "allow-indentation-change";
-
compactionHeuristic = true;
-
context = 10;
-
};
-
-
push = {
-
default = "simple";
-
autoSetupRemote = true;
-
followtags = true;
-
};
-
-
rebase = {
-
autosquash = true;
-
autostash = true;
-
updateRefs = true;
-
missingCommitsCheck = "error";
-
};
-
-
merge = {
-
ff = "only";
-
tool = "vimdiff";
-
keepbackup = false;
-
};
-
-
fetch = {
-
prune = true;
-
prunetags = true;
-
};
-
-
gitget = {
-
root = "${config.home.homeDirectory}/git";
-
host = "github.com";
-
skip-host = true;
-
};
-
-
core.autocrlf = false;
-
pull.rebase = true;
-
rerere.enabled = true;
-
difftool.prompt = false;
-
mergetool.prompt = true;
-
transfer.fsckobjects = true;
-
fetch.fsckobjects = true;
-
receive.fsckObjects = true;
-
submodule.recurse = true;
-
-
"mergetool \"vimdiff\"".cmd = "nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'";
-
pretty.longline = "tformat:%Cgreen%h %Cred%D %Creset%s %Cblue(%cd, by %an)";
-
-
"remote \"origin\"" = {
-
fetch = "+refs/pull/*/head:refs/remotes/origin/pr/*";
-
pruneTags = true;
-
};
-
};
-
};
-
}
-32
home/gpg/default.nix
···
-
{ config, pkgs, ... } @ inputs:
-
-
{
-
age.secrets."pubring.kbx" = {
-
symlink = true;
-
path = "${config.home.homeDirectory}/.gnupg/pubring.kbx";
-
file = ./encrypt/pubring.kbx.age;
-
};
-
-
age.secrets."75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key" = {
-
symlink = true;
-
path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key";
-
file = ./encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age;
-
};
-
-
age.secrets."E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key" = {
-
symlink = true;
-
path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key";
-
file = ./encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age;
-
};
-
-
age.secrets."CA84692E3CC846C8EC7272468E962B63FC599E49.key" = {
-
symlink = true;
-
path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/CA84692E3CC846C8EC7272468E962B63FC599E49.key";
-
file = ./encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age;
-
};
-
-
home.file.".gnupg/sshcontrol".text = ''
-
E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6
-
75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7
-
'';
-
}
home/gpg/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age home/base/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age
home/gpg/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age home/base/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age
home/gpg/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age home/base/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age
home/gpg/encrypt/pubring.kbx.age home/base/encrypt/pubring.kbx.age
-27
home/js/default.nix
···
-
{ config, ... } @ inputs:
-
-
{
-
age.secrets."npmrc" = {
-
symlink = true;
-
path = "${config.home.homeDirectory}/.npmrc";
-
file = ./encrypt/npmrc.age;
-
};
-
-
home.file.".yarnrc".text = ''
-
disable-self-update-check true
-
email phil@kitten.sh
-
username philpl
-
'';
-
-
home.file.".bunfig.toml".text = ''
-
telemetry = false
-
-
[install]
-
auto = "disable"
-
globalDir = "~/.local/share/bun/global"
-
globalBinDir = "~/.local/share/bun"
-
-
[install.cache]
-
dir = "~/.cache/bun/install/cache"
-
'';
-
}
home/js/encrypt/npmrc.age home/development/encrypt/npmrc.age
-85
home/tmux.nix
···
-
{ lib, pkgs, ... } @ inputs:
-
-
let
-
inherit (pkgs) stdenv;
-
inherit (import ../lib/colors.nix inputs) colors;
-
-
defaultActiveColor = colors.yellow.gui;
-
defaultInactiveColor = colors.muted.gui;
-
defaultFeatureColor = colors.blue.gui;
-
defaultBorderColor = colors.green.gui;
-
defaultSplitColor = colors.split.gui;
-
in {
-
programs.tmux = {
-
enable = true;
-
aggressiveResize = true;
-
baseIndex = 1;
-
escapeTime = 0;
-
historyLimit = 5000;
-
keyMode = "vi";
-
shortcut = "a";
-
terminal = "xterm-256color";
-
sensibleOnTop = false;
-
-
secureSocket = stdenv.hostPlatform.isLinux;
-
-
plugins = [ ];
-
-
extraConfig = ''
-
set -g mouse on
-
set -g set-clipboard on
-
-
set-option -g focus-events on
-
-
set -g status-left-length 32
-
set -g status-right-length 150
-
set -g status-interval 5
-
-
set-option -ga terminal-overrides ",xterm-256color*:Tc:smso"
-
-
set-option -g status-style fg="${defaultActiveColor}",bg=default
-
-
set-window-option -g window-status-style fg="${defaultInactiveColor}",bg=default
-
set-window-option -g aggressive-resize on
-
set-window-option -g window-status-current-style fg="${defaultActiveColor}",bg=default
-
set-window-option -g window-status-current-format "#[bold]#I #W"
-
set-option -g pane-border-style fg="${defaultInactiveColor}"
-
set-option -g pane-active-border-style fg="${defaultBorderColor}"
-
set-option -g message-style fg="${defaultActiveColor}",bg=default
-
set-option -g display-panes-active-colour "${defaultActiveColor}"
-
set-option -g display-panes-colour "${defaultInactiveColor}"
-
set-window-option -g clock-mode-colour "${defaultActiveColor}"
-
-
set -g window-status-format "#I #W"
-
-
set -g status-left "#[fg=${defaultFeatureColor},bold]#S "
-
set -g status-right "#[fg=${defaultInactiveColor}] %R %d %b"
-
-
set -g pane-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}"
-
set -g pane-active-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}"
-
-
unbind C-p
-
bind C-p paste-buffer
-
-
bind -n C-h select-pane -L
-
bind -n C-j select-pane -D
-
bind -n C-k select-pane -U
-
bind -n C-l select-pane -R
-
-
bind -r h resize-pane -L 2
-
bind -r j resize-pane -D 2
-
bind -r k resize-pane -U 2
-
bind -r l resize-pane -R 2
-
-
bind b kill-pane
-
'';
-
};
-
-
programs.zsh.shellAliases = {
-
ta = "tmux attach -t";
-
ts = "tmux new-session -s";
-
tl = "tmux list-sessions";
-
tksv = "tmux kill-server";
-
tkss = "tmux kill-session -t";
-
};
-
}
-87
home/zsh.nix
···
-
{ pkgs, lib, ... }:
-
-
{
-
programs.zsh = {
-
enable = true;
-
enableAutosuggestions = true;
-
-
enableCompletion = false;
-
-
shellAliases = {
-
ls = "ls --color=auto";
-
ll = "ls -l";
-
wx = "wezmux";
-
http = "xh";
-
};
-
-
initExtra = ''
-
function update_title_preexec {
-
emulate -L zsh
-
setopt extended_glob
-
local title=''${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
-
printf "\e]0;%s\e\\" "$title"
-
}
-
function update_title_precmd {
-
emulate -L zsh
-
setopt extended_glob
-
local title=''${PWD##*/}
-
printf "\e]0;%s\e\\" "$title"
-
}
-
-
add-zsh-hook preexec update_title_preexec
-
add-zsh-hook precmd update_title_precmd
-
'';
-
-
plugins = [
-
{
-
name = "zsh-syntax-highlighting";
-
src = pkgs.fetchFromGitHub {
-
owner = "zsh-users";
-
repo = "zsh-syntax-highlighting";
-
rev = "91d2eeaf23c47341e8dc7ad66dbf85e38c2674de";
-
sha256 = "1160bbhpd2p6qlw1b5k86z243iv0yhv6x7pf414sr8q4cm59x2h0";
-
};
-
}
-
];
-
};
-
-
programs.direnv = {
-
enable = true;
-
enableZshIntegration = true;
-
nix-direnv.enable = true;
-
};
-
-
programs.zoxide = {
-
enable = true;
-
enableZshIntegration = true;
-
enableNushellIntegration = lib.mkDefault false;
-
enableFishIntegration = lib.mkDefault false;
-
};
-
-
programs.starship = {
-
enable = true;
-
enableZshIntegration = true;
-
-
settings = {
-
add_newline = false;
-
gcloud.disabled = true;
-
aws.disabled = true;
-
cmd_duration.disabled = true;
-
battery.disabled = true;
-
nodejs.disabled = true;
-
deno.disabled = true;
-
character.success_symbol = "[➜](green)";
-
character.error_symbol = "[➜](bold red)";
-
git_branch.symbol = " ";
-
git_commit.tag_symbol = " ";
-
git_status.format = "([$all_status]($style))";
-
git_status.conflicted = " ";
-
git_status.untracked = " ";
-
git_status.modified = " ";
-
git_status.staged = " ";
-
git_status.deleted = " ";
-
git_status.renamed = " ";
-
git_status.stashed = " ";
-
};
-
};
-
}
+10 -3
machines/fanta/home.nix
···
{ ... }:
{
-
imports = [
-
../../home/apps
-
];
+
modules = {
+
development.enable = true;
+
apps = {
+
enable = true;
+
wezterm.enable = true;
+
firefox.enable = true;
+
obsidian.enable = true;
+
ollama.enable = true;
+
};
+
};
}
+11 -4
machines/pepper/home.nix
···
{ ... }:
{
-
imports = [
-
../../home/desktop
-
../../home/apps
-
];
+
modules = {
+
development.enable = true;
+
desktop.enable = true;
+
apps = {
+
enable = true;
+
wezterm.enable = true;
+
firefox.enable = true;
+
obsidian.enable = true;
+
ollama.enable = true;
+
};
+
};
}
+10 -3
machines/sprite/home.nix
···
{ ... }:
{
-
imports = [
-
../../home/apps
-
];
+
modules = {
+
development.enable = true;
+
apps = {
+
enable = true;
+
wezterm.enable = true;
+
firefox.enable = true;
+
obsidian.enable = true;
+
ollama.enable = true;
+
};
+
};
}
+5 -5
secrets.nix
···
"./modules/server/encrypt/tailscale.age".publicKeys = keys;
"./modules/server/encrypt/rclone.conf.age".publicKeys = keys;
-
"./home/gpg/encrypt/pubring.kbx.age".publicKeys = keys;
-
"./home/gpg/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age".publicKeys = keys;
-
"./home/gpg/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age".publicKeys = keys;
-
"./home/gpg/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age".publicKeys = keys;
+
"./home/base/encrypt/pubring.kbx.age".publicKeys = keys;
+
"./home/base/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age".publicKeys = keys;
+
"./home/base/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age".publicKeys = keys;
+
"./home/base/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age".publicKeys = keys;
-
"./home/js/encrypt/npmrc.age".publicKeys = keys;
+
"./home/development/encrypt/npmrc.age".publicKeys = keys;
}