> NixOS Configuration

Configure NixOS systems declaratively. Services, packages, networking, and users.

fetch
$curl "https://skillshub.wtf/skillshub-team/catalog-batch5/nixos-config?format=md"
SKILL.mdNixOS Configuration

NixOS Configuration

/etc/nixos/configuration.nix

{ config, pkgs, ... }: {
  system.stateVersion = "24.05";
  networking.hostName = "myserver";
  networking.firewall.allowedTCPPorts = [ 22 80 443 ];

  users.users.admin = {
    isNormalUser = true;
    extraGroups = [ "wheel" "docker" ];
    openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAA..." ];
  };

  environment.systemPackages = with pkgs; [ vim git htop docker-compose ];

  services.openssh.enable = true;
  services.nginx = {
    enable = true;
    virtualHosts."myapp.com" = {
      forceSSL = true;
      enableACME = true;
      locations."/".proxyPass = "http://localhost:3000";
    };
  };

  virtualisation.docker.enable = true;
}

Rebuild: sudo nixos-rebuild switch

Rollback: sudo nixos-rebuild switch --rollback

Generations: nix-env --list-generations

┌ stats

installs/wk0
░░░░░░░░░░
first seenMar 18, 2026
└────────────