From ddc053c0cf25a4d6a0f59f22c408516ed9445bd5 Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Mon, 21 Jul 2025 13:24:05 +1000 Subject: [PATCH] modified: installer.nix --- installer.nix | 101 ++++++++------------------------------------------ 1 file changed, 16 insertions(+), 85 deletions(-) diff --git a/installer.nix b/installer.nix index 3f02902..40e92fc 100644 --- a/installer.nix +++ b/installer.nix @@ -62,90 +62,21 @@ environment.etc."git-credentials".text = fi ''; environment.etc."nixos/.bashrc".mode = "0755"; + #Set root password +users.users.root = { + hashedPassword = "$6$Kwv9KAyvcurAViQF$H4.u3feqGE7lVoNgkFXhE3n2Pmo//9JYDTCz8ifrVHBxPjwa1xMby7tEZ8Bpt5MXs9Rkx6/YbZWxs5CpH0s/70"; +}; - # systemd.services.autoInstallInteractive = { - # description = "Interactive NixOS installer on tty1"; - # conflicts = [ "getty@tty1.service" ]; - # after = [ "getty@tty1.service" ]; - # wantedBy = [ "multi-user.target" ]; - - # serviceConfig = { - # Type = "simple"; - # StandardInput = "tty"; - # StandardOutput = "inherit"; - # TTYPath = "/dev/tty1"; - # TTYReset = true; - # TTYVHangup = true; - # }; - -# systemd.services."autovt@tty1" = { -# description = "Run installer script on TTY1"; -# after = [ "getty@tty1.service" ]; -# wantedBy = [ "multi-user.target" ]; - -# serviceConfig = { -# ExecStart = [ "" "@${pkgs.util-linux}/sbin/agetty" "agetty --noclear --autologin root --login-program /etc/auto-install.sh %I $TERM" ]; -# Type = "idle"; # wait for console initialization -# Restart = "no"; -# }; - - -# path = [ -# pkgs.bash -# pkgs.parted -# pkgs.util-linux -# pkgs.e2fsprogs -# pkgs.nixos-install -# pkgs.git -# ]; - # Run script attached to tty1 -# script = "exec /etc/auto-install.sh"; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.nixos = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + tree + ]; + hashedPassword = "$6$Kwv9KAyvcurAViQF$H4.u3feqGE7lVoNgkFXhE3n2Pmo//9JYDTCz8ifrVHBxPjwa1xMby7tEZ8Bpt5MXs9Rkx6/YbZWxs5CpH0s/70"; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCq/Q5LvIXlZwO2kdeAN5nLGZ59nZB7JHYMEszHxmNtGMzv1lM31jiPNsr0z2EKVZhE7OOfa2IF9rhWYD7JUA9G0yzdZ4WTXFNGVVOJoOVH6vAF3XCxoVilOEwTc7h2Wiy+rzd0B28/3spffzQQWJhY6GRQVa8j+6xAGF60Fcvl1vLosYT9Bn2ZbK4TCWOwAn2jqXIieGpZdn/UNZbGOeKRiCvhktDfMAzuQzN/9jMu/oF4pkPn2X1UrsQdNlvp0Ci8md612MozIpncQJyAF1ADhunr3sMx0isUXiqD29R5DS4TftpekqLNLak+zcxFa8N7DcRNp3DcKfJvyTkwQrR4r+b7lFLYOLHLagSso9CzeW/paAS2q9I5SBm/2DtE1diLLg2jZikYcstsu/G5RgvbzbKqjiaMwTdXC3AMvDxQrs7U5pDRZFzoofG3cpODbTm+uy3m0kP70z0M1K45UbDG0p+itnTu9x40JbQEgefbx38AItNvAIx1A8HO4I1VX28= wayne@stream" + ]; + }; } - # systemd.services.autoInstall = { - # description = "Automatic NixOS installation"; - # wantedBy = [ "multi-user.target" ]; - # after = [ "network-online.target" ]; - # path = [ - # pkgs.parted - # pkgs.util-linux - # pkgs.e2fsprogs - # pkgs.nixos-install - # pkgs.nix - # pkgs.git - # pkgs.bash - # ]; - # serviceConfig = { - # Type = "oneshot"; - # ExecStart = pkgs.writeShellScript "auto-install.sh" '' - # set -eux - # #create MBR table - # parted /dev/sda -- mklabel msdos - # #create nixos partition - # parted /dev/sda -- mkpart primary 1MB -8GB - # #set nixos partition to bootable - # parted /dev/sda -- set 1 boot on - # # create swap partition - # parted /dev/sda -- mkpart primary linux-swap -8GB 100% - - # #format OS partition - # mkfs.ext4 -L nixos /dev/sda1 - # #format swap - # mkswap -L swap /dev/sda2 - - # #activate swap - # swapon /dev/sda2 - - # #mount nixos partition - # mount /dev/disk/by-label/nixos /mnt - # # Choose a disk-backed temp directory - # mkdir -p /mnt/install-tmp - # export TMPDIR=/mnt/install-tmp - - # nixos-install --flake "$(cat /etc/flake-url)" --no-root-password --no-write-lock-file - # rm -r /mnt/install-tmp - # sleep 10 - # reboot - # ''; - # }; - # }; -