Rename nixos-server to sunken-ship

- Rename hosts/nixos-server.nix -> sunken-ship.nix, nixos-server-hardware.nix -> sunken-ship-hardware.nix
- Flake: nixos-server -> sunken-ship, update module path
- Set networking.hostName = sunken-ship in server configs
- Update AGENTS.md, nixos/readme.md, docs/ssh-and-secrets.md, TODO.md

Made-with: Cursor
This commit is contained in:
DannyDannyDanny 2026-03-01 12:44:28 +01:00
parent cd7658f452
commit 1338fb1b68
9 changed files with 19 additions and 25 deletions

View file

@ -57,9 +57,9 @@
];
};
nixos-server = nixpkgs.lib.nixosSystem {
sunken-ship = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./hosts/nixos-server.nix ];
modules = [ ./hosts/sunken-ship.nix ];
};
};

View file

@ -1,4 +1,4 @@
# Do not modify this file! It was generated by nixos-generate-config
# Do not modify this file! It was generated by 'nixos-generate-config'
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

View file

@ -2,19 +2,19 @@
#
# One-time on server: clone repo to /etc/dotfiles (root needs git access).
# If private repo: use SSH (ssh:// or git@) and add root's key to GitHub, or use HTTPS + token.
# Then: sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#nixos-server
# Then: sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#sunken-ship
# If sudo git is not found: sudo nix run nixpkgs#git -- -C /etc/dotfiles pull origin main
# Timer runs every 15 min: git fetch, pull if origin/main changed, rebuild.
{ config, lib, pkgs, ... }:
let
dotfilesDir = "/etc/dotfiles";
flakeRef = "${dotfilesDir}/nixos#nixos-server";
flakeRef = "${dotfilesDir}/nixos#sunken-ship";
in
{
imports = [ ./nixos-server-hardware.nix ];
imports = [ ./sunken-ship-hardware.nix ];
networking.hostName = "nixos-server";
networking.hostName = "sunken-ship";
time.timeZone = "Europe/Copenhagen";
boot.kernelParams = [ "consoleblank=60" ]; # blank TTY after 60s to reduce burn-in
@ -41,7 +41,7 @@ in
users.users.danny = {
isNormalUser = true;
extraGroups = [ "wheel" "video" ]; # video: backlight control via light(1)
# SSH keys: push via scp, don't commit. NixOS does not manage authorized_keys so scpd keys persist.
# SSH keys: push via scp, don't commit. NixOS does not manage authorized_keys so scp'd keys persist.
# Example: scp ~/.ssh/id_*_github.pub danny@server:/tmp/ then on server: mkdir -p ~/.ssh; cat /tmp/*.pub >> ~/.ssh/authorized_keys
};

View file

@ -8,20 +8,20 @@ sudo nixos-rebuild switch --flake ~/dotfiles/nixos#macbookair
# macOS: cd ~/dotfiles/nixos && darwin-rebuild switch --flake .
```
## Server (nixos-server)
## Server (sunken-ship)
One-time bootstrap (no git until first rebuild):
```bash
nix run --extra-experimental-features "nix-command flakes" nixpkgs#git -- clone https://github.com/DannyDannyDanny/dotfiles.git /tmp/dotfiles
sudo mv /tmp/dotfiles /etc/dotfiles
sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#nixos-server --option accept-flake-config true
sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#sunken-ship --option accept-flake-config true
```
If the daemon doesnt have flakes: copy [server-configuration-with-flakes.nix](server-configuration-with-flakes.nix) to `/etc/nixos/configuration.nix`, run `sudo nixos-rebuild switch`, then build and switch to the flake (see [server-quickstart.md](../server-quickstart.md) for SSH keys).
SSH keys (not in repo): `scp ~/.ssh/*.pub danny@server:/tmp/`, then on server `mkdir -p ~/.ssh; cat /tmp/*.pub >> ~/.ssh/authorized_keys`. See [docs/ssh-and-secrets.md](../docs/ssh-and-secrets.md).
Timer: every 15 min the server pulls and rebuilds when `main` changes. Config: `hosts/nixos-server.nix`, `hosts/nixos-server-hardware.nix`.
Timer: every 15 min the server pulls and rebuilds when `main` changes. Config: `hosts/sunken-ship.nix`, `hosts/sunken-ship-hardware.nix`.
No git in PATH: `sudo nix run nixpkgs#git -- -C /etc/dotfiles pull origin main`.

View file

@ -7,7 +7,7 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos-server";
networking.hostName = "sunken-ship";
time.timeZone = "Europe/Copenhagen";
nix.settings.experimental-features = [ "nix-command" "flakes" ];

View file

@ -7,13 +7,13 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos-server";
networking.hostName = "sunken-ship";
time.timeZone = "Europe/Copenhagen";
users.users.danny = {
isNormalUser = true;
extraGroups = [ "wheel" ];
# After install, add keys via scp (see server-quickstart or nixos-server.nix comment).
# After install, add keys via scp (see server-quickstart or sunken-ship.nix comment).
};
services.openssh.enable = true;