refactor: split base.nix into core.nix + base.nix layers
core.nix is the new minimal layer: user, SSH, fish, nix flakes/gc, locale, and a handful of essential packages. Suitable for any headless host that just needs to be SSHable and manageable. base.nix now imports core.nix and adds the day-to-day quality-of-life layer: avahi, mosh, direnv, nix-ld, earlyoom, zramSwap, CLI tools, and build toolchains. All existing hosts that import base.nix are unchanged. bootstrap is updated to import core.nix directly instead of duplicating the config inline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
459a8622c9
commit
28e7103375
3 changed files with 81 additions and 184 deletions
|
|
@ -3,91 +3,25 @@
|
|||
{
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
||||
../modules/core.nix
|
||||
];
|
||||
|
||||
nix.settings = {
|
||||
sandbox = false;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
trusted-users = [ "root" "alex" ];
|
||||
};
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
nix.settings.sandbox = false;
|
||||
|
||||
proxmoxLXC = {
|
||||
manageNetwork = false;
|
||||
privileged = false;
|
||||
privileged = true;
|
||||
};
|
||||
|
||||
networking.hostName = "bootstrap";
|
||||
|
||||
time.timeZone = "Australia/Brisbane";
|
||||
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_AU.UTF-8";
|
||||
LC_IDENTIFICATION = "en_AU.UTF-8";
|
||||
LC_MEASUREMENT = "en_AU.UTF-8";
|
||||
LC_MONETARY = "en_AU.UTF-8";
|
||||
LC_NAME = "en_AU.UTF-8";
|
||||
LC_NUMERIC = "en_AU.UTF-8";
|
||||
LC_PAPER = "en_AU.UTF-8";
|
||||
LC_TELEPHONE = "en_AU.UTF-8";
|
||||
LC_TIME = "en_AU.UTF-8";
|
||||
};
|
||||
|
||||
console.keyMap = "dvorak";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
documentation.man.generateCaches = false;
|
||||
|
||||
programs.fish.enable = true;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings.PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
nssmdns6 = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
};
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
users.users.alex = {
|
||||
isNormalUser = true;
|
||||
description = "Alexander Wainwright";
|
||||
extraGroups = [ "wheel" ];
|
||||
shell = pkgs.fish;
|
||||
openssh.authorizedKeys.keys = [
|
||||
# TODO: add your SSH public key here
|
||||
];
|
||||
};
|
||||
users.users.alex.openssh.authorizedKeys.keys = [
|
||||
# TODO: add your SSH public key here
|
||||
];
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
# TODO: add your SSH public key here
|
||||
];
|
||||
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
git
|
||||
htop
|
||||
neovim
|
||||
rsync
|
||||
wget
|
||||
];
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue