various (untested) improvements

This commit is contained in:
Jörg Thalheim 2023-08-14 17:15:42 +02:00
parent 2a5b8f2f69
commit c238d26aec
3 changed files with 48 additions and 13 deletions

View File

@ -1,10 +1,37 @@
this is an example repo for nixos-anywhere and disko. # disko + nixos-anywhere workshop
to run the interactive vm test run:
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 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 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
```

View File

@ -1,19 +1,23 @@
# Example to create a bios compatible gpt partition # Example to create a bios compatible gpt partition
{ lib, ... }: { { lib, config, ... }: {
disko.devices.disk = { disko.devices.disk = {
one = { one = {
# Change this device name match your block device.
# The `lsblk` command can help you here
device = lib.mkDefault "/dev/sda"; device = lib.mkDefault "/dev/sda";
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = lib.optionalAttrs config.boot.loader.grub.enable
boot = { {
name = "boot"; boot = {
size = "1M"; name = "boot";
type = "EF02"; size = "1M";
}; type = "EF02";
};
} // {
ESP = { ESP = {
size = "100M"; size = "500M";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";

View File

@ -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.disko.inputs.nixpkgs.follows = "nixpkgs";
inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere"; inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere";
@ -26,6 +26,10 @@
efiSupport = true; efiSupport = true;
efiInstallAsRemovable = true; efiInstallAsRemovable = true;
}; };
# Alternative to grub
#boot.loader.systemd-boot.enable = true;
# when installing toggle this
#boot.loader.efi.canTouchEfiVariables = false;
} }
]; ];
}; };