mirror of
https://github.com/nix-community/disko
synced 2024-11-10 14:24:27 +00:00
commit
1af856886e
1 changed files with 45 additions and 38 deletions
83
README.md
83
README.md
|
@ -10,6 +10,31 @@ Master Boot Record
|
||||||
------------------
|
------------------
|
||||||
This is how your iso configuation may look like
|
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
|
```nix
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
|
@ -23,49 +48,31 @@ in {
|
||||||
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
|
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
|
||||||
];
|
];
|
||||||
environment.systemPackages = with pkgs;[
|
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))
|
(pkgs.writeScriptBin "tsp-mount" (disko.mount cfg))
|
||||||
];
|
];
|
||||||
# Optional: Automatically creates a service which runs at startup to perform the partitioning
|
## Optional: Automatically creates a service which runs at startup to perform the partitioning
|
||||||
systemd.services.install-to-hd = {
|
#systemd.services.install-to-hd = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
wantedBy = ["multi-user.target"];
|
# wantedBy = ["multi-user.target"];
|
||||||
after = ["getty@tty1.service" ];
|
# after = ["getty@tty1.service" ];
|
||||||
serviceConfig = {
|
# serviceConfig = {
|
||||||
Type = "oneshot";
|
# Type = "oneshot";
|
||||||
ExecStart = [ (disko.create cfg) (disk.mount cfg) ];
|
# ExecStart = [ (disko.create cfg) (disk.mount cfg) ];
|
||||||
StandardInput = "null";
|
# StandardInput = "null";
|
||||||
StandardOutput = "journal+console";
|
# StandardOutput = "journal+console";
|
||||||
StandardError = "inherit";
|
# 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": "/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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
|
GUID Partition Table, LVM and dm-crypt
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
See `examples/`
|
See `examples/`
|
||||||
|
|
Loading…
Reference in a new issue