mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
Just did the mistake to copy and paste one legacy table type example. Ran into the warning and was a bit sad. Adding these comments while referring to the documentation could help some undercaffeinated disko users like me.
61 lines
1.4 KiB
Nix
61 lines
1.4 KiB
Nix
# This example with the legacy table should not be used. We recommend using the
|
|
# gpt type instead. More information about this warning may be found in the
|
|
# documentation.
|
|
#
|
|
# https://github.com/nix-community/disko/blob/master/docs/table-to-gpt.md
|
|
{
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
# We just import from the repository for testing here:
|
|
disko = import ../../. {
|
|
inherit lib;
|
|
};
|
|
# In your own system use something like this:
|
|
#import (builtins.fetchGit {
|
|
# url = "https://github.com/nix-community/disko";
|
|
# ref = "master";
|
|
#}) {
|
|
# inherit lib;
|
|
#};
|
|
cfg.disko.devices = {
|
|
disk = {
|
|
sda = {
|
|
device = "/dev/sda";
|
|
type = "disk";
|
|
content = {
|
|
type = "table";
|
|
format = "msdos";
|
|
partitions = [
|
|
{
|
|
name = "root";
|
|
part-type = "primary";
|
|
start = "1M";
|
|
end = "100%";
|
|
bootable = true;
|
|
content = {
|
|
type = "filesystem";
|
|
format = "ext4";
|
|
mountpoint = "/";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
imports = [
|
|
(disko.config cfg)
|
|
];
|
|
boot.loader.grub.devices = [ "/dev/sda" ];
|
|
system.stateVersion = "22.05";
|
|
environment.systemPackages = with pkgs; [
|
|
(pkgs.writeScriptBin "tsp-create" (disko.create cfg))
|
|
(pkgs.writeScriptBin "tsp-mount" (disko.mount cfg))
|
|
];
|
|
}
|