Created
July 15, 2025 19:11
-
-
Save azazelassembly/cfc461d107a177fda4b1c03646c894bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| echo "[1/6] Форматирование /dev/sda2..." | |
| mkfs.ext4 -F /dev/sda2 | |
| echo "[2/6] Монтирование..." | |
| mount /dev/sda2 /mnt | |
| echo "[3/6] Генерация конфигурации..." | |
| nixos-generate-config --root /mnt | |
| echo "[4/6] Загрузка нового configuration.nix..." | |
| cat > /mnt/etc/nixos/configuration.nix <<EOF | |
| { config, pkgs, ... }: | |
| { | |
| imports = [ ./hardware-configuration.nix ]; | |
| boot.loader.grub.enable = true; | |
| boot.loader.grub.version = 2; | |
| boot.loader.grub.device = "/dev/sda"; | |
| networking.hostName = "nixos"; | |
| networking.networkmanager.enable = true; | |
| time.timeZone = "Europe/Kyiv"; | |
| i18n.defaultLocale = "en_US.UTF-8"; | |
| console.keyMap = "us"; | |
| users.users.nika = { | |
| isNormalUser = true; | |
| extraGroups = [ "wheel" ]; | |
| password = "root"; | |
| }; | |
| users.users.root.initialPassword = "root"; | |
| environment.systemPackages = with pkgs; [ nano ]; | |
| services.openssh.enable = true; | |
| system.stateVersion = "24.05"; | |
| } | |
| EOF | |
| echo "[5/6] Установка системы..." | |
| nixos-install | |
| echo "[6/6] Готово! Теперь перезагрузи систему." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment