added leviathan and elise

This commit is contained in:
2025-08-24 18:36:45 -04:00
parent 470be2b761
commit 62c3aa69fe
20 changed files with 570 additions and 3 deletions

52
users/elise/default.nix Normal file
View File

@@ -0,0 +1,52 @@
{
pkgs,
config,
...
}:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
in
{
sops.secrets.elise_password = {
sopsFile = ../secrets.yaml;
neededForUsers = true;
};
users = {
users.elise = {
isNormalUser = true;
hashedPasswordFile = "${config.sops.secrets.elise_password.path}";
shell = pkgs.zsh;
group = "elise";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZFsc9CSH03ZUP7y81AHwSyjLwFmcshVFCyxDcYhBT rhapsody-in-green" # cspell:disable-line
];
extraGroups = [
"audio"
"video"
"wheel"
"users"
]
++ ifTheyExist [
"dialout"
"docker"
"hass"
"libvirtd"
"networkmanager"
"plugdev"
"scanner"
"transmission"
"uaccess"
"wireshark"
];
uid = 1010;
};
groups.elise.gid = 1010;
};
home-manager.users.elise = import ./systems/${config.networking.hostName}.nix;
}

View File

@@ -0,0 +1,9 @@
{
imports = [
./direnv.nix
./git.nix
./zsh.nix
];
programs.starship.enable = true;
}

View File

@@ -0,0 +1,8 @@
{
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}

View File

@@ -0,0 +1,12 @@
{
programs.git = {
enable = true;
userEmail = "Richie@tmmworkshop.com";
userName = "Richie Cahill";
extraConfig = {
pull.rebase = true;
color.ui = true;
};
lfs.enable = true;
};
}

View File

@@ -0,0 +1,31 @@
{
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
history.size = 10000;
oh-my-zsh = {
enable = true;
plugins = [
"git"
"docker"
"docker-compose"
"colored-man-pages"
"rust"
"systemd"
"tmux"
"ufw"
"z"
];
};
shellAliases = {
"lrt" = "eza --icons -lsnew";
"ls" = "eza";
"ll" = "eza --long --group";
"la" = "eza --all";
"rebuild" = "sudo nixos-rebuild switch --flake $HOME/dotfiles#$HOST";
"rebuild_backup" =
"sudo nixos-rebuild switch --flake $HOME/dotfiles#$HOST --option substituters 'https://nix-community.cachix.org' --option trusted-public-keys 'cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY='";
};
};
}

View File

@@ -0,0 +1,22 @@
{ config, ... }:
{
imports = [
./cli
./programs.nix
./ssh_config.nix
];
programs = {
home-manager.enable = true;
git.enable = true;
};
home = {
username = "elise";
homeDirectory = "/home/${config.home.username}";
stateVersion = "24.05";
sessionVariables = {
FLAKE = "$HOME/dotfiles";
};
};
}

View File

@@ -0,0 +1,33 @@
{ pkgs, ... }:
{
imports = [
./vscode
./kitty.nix
];
home.packages = with pkgs; [
candy-icons
chromium
discord-canary
gimp
gparted
jetbrains.datagrip
mediainfo
nemo
nemo-fileroller
obs-studio
obsidian
prismlauncher
proxychains
prusa-slicer
signal-desktop
sweet-nova
util-linux
vlc
zoom-us
# games
dwarf-fortress
tower-pixel-dungeon
endless-sky
];
}

View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
programs.kitty = {
enable = true;
font.name = "IntoneMono Nerd Font";
settings = {
allow_remote_control = "no";
shell = "${pkgs.zsh}/bin/zsh";
wayland_titlebar_color = "background";
};
themeFile = "VSCode_Dark";
};
}

View File

@@ -0,0 +1,19 @@
{ config, pkgs, ... }:
let
vscode_dir = "/home/richie/dotfiles/users/richie/home/gui/vscode";
in
{
# mutable symlinks to key binds and settings
xdg.configFile."Code/User/settings.json".source =
config.lib.file.mkOutOfStoreSymlink "${vscode_dir}/settings.json";
xdg.configFile."Code/User/keybindings.json".source =
config.lib.file.mkOutOfStoreSymlink "${vscode_dir}/keybindings.json";
home.packages = with pkgs; [ nil ];
programs.vscode = {
enable = true;
package = pkgs.vscode;
mutableExtensionsDir = true;
};
}

View File

@@ -0,0 +1,68 @@
from subprocess import run
def get_installed_extensions():
process = run("code --list-extensions".split(), check=True, capture_output=True)
return set(process.stdout.decode("utf-8").strip().split("\n"))
def main():
print("starting vscode extension manager")
extensions = {
# vscode
"ms-azuretools.vscode-docker",
"ms-vscode-remote.remote-containers",
"ms-vscode-remote.remote-ssh-edit",
"ms-vscode-remote.remote-ssh",
"ms-vscode.hexeditor",
"ms-vscode.remote-explorer",
"ms-vsliveshare.vsliveshare",
"oderwat.indent-rainbow",
"usernamehw.errorlens",
# git
"codezombiech.gitignore",
"eamodio.gitlens",
"gitHub.vscode-github-actions",
# python
"charliermarsh.ruff",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.debugpy",
# rust
"rust-lang.rust-analyzer",
# MD
"davidanson.vscode-markdownlint",
"yzhang.markdown-all-in-one",
# configs
"redhat.vscode-yaml",
"tamasfe.even-better-toml",
# shell
"timonwong.shellcheck",
"foxundermoon.shell-format",
# nix
"jnoortheen.nix-ide",
# database
"mtxr.sqltools-driver-pg",
"mtxr.sqltools",
# other
"esbenp.prettier-vscode",
"mechatroner.rainbow-csv",
"streetsidesoftware.code-spell-checker",
"supermaven.supermaven",
}
installed_extensions = get_installed_extensions()
missing_extensions = extensions.difference(installed_extensions)
for extension in missing_extensions:
run(f"code --install-extension {extension} --force".split(), check=True)
if extra_extensions := installed_extensions.difference(extensions):
print(f"Extra extensions installed: {extra_extensions}")
print("vscode extension manager finished")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,20 @@
[
{
"key": "shift+alt+f",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "alt+a d",
"command": "cSpell.addWordToWorkspaceSettings"
},
{
"key": "ctrl+shift+`",
"command": "workbench.action.createTerminalEditor"
},
{
"key": "ctrl+shift+`",
"command": "-workbench.action.terminal.new",
"when": "terminalProcessSupported || terminalWebExtensionContributedProfile"
}
]

View File

@@ -0,0 +1,77 @@
{
// vscode settings
"diffEditor.ignoreTrimWhitespace": false,
"editor.formatOnSave": true,
"editor.minimap.renderCharacters": false,
"editor.minimap.showSlider": "always",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"explorer.confirmPasteNative": false,
"files.autoSave": "afterDelay",
"git.autofetch": true,
"git.confirmSync": false,
"git.fetchOnPull": true,
"git.pruneOnFetch": true,
"terminal.integrated.scrollback": 10000,
"update.mode": "none",
"workbench.colorTheme": "Default Dark+",
"workbench.secondarySideBar.showLabels": false,
// turns off all sounds and announcements
"accessibility.signals.terminalCommandFailed": {
"sound": "off",
"announcement": "off"
},
"accessibility.signals.terminalQuickFix": {
"sound": "off",
"announcement": "off"
},
"accessibility.signals.terminalBell": {
"sound": "off",
"announcement": "off"
},
// database settings
"sqltools.connections": [
{
"previewLimit": 50,
"server": "192.168.90.40",
"port": 5432,
"askForPassword": true,
"driver": "PostgreSQL",
"name": "main",
"database": "postgres",
"username": "richie"
}
],
// formatters
"[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[markdown]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[nix]": { "editor.defaultFormatter": "jnoortheen.nix-ide" },
"[python]": { "editor.defaultFormatter": "charliermarsh.ruff" },
"[yaml]": { "editor.defaultFormatter": "redhat.vscode-yaml" },
"[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
// spell check
"cSpell.enabled": true,
"cSpell.language": "en,en-US",
"cSpell.enableFiletypes": ["bat", "csv", "nix", "toml"],
"cSpell.userWords": ["Cahill", "syncthing"],
// nix
"nix.enableLanguageServer": true,
"nix.serverPath": "nil",
// python tools
"mypy.runUsingActiveInterpreter": true,
// force the use of rust-analyzer from dev shell
"rust-analyzer.server.path": "rust-analyzer",
"redhat.telemetry.enabled": true,
"gitlens.plusFeatures.enabled": false,
// new
"hediet.vscode-drawio.resizeImages": null
}

View File

@@ -0,0 +1,60 @@
{ pkgs, inputs, ... }:
{
home.packages = with pkgs; [
# cli
bat
btop
eza
fd
ffmpegthumbnailer
fzf
git
gnupg
imagemagick
jq
ncdu
neofetch
ouch
p7zip
poppler
rar
ripgrep
starship
tmux
unzip
yazi
zoxide
# system info
hwloc
lynis
pciutils
smartmontools
usbutils
# networking
iperf3
nmap
wget
# python
poetry
python313
ruff
uv
# nodejs
nodejs
# Rust packages
trunk
wasm-pack
cargo-watch
cargo-generate
cargo-audit
cargo-update
# nix
nix-init
nix-output-monitor
nix-prefetch
nix-tree
nixfmt-rfc-style
treefmt
inputs.system_tools.packages.x86_64-linux.default
];
}

View File

@@ -0,0 +1,34 @@
{
programs.ssh = {
enable = true;
matchBlocks = {
jeeves = {
hostname = "192.168.90.40";
user = "richie";
identityFile = "~/.ssh/id_ed25519";
port = 629;
dynamicForwards = [ { port = 9050; } ];
};
unlock-jeeves = {
hostname = "192.168.99.14";
user = "root";
identityFile = "~/.ssh/id_ed25519";
port = 2222;
};
bob = {
hostname = "192.168.90.25";
user = "richie";
identityFile = "~/.ssh/id_ed25519";
port = 262;
dynamicForwards = [ { port = 9050; } ];
};
rhapsody-in-green = {
hostname = "192.168.90.221";
user = "richie";
identityFile = "~/.ssh/id_ed25519";
port = 922;
};
};
};
}

View File

@@ -0,0 +1,6 @@
{
imports = [
../home/global.nix
../home/gui
];
}