modified: installer.nix

This commit is contained in:
2025-07-21 13:24:05 +10:00
parent 3934d53033
commit ddc053c0cf
+16 -85
View File
@@ -62,90 +62,21 @@ environment.etc."git-credentials".text =
fi fi
''; '';
environment.etc."nixos/.bashrc".mode = "0755"; environment.etc."nixos/.bashrc".mode = "0755";
#Set root password
users.users.root = {
hashedPassword = "$6$Kwv9KAyvcurAViQF$H4.u3feqGE7lVoNgkFXhE3n2Pmo//9JYDTCz8ifrVHBxPjwa1xMby7tEZ8Bpt5MXs9Rkx6/YbZWxs5CpH0s/70";
};
# systemd.services.autoInstallInteractive = { # Define a user account. Don't forget to set a password with passwd.
# description = "Interactive NixOS installer on tty1"; users.users.nixos = {
# conflicts = [ "getty@tty1.service" ]; isNormalUser = true;
# after = [ "getty@tty1.service" ]; extraGroups = [ "wheel" ]; # Enable sudo for the user.
# wantedBy = [ "multi-user.target" ]; packages = with pkgs; [
tree
# serviceConfig = { ];
# Type = "simple"; hashedPassword = "$6$Kwv9KAyvcurAViQF$H4.u3feqGE7lVoNgkFXhE3n2Pmo//9JYDTCz8ifrVHBxPjwa1xMby7tEZ8Bpt5MXs9Rkx6/YbZWxs5CpH0s/70";
# StandardInput = "tty"; openssh.authorizedKeys.keys = [
# StandardOutput = "inherit"; "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCq/Q5LvIXlZwO2kdeAN5nLGZ59nZB7JHYMEszHxmNtGMzv1lM31jiPNsr0z2EKVZhE7OOfa2IF9rhWYD7JUA9G0yzdZ4WTXFNGVVOJoOVH6vAF3XCxoVilOEwTc7h2Wiy+rzd0B28/3spffzQQWJhY6GRQVa8j+6xAGF60Fcvl1vLosYT9Bn2ZbK4TCWOwAn2jqXIieGpZdn/UNZbGOeKRiCvhktDfMAzuQzN/9jMu/oF4pkPn2X1UrsQdNlvp0Ci8md612MozIpncQJyAF1ADhunr3sMx0isUXiqD29R5DS4TftpekqLNLak+zcxFa8N7DcRNp3DcKfJvyTkwQrR4r+b7lFLYOLHLagSso9CzeW/paAS2q9I5SBm/2DtE1diLLg2jZikYcstsu/G5RgvbzbKqjiaMwTdXC3AMvDxQrs7U5pDRZFzoofG3cpODbTm+uy3m0kP70z0M1K45UbDG0p+itnTu9x40JbQEgefbx38AItNvAIx1A8HO4I1VX28= wayne@stream"
# 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";
} }
# 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
# '';
# };
# };