From 504b765606f02b610d74d259ddf2c85292e1f6c0 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sat, 8 Feb 2025 03:19:30 -0800 Subject: add nix-topology; make configuration options less bad; restructure project a bit; add flake system looping --- nix/systems/installer/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'nix/systems/installer') diff --git a/nix/systems/installer/default.nix b/nix/systems/installer/default.nix index 2b832f4..d3d1693 100644 --- a/nix/systems/installer/default.nix +++ b/nix/systems/installer/default.nix @@ -1,10 +1,13 @@ -{ pkgs, config, lib, ... }: +{ pkgs, config, lib, modulesPath, ... }: let commits = import ./commits.nix; in { + imports = [ + (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") + ]; + networking = { - hostName = "nixos"; networkmanager = { enable = true; }; @@ -40,6 +43,9 @@ in '' #!/usr/bin/env bash +SYSTEM=continuity +DRIVE=sda + set -euo pipefail if [ "$(id -u)" -eq 0 ]; then echo "ERROR! $(basename "$0") should be run as a regular user" @@ -52,10 +58,10 @@ if [ ! -d "$HOME/monorepo/" ]; then cd monorepo git checkout "${commits.monorepoCommitHash}" fi -vim "$HOME/monorepo/nix/systems/continuity/default.nix" -sudo nix --experimental-features "nix-command flakes" run "github:nix-community/disko/${commits.diskoCommitHash}" -- --mode destroy,format,mount "$HOME/monorepo/nix/modules/sda-simple.nix" +vim "$HOME/monorepo/nix/systems/$SYSTEM/default.nix" +sudo nix --experimental-features "nix-command flakes" run "github:nix-community/disko/${commits.diskoCommitHash}" -- --mode destroy,format,mount "$HOME/monorepo/nix/disko/$DRIVE-simple.nix" cd /mnt -sudo nixos-install --flake $HOME/monorepo/nix#continuity +sudo nixos-install --flake "$HOME/monorepo/nix#$SYSTEM" sudo cp -r $HOME/monorepo "/mnt/home/$(ls /mnt/home/)/" echo "rebooting..."; sleep 3; reboot '') -- cgit