Archived
One file (variables.nix) holding every value that was previously hardcoded and repeated across modules: LAN domain/CIDR, home/tailnet domains, cross-host references (nix-cache substituter hostname, NFS server hostname, remote-builder user), PXE/PBS IPs, timezone, and the primary username. Wired in via flake.nix's specialArgs (and home-manager's extraSpecialArgs for the two home.nix files), so any module picks it up by just adding `vars` to its function arguments — no explicit import needed. Two hosts (nix-cache, server) now derive their own networking.hostName from the same variable other hosts use to reach them, so there's exactly one place to change either identifier. Purely mechanical: every substituted value matches what was already there, confirmed by identical toplevel .drv paths for all 17 targets before and after. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
67 lines
1.9 KiB
Nix
67 lines
1.9 KiB
Nix
{ config, pkgs, lib, vars, ... }:
|
|
|
|
let
|
|
remote = "root@proxmox-ip:/var/lib/vz/template/iso";
|
|
localMount = "${config.home.homeDirectory}/proxmox-iso";
|
|
in
|
|
{
|
|
|
|
imports = [
|
|
./aliases.nix
|
|
];
|
|
|
|
home.username = vars.primaryUser;
|
|
home.homeDirectory = "/home/${vars.primaryUser}";
|
|
home.stateVersion = "25.11"; # match your NixOS stateVersion
|
|
|
|
programs.home-manager.enable = true; # mandatory to activate HM
|
|
|
|
programs.bash.enable = true;
|
|
|
|
# GitHub access-tokens setting used to live here in plaintext; it's now
|
|
# rendered system-wide from a sops-nix secret via nix.extraOptions in
|
|
# modules/common/configuration.nix instead (covers the daemon for every
|
|
# user, not just this one).
|
|
|
|
# Optional: packages
|
|
home.packages = with pkgs; [
|
|
git
|
|
vim
|
|
tmux
|
|
nano
|
|
sshfs
|
|
];
|
|
|
|
# Optional: set environment vars
|
|
home.sessionVariables = {
|
|
EDITOR = "nano";
|
|
};
|
|
# systemd.user.services.mount-proxmox-iso = {
|
|
# Unit = {
|
|
# Description = "Mount Proxmox ISO dir via SSHFS";
|
|
# After = [ "network-online.target" ];
|
|
# Wants = [ "network-online.target" ];
|
|
# };
|
|
|
|
# Service = {
|
|
# Type = "simple";
|
|
# ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${localMount}";
|
|
# ExecStart = "${pkgs.sshfs}/bin/sshfs -o IdentityFile=${config.home.homeDirectory}/.ssh/id_ed25519,allow_other,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 root@proxmox-ip:/var/lib/vz/template/iso ${localMount}";
|
|
# ExecStop = "${pkgs.fuse3}/bin/fusermount3 -u ${localMount}";
|
|
# Restart = "on-failure";
|
|
# };
|
|
|
|
# Install = {
|
|
# WantedBy = [ "default.target" ];
|
|
# };
|
|
# };
|
|
# Optional: enable bash (or zsh, fish...)
|
|
# programs.bash.enable = true;
|
|
|
|
# Optional: manage dotfiles via symlinks
|
|
# home.file = {
|
|
# ".tmux.conf".source = ./dotfiles/tmux.conf;
|
|
# ".config/nvim/init.vim".source = ./dotfiles/init.vim;
|
|
# };
|
|
}
|