Archived
Several single-purpose modules sat at modules/ root or in the services/ catch-all despite the repo's established pattern of one directory per concern (tailscale/, beszel/, docker/, nix-cache/): - remote-builder-client.nix -> nix-cache/ (always co-included with nix-cache/client.nix in flake.nix's mkTarget, same buildType guard) - set-locale.nix -> common/ (unconditionally imported by common/configuration.nix already) - enable-ip-forwarding.nix -> networking/ - rotate-traefik-logs.nix -> traefik/rotate-logs.nix - services/docker-health-to-gotify.nix and services/nextcloud-cron-job.nix -> docker/ (both only ever imported by the docker build type, same as the rest of modules/docker/*) Pure path moves plus import-path updates in flake.nix, common/configuration.nix, and build-types/docker.nix — verified eval-equivalent (drvPath-identical) across representative hosts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
93 lines
3.2 KiB
Nix
93 lines
3.2 KiB
Nix
{ config, lib, pkgs, vars, ... }:
|
||
|
||
{
|
||
imports =
|
||
[
|
||
# Include the results of the hardware scan.
|
||
# ./hardware-configuration.nix
|
||
./set-locale.nix
|
||
];
|
||
# Use the GRUB 2 boot loader.
|
||
# boot.loader.grub.enable = true;
|
||
#boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
||
|
||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||
|
||
# Set your time zone.
|
||
time.timeZone = vars.timeZone;
|
||
|
||
# Enable QEMU agent
|
||
services.qemuGuest.enable = true;
|
||
|
||
# Enable docker-compose
|
||
environment.systemPackages = with pkgs; [
|
||
vim
|
||
btop
|
||
git
|
||
gcr
|
||
];
|
||
|
||
# Secrets shared by every host, decrypted at activation via each host's
|
||
# existing SSH host key (sops-nix derives the age key from
|
||
# /etc/ssh/ssh_host_ed25519_key automatically — see modules/common/README
|
||
# or docs/ for the sops workflow). hashedPassword/hashedPasswordFile need
|
||
# neededForUsers so they're available before the normal secret-activation
|
||
# step, since user creation happens very early in boot.
|
||
sops.defaultSopsFile = ../../secrets/common.yaml;
|
||
sops.secrets."root-hashedPassword".neededForUsers = true;
|
||
sops.secrets."nixos-hashedPassword".neededForUsers = true;
|
||
sops.secrets."nix-github-token" = { };
|
||
|
||
# nix.conf doesn't support a *File-style option for access-tokens, so the
|
||
# token is rendered into a runtime-only file (never touches the Nix store)
|
||
# and pulled in via nix.conf's native !include directive.
|
||
sops.templates."nix-github-token.conf".content = ''
|
||
access-tokens = github.com=${config.sops.placeholder."nix-github-token"}
|
||
'';
|
||
nix.extraOptions = ''
|
||
!include ${config.sops.templates."nix-github-token.conf".path}
|
||
'';
|
||
|
||
#Set root password
|
||
users.users.root = {
|
||
hashedPasswordFile = config.sops.secrets."root-hashedPassword".path;
|
||
};
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users.${vars.primaryUser} = {
|
||
isNormalUser = true;
|
||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||
packages = with pkgs; [
|
||
tree
|
||
];
|
||
hashedPasswordFile = config.sops.secrets."nixos-hashedPassword".path;
|
||
openssh.authorizedKeys.keys = [
|
||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCq/Q5LvIXlZwO2kdeAN5nLGZ59nZB7JHYMEszHxmNtGMzv1lM31jiPNsr0z2EKVZhE7OOfa2IF9rhWYD7JUA9G0yzdZ4WTXFNGVVOJoOVH6vAF3XCxoVilOEwTc7h2Wiy+rzd0B28/3spffzQQWJhY6GRQVa8j+6xAGF60Fcvl1vLosYT9Bn2ZbK4TCWOwAn2jqXIieGpZdn/UNZbGOeKRiCvhktDfMAzuQzN/9jMu/oF4pkPn2X1UrsQdNlvp0Ci8md612MozIpncQJyAF1ADhunr3sMx0isUXiqD29R5DS4TftpekqLNLak+zcxFa8N7DcRNp3DcKfJvyTkwQrR4r+b7lFLYOLHLagSso9CzeW/paAS2q9I5SBm/2DtE1diLLg2jZikYcstsu/G5RgvbzbKqjiaMwTdXC3AMvDxQrs7U5pDRZFzoofG3cpODbTm+uy3m0kP70z0M1K45UbDG0p+itnTu9x40JbQEgefbx38AItNvAIx1A8HO4I1VX28= wayne@stream"
|
||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICMJhrfFayLBG+gWtO6oAvgambw5nWWgztiTFEaaaVRH debian@surface"
|
||
];
|
||
};
|
||
|
||
|
||
# Enable the OpenSSH daemon.
|
||
services.openssh.enable = true;
|
||
|
||
#Enable flakes
|
||
|
||
nix.settings = {
|
||
experimental-features = [ "nix-command" "flakes" ];
|
||
auto-optimise-store = true;
|
||
};
|
||
|
||
|
||
programs.git = {
|
||
enable = true;
|
||
package = pkgs.git;
|
||
config = {
|
||
credential.helper = "store";
|
||
};
|
||
};
|
||
|
||
|
||
|
||
}
|