2023-02-07 15:56:08 +00:00
|
|
|
{ pkgs
|
|
|
|
, lib
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
2022-09-04 11:09:10 +00:00
|
|
|
# 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;
|
|
|
|
#};
|
2023-03-03 07:09:13 +00:00
|
|
|
cfg.disko.devices = {
|
2022-09-04 11:09:10 +00:00
|
|
|
disk = {
|
2022-08-19 07:47:39 +00:00
|
|
|
sda = {
|
2022-09-04 11:09:10 +00:00
|
|
|
device = "/dev/sda";
|
2023-01-15 15:36:59 +00:00
|
|
|
type = "disk";
|
2022-09-04 11:09:10 +00:00
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "msdos";
|
|
|
|
partitions = [
|
|
|
|
{
|
|
|
|
name = "root";
|
|
|
|
part-type = "primary";
|
|
|
|
start = "1M";
|
|
|
|
end = "100%";
|
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2022-08-19 07:47:39 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-02-07 15:56:08 +00:00
|
|
|
in
|
|
|
|
{
|
2018-09-11 18:42:55 +00:00
|
|
|
imports = [
|
2022-09-13 11:32:28 +00:00
|
|
|
(disko.config cfg)
|
2018-09-11 18:42:55 +00:00
|
|
|
];
|
2022-09-04 11:09:10 +00:00
|
|
|
boot.loader.grub.devices = [ "/dev/sda" ];
|
|
|
|
system.stateVersion = "22.05";
|
|
|
|
environment.systemPackages = with pkgs; [
|
2018-09-11 18:42:55 +00:00
|
|
|
(pkgs.writeScriptBin "tsp-create" (disko.create cfg))
|
|
|
|
(pkgs.writeScriptBin "tsp-mount" (disko.mount cfg))
|
|
|
|
];
|
|
|
|
}
|