Clean up config & add comments.

This commit is contained in:
Fern Garden 2025-07-16 18:46:12 +08:00
parent b504700e61
commit c2fc35e12d
18 changed files with 162 additions and 114 deletions

View file

@ -52,10 +52,10 @@ with lib; {
networking.hostName = hostname;
# Define a user account.
users.users.${user} = {
users.users.fern = {
isNormalUser = true;
uid = 1000;
description = mkIf (user == "fern") "Fern Garden";
description = "Fern Garden";
extraGroups = [
"wheel"
"networkmanager"
@ -95,6 +95,9 @@ with lib; {
# https://discourse.nixos.org/t/slow-build-at-building-man-cache/52365/2
documentation.man.generateCaches = false;
# Enable all terminfo (for ghostty).
environment.enableAllTerminfo = true;
# Install some packages.
programs = {
git.enable = true;
@ -102,9 +105,11 @@ with lib; {
nixvim = {
enable = true;
# Set $EDITOR
defaultEditor = true;
# For telescope.
# For telescope grep.
dependencies.ripgrep.enable = true;
# Space as leader.
@ -127,7 +132,10 @@ with lib; {
colorschemes.gruvbox = {
enable = true;
settings.contrast = "hard";
settings = {
contrast = "hard";
overrides.SignColumn.bg = "none";
};
};
opts = rec {

View file

@ -4,6 +4,8 @@
...
}:
with lib; {
imports = [../.]; # Common config.
# Configure the bootloader.
boot = {
# Enable secure boot.

View file

@ -1,15 +1,9 @@
{
user,
lib,
...
}:
with lib; {
imports = [../.]; # Common config.
# Passwordless sudo.
security.sudo.wheelNeedsPassword = false;
# Enable all terminfo (for ghostty).
environment.enableAllTerminfo = true;
# Enable sshd.
services.openssh = {
enable = true;
@ -20,14 +14,11 @@ with lib; {
};
};
users.users.${user} = {
# Add authorized ssh pubkeys.
users.users.fern = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETPyuxUVEmYyEW6PVC6BXqkhULHd/RvMm8fMbYhjTMV fern@muskduck"
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIMoJvPcUJDVVzO4dHROCFNlgJdDZSP5xyPx2s40zcx5QAAAABHNzaDo= YubiKey5NFC"
];
extraGroups = mkIf (user == "docker") ["docker"]; # if docker is enabled.
};
# Enable docker.
virtualisation.docker.enable = mkIf (user == "docker") true;
}

View file

@ -0,0 +1,9 @@
{
# Add user to docker group.
users.users.fern = {
extraGroups = ["docker"];
};
# Enable docker.
virtualisation.docker.enable = true;
}

View file

@ -1,6 +1,6 @@
{modulesPath, ...}: {
imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix")
./server.nix
../. # Server config.
];
}

View file

@ -6,7 +6,7 @@
with lib; {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
./server.nix
../. # Server config.
];
# Load kernel modules.