diff options
author | Preston Pan <ret2pop@gmail.com> | 2025-02-08 03:19:30 -0800 |
---|---|---|
committer | Preston Pan <ret2pop@gmail.com> | 2025-02-08 03:19:30 -0800 |
commit | 504b765606f02b610d74d259ddf2c85292e1f6c0 (patch) | |
tree | 49908b9e9064b0f0fc8bf8070e8cf5cdf547e3a6 /nix/systems | |
parent | 56faa5e9caf4408c2c4d6df50287c3b1c9e6c1b4 (diff) |
add nix-topology; make configuration options less bad; restructure project a bit; add flake system looping
Diffstat (limited to 'nix/systems')
-rw-r--r-- | nix/systems/affinity/default.nix | 6 | ||||
-rw-r--r-- | nix/systems/continuity/default.nix | 2 | ||||
-rw-r--r-- | nix/systems/home.nix | 2 | ||||
-rw-r--r-- | nix/systems/installer/default.nix | 16 | ||||
-rw-r--r-- | nix/systems/spontaneity/default.nix | 7 |
5 files changed, 21 insertions, 12 deletions
diff --git a/nix/systems/affinity/default.nix b/nix/systems/affinity/default.nix index 606d934..7f1f29d 100644 --- a/nix/systems/affinity/default.nix +++ b/nix/systems/affinity/default.nix @@ -2,16 +2,16 @@ { imports = [ ../../modules/default.nix - ../../modules/nvme-simple.nix + ../../disko/nvme-simple.nix ../home.nix ]; config = { monorepo = { profiles = { - server.enable = true; + server.enable = false; cuda.enable = true; + workstation.enable = true; }; - vars.hostName = "affinity"; }; }; } diff --git a/nix/systems/continuity/default.nix b/nix/systems/continuity/default.nix index d067581..4899804 100644 --- a/nix/systems/continuity/default.nix +++ b/nix/systems/continuity/default.nix @@ -2,7 +2,7 @@ { imports = [ ../../modules/default.nix - ../../modules/sda-simple.nix + ../../disko/sda-simple.nix ../home.nix ]; } diff --git a/nix/systems/home.nix b/nix/systems/home.nix index af4aa68..c1252df 100644 --- a/nix/systems/home.nix +++ b/nix/systems/home.nix @@ -6,6 +6,6 @@ ]; useGlobalPkgs = true; useUserPackages = true; - users."${config.monorepo.vars.userName}" = import (./. + "/${config.monorepo.vars.hostName}/home.nix"); + users."${config.monorepo.vars.userName}" = import (./. + "/${config.networking.hostName}/home.nix"); }; } 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 '') diff --git a/nix/systems/spontaneity/default.nix b/nix/systems/spontaneity/default.nix index ae79429..df3dc6b 100644 --- a/nix/systems/spontaneity/default.nix +++ b/nix/systems/spontaneity/default.nix @@ -1,8 +1,12 @@ { config, lib, ... }: { imports = [ + # nixos-anywhere generates this file + ./hardware-configuration.nix + + ../../disko/vda-simple.nix + ../../modules/default.nix - ../../modules/vda-simple.nix ../home.nix ]; @@ -12,6 +16,5 @@ ttyonly.enable = true; grub.enable = true; }; - vars.hostName = "spontaneity"; }; } |