disko/example/stand-alone/configuration.nix

55 lines
1.2 KiB
Nix
Raw Normal View History

{ 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;
#};
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";
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
};
};
};
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))
];
}