diff --git a/README.md b/README.md index 439ecd5..27cd3f1 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,31 @@ Master Boot Record ------------------ This is how your iso configuation may look like +/etc/nixos/tsp-disk.json (TODO: find the correct disk) +```json +{ + "type": "devices", + "content": { + "sda": { + "type": "table", + "format": "msdos", + "partitions": [{ + "type": "partition", + "start": "1M", + "end": "100%", + "bootable": true, + "content": { + "type": "filesystem", + "format": "ext4", + "mountpoint": "/" + } + }] + } + } +} +``` + +/etc/nixos/configuration.nix ```nix { pkgs, ... }: let @@ -23,49 +48,31 @@ in { ]; environment.systemPackages = with pkgs;[ - (pkgs.writeScriptBin "tsp-create" (disko.mount cfg)) + (pkgs.writeScriptBin "tsp-create" (disko.create cfg)) (pkgs.writeScriptBin "tsp-mount" (disko.mount cfg)) ]; - # Optional: Automatically creates a service which runs at startup to perform the partitioning - systemd.services.install-to-hd = { - enable = true; - wantedBy = ["multi-user.target"]; - after = ["getty@tty1.service" ]; - serviceConfig = { - Type = "oneshot"; - ExecStart = [ (disko.create cfg) (disk.mount cfg) ]; - StandardInput = "null"; - StandardOutput = "journal+console"; - StandardError = "inherit"; - }; - }; -} -``` -tsp-disk.json (TODO: find the correct disk) -```json -{ - "type": "devices", - "content": { - "sda": { - "type": "table", - "format": "msdos", - "partitions": [ - { "type": "partition", - "start": "1M", - "end": "100%", - "bootable": true, - "content": { - "type": "filesystem", - "format": "ext4", - "mountpoint": "/" - } - } - ] - } - } + ## Optional: Automatically creates a service which runs at startup to perform the partitioning + #systemd.services.install-to-hd = { + # enable = true; + # wantedBy = ["multi-user.target"]; + # after = ["getty@tty1.service" ]; + # serviceConfig = { + # Type = "oneshot"; + # ExecStart = [ (disko.create cfg) (disk.mount cfg) ]; + # StandardInput = "null"; + # StandardOutput = "journal+console"; + # StandardError = "inherit"; + # }; + #}; } ``` +After `nixos-rebuild switch` this will add a `tsp-create` and a `tsp-mount` +command: + +- **tsp-create**: creates & formats the partitions according to `tsp-disk.json` +- **tsp-mount**: mounts the partitions to `/mnt` + GUID Partition Table, LVM and dm-crypt -------------------------------------- See `examples/`