dotfiles/nixos
DannyDannyDanny bfe7ae5622 nixos-server: turn off backlight after boot, add video group and light
- Add server-backlight-off service to set backlight to 0 ~65s after boot
  (consoleblank only blanks framebuffer; backlight stays on otherwise)
- Enable programs.light and add danny to video group for light(1) at console
- At console: light -S 100 to restore brightness

Made-with: Cursor
2026-02-28 11:49:04 +01:00
..
home/danny refactor: rename git cleanup alias to 'tidy' in fish and home.nix configurations 🎨 2026-02-25 12:57:41 +01:00
hosts nixos-server: turn off backlight after boot, add video group and light 2026-02-28 11:49:04 +01:00
fish.nix refactor: rename git cleanup alias to 'tidy' in fish and home.nix configurations 🎨 2026-02-25 12:57:41 +01:00
flake.lock feat: add zen-browser support to home-manager and Nix configuration 2026-02-19 16:00:11 +01:00
flake.nix nixos-server: flake, hardware, readme bootstrap, server-quickstart, TODO 2026-02-27 23:18:57 +01:00
hardware-configuration.nix merge: hardware config from main 2025-07-27 16:06:02 +02:00
neovim.nix fix: remove bad cmd go=a 🐛🔥 2026-01-11 15:10:29 +01:00
ollama.nix feat: add ollama 💩 2025-10-26 19:48:17 +01:00
readme.md docs: agent server notes, README server link, TODO verify note, nixos readme 2026-02-27 23:36:19 +01:00
server-install-configuration.nix nixos-server: flake, hardware, readme bootstrap, server-quickstart, TODO 2026-02-27 23:18:57 +01:00
tmux.nix merge: tmux.nix from wsl branch 2025-07-27 14:52:35 +02:00
uxplay.nix merge: uxplay from main 2025-07-27 16:08:35 +02:00
wsl.conf chore: remove wsl.conf 2025-09-09 15:24:51 +02:00

Rebuild nixos and points to dotfiles dir:

sudo nixos-rebuild switch --flake ~/dotfiles/nixos#macbookair
# or
sudo nixos-rebuild switch --flake ~/dotfiles/nixos#wsl
# or (macOS)
sudo -H nix run github:lnl7/nix-darwin -- switch --flake ~/dotfiles/nixos#Daniel-Macbook-Air

Server (nixos-server)

One-time on the server (git is not installed until after the first rebuild, so use nix run to get git):

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
# Enable flakes for this run (needed if the current system config does not)
sudo nixos-rebuild switch --flake /etc/dotfiles/nixos#nixos-server --option accept-flake-config true

If that fails with "does not provide attribute ... nixos-rebuild", enable flakes for the Nix daemon via the current config (on NixOS, /etc/nix/nix.conf is often read-only), then build and switch manually.

From your Mac: push a config that enables flakes, then on the server copy it and rebuild:

scp nixos/server-configuration-with-flakes.nix danny@<server>:/tmp/configuration.nix

On the server:

sudo cp /tmp/configuration.nix /etc/nixos/configuration.nix
sudo nixos-rebuild switch

Then build and switch to the flake:

sudo nix build /etc/dotfiles/nixos#nixosConfigurations.nixos-server.config.system.build.toplevel -o /tmp/nixos-result
sudo /tmp/nixos-result/bin/switch-to-configuration switch

Use git@github.com:DannyDannyDanny/dotfiles.git if the repo is private (clone as danny then sudo mv and sudo chown -R root:root /etc/dotfiles).

SSH keys for danny (not in repo): from your machine scp ~/.ssh/*.pub danny@server:/tmp/, then on server mkdir -p ~/.ssh; cat /tmp/*.pub >> ~/.ssh/authorized_keys.

After that, a timer pulls and rebuilds every 15 min when main changes. Config lives in hosts/nixos-server.nix and hosts/nixos-server-hardware.nix.