From c238d26aec64122c3ef10577e20193c19bbcd9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 14 Aug 2023 17:15:42 +0200 Subject: [PATCH] various (untested) improvements --- README.md | 33 ++++++++++++++++++++++++++++++--- disk-configs/simple-efi.nix | 20 ++++++++++++-------- flake.nix | 8 ++++++-- 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1e78bb8..b7f459a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,37 @@ -this is an example repo for nixos-anywhere and disko. -to run the interactive vm test run: +# disko + nixos-anywhere workshop + +This is an example repo for nixos-anywhere and disko. +It's part of our CCC camp workshop. + +To run the interactive vm test run: + ``` nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test ``` -you can also install the vm on some remote system when running +You can also install the vm on some remote system when running + ``` nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10 ``` + + +Improve this workshop README: + +# disko + nixos-anywhere workshop + +This is an example repo for nixos-anywhere and disko. +It's part of our CCC camp workshop. + +To run the interactive vm test run: + +``` +nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test +``` + +You can also install the vm on some remote system when running + +``` +nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10 +``` + diff --git a/disk-configs/simple-efi.nix b/disk-configs/simple-efi.nix index f19c758..d890f7e 100644 --- a/disk-configs/simple-efi.nix +++ b/disk-configs/simple-efi.nix @@ -1,19 +1,23 @@ # Example to create a bios compatible gpt partition -{ lib, ... }: { +{ lib, config, ... }: { disko.devices.disk = { one = { + # Change this device name match your block device. + # The `lsblk` command can help you here device = lib.mkDefault "/dev/sda"; type = "disk"; content = { type = "gpt"; - partitions = { - boot = { - name = "boot"; - size = "1M"; - type = "EF02"; - }; + partitions = lib.optionalAttrs config.boot.loader.grub.enable + { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + } // { ESP = { - size = "100M"; + size = "500M"; type = "EF00"; content = { type = "filesystem"; diff --git a/flake.nix b/flake.nix index cf7a6c3..b850cb2 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { - inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - inputs.disko.url = github:nix-community/disko/make-disk-image; + inputs.disko.url = "github:nix-community/disko"; inputs.disko.inputs.nixpkgs.follows = "nixpkgs"; inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere"; @@ -26,6 +26,10 @@ efiSupport = true; efiInstallAsRemovable = true; }; + # Alternative to grub + #boot.loader.systemd-boot.enable = true; + # when installing toggle this + #boot.loader.efi.canTouchEfiVariables = false; } ]; };