summaryrefslogtreecommitdiff
path: root/machines/iso.nix
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2025-04-05 14:58:10 -0400
committerKleidi Bujari <mail@4kb.net>2025-04-05 14:58:10 -0400
commit179bf31d5edc90c826dacf0b06b149469d8d14fa (patch)
tree28a07fad01cce7627a2f332094e4a5261c8e5430 /machines/iso.nix
parentbf4d4b2a330c03373f75942b9b1723a67f03a709 (diff)
downloaddepot-179bf31d5edc90c826dacf0b06b149469d8d14fa.tar.gz
depot-179bf31d5edc90c826dacf0b06b149469d8d14fa.tar.bz2
depot-179bf31d5edc90c826dacf0b06b149469d8d14fa.zip
automate hosts gen and bump nixpkgs
Diffstat (limited to 'machines/iso.nix')
-rw-r--r--machines/iso.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/machines/iso.nix b/machines/iso.nix
new file mode 100644
index 0000000..d3ca992
--- /dev/null
+++ b/machines/iso.nix
@@ -0,0 +1,33 @@
+{ modulesPath, pkgs, ... }: {
+ imports = [
+ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
+ (modulesPath + "/installer/cd-dvd/channel.nix")
+ ];
+
+ nixpkgs.hostPlatform.system = "x86_64-linux";
+ nix.settings = {
+ experimental-features = [ "nix-command" "flakes" ];
+ };
+
+ environment.systemPackages = with pkgs; [
+ bash
+ git
+ gum
+ jq
+ (writeShellScriptBin "xinstall" ''
+ set -euo pipefail
+
+ FLAKE="github:kbujari/depot/xnet"
+
+ TARGET=$(
+ nix flake show "$FLAKE" --json 2>/dev/null \
+ | jq -r '.["nixosConfigurations"] | keys[] | select(. != "iso")' \
+ | gum choose
+ )
+
+ gum confirm --default=false "This will erase the selected disk, confirm:"
+
+ echo selected "$FLAKE"#"$TARGET"
+ '')
+ ];
+}