modified: auto-installer/installer.nix
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
# installer.nix
|
{ lib, pkgs, modulesPath, config, ... }:
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
|
modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
@@ -12,15 +12,9 @@
|
|||||||
services.openssh.permitRootLogin = "yes";
|
services.openssh.permitRootLogin = "yes";
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
git
|
git curl parted e2fsprogs btrfs-progs util-linux
|
||||||
curl
|
|
||||||
parted
|
|
||||||
e2fsprogs
|
|
||||||
btrfs-progs
|
|
||||||
util-linux
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Your flake source (adjust as needed)
|
|
||||||
environment.etc."flake-url".text = "git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#nixos";
|
environment.etc."flake-url".text = "git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git#nixos";
|
||||||
|
|
||||||
systemd.services.autoInstall = {
|
systemd.services.autoInstall = {
|
||||||
@@ -31,11 +25,6 @@
|
|||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = pkgs.writeShellScript "auto-install.sh" ''
|
ExecStart = pkgs.writeShellScript "auto-install.sh" ''
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
echo "Running auto-install from flake..."
|
|
||||||
|
|
||||||
# Disk prep
|
|
||||||
|
|
||||||
#create MBR table
|
#create MBR table
|
||||||
parted /dev/sda -- mklabel msdos
|
parted /dev/sda -- mklabel msdos
|
||||||
#create nixos partition
|
#create nixos partition
|
||||||
@@ -55,12 +44,7 @@
|
|||||||
|
|
||||||
#mount nixos partition
|
#mount nixos partition
|
||||||
mount /dev/disk/by-label/nixos /mnt
|
mount /dev/disk/by-label/nixos /mnt
|
||||||
|
|
||||||
|
|
||||||
# Install system using flake
|
|
||||||
nixos-install --flake "$(cat /etc/flake-url)" --no-root-password
|
nixos-install --flake "$(cat /etc/flake-url)" --no-root-password
|
||||||
|
|
||||||
echo "Installation complete, rebooting in 10s..."
|
|
||||||
sleep 10
|
sleep 10
|
||||||
reboot
|
reboot
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user