zu_ZA.UTF-8/UTF-8 \
zu_ZA/ISO-8859-1 \
Error: unsupported locales detected:
en_US.UTF-8 \
ru_RU.UTF-8 \
You should choose from the list above the error.
error: builder for '/nix/store/smhhc2wx7y5ih19y0ygf0rcrknjq18n9-glibc-locales-2.39-52.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/mhnb2xxp8153bc1psvx9pdsnwv5vlzhw-nixos-system-nixos-24.05.5366.fbca5e745367.drv' failed to build
{ config, pkgs, ... }:

{
  imports = [
    ./hardware-configuration.nix
  ];

  # Bootloader Configuration
  boot.loader.grub = {
    enable = true;
    device = "/dev/sda";
    useOSProber = true;
  };

  # Hostname
  networking.hostName = "nixos";

  # Network Manager
  networking.networkmanager.enable = true;

  # Timezone
  time.timeZone = "Europe/Moscow";

  # Localization
  i18n = {
    defaultLocale = "en_US.UTF-8";
    supportedLocales = [
      "en_US.UTF-8"
      "ru_RU.UTF-8"
      # "zu_ZA.UTF-8"  # Uncomment if supported and needed
    ];
    extraLocaleSettings = {
      LC_ADDRESS = "ru_RU.UTF-8";
      LC_IDENTIFICATION = "ru_RU.UTF-8";
      LC_MEASUREMENT = "ru_RU.UTF-8";
      LC_MONETARY = "ru_RU.UTF-8";
      LC_NAME = "ru_RU.UTF-8";
      LC_NUMERIC = "ru_RU.UTF-8";
      LC_PAPER = "ru_RU.UTF-8";
      LC_TELEPHONE = "ru_RU.UTF-8";
      LC_TIME = "ru_RU.UTF-8";
    };
  };

  # X11 and Desktop Environment
  services.xserver.enable = true;
  services.xserver.displayManager.lightdm.enable = true;
  services.xserver.desktopManager.mate.enable = true;
  services.xserver.xkb = {
    layout = "ru,us";
    variant = ",";
    options = "grp:alt_shift_toggle";
  };

  # Sound Configuration with PipeWire
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
  };

  # Bluetooth
  hardware.bluetooth.enable = true;
  services.blueman.enable = true;

  # User Configuration
  users.users.m = {
    isNormalUser = true;
    description = "m";
    extraGroups = [ "networkmanager" "wheel" "bluetooth" ];
    hashedPassword = "sha512$..."; # Replace with your hashed password
    packages = with pkgs; [ firefox telegram-desktop ];
    # Optional: SSH Keys
    openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ..." ];
  };

  # Auto Login
  services.displayManager.autoLogin.enable = true;
  services.displayManager.autoLogin.user = "m";

  # Disable getty and autovt on tty1
  systemd.services."getty@tty1".enable = false;
  systemd.services."autovt@tty1".enable = false;

  # Allow Unfree Packages
  nixpkgs.config.allowUnfree = true;

  # System Packages
  environment.systemPackages = with pkgs; [
    vim
    wget
    docker
    htop
    git
    curl
  ];

  # System State Version
  system.stateVersion = "24.05";

  # DNS Configuration
  networking.nameservers = [ "127.0.0.1" "8.8.8.8" "1.1.1.1" ];

  # Environment Variables
  environment.variables = {
    EDITOR = "vim"; # or "gedit" if you prefer GUI
  };

  # Experimental Features
  nix.settings.experimental-features = [ "nix-command" "flakes" ];

  # Docker
  virtualisation.docker.enable = true;

  # Firewall
  networking.firewall.enable = true;
  networking.firewall.allowedTCPPorts = [ 22 80 443 ];
  networking.firewall.allowedUDPPorts = [ ];

  # Optional: Add Swap Space
  swapDevices = [
    { device = "/swapfile"; size = 4096; }
  ];

  # Optional: Install Fonts
  fonts.fonts = with pkgs; [
    noto-fonts
    noto-fonts-cjk
    noto-fonts-emoji
  ];
}