disko/example/stand-alone/configuration.nix

40 lines
809 B
Nix
Raw Normal View History

2022-08-19 09:47:39 +02:00
{ pkgs, lib, ... }:
2018-09-11 20:42:55 +02:00
let
2022-08-19 09:47:39 +02:00
disko = import (builtins.fetchGit {
url = "https://github.com/nix-community/disko";
ref = "master";
}) {
inherit lib;
};
cfg = {
type = "devices";
content = {
sda = {
type = "table";
format = "msdos";
partitions = [{
type = "partition";
part-type = "primary";
start = "1M";
end = "100%";
bootable = true;
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
}];
};
};
};
2018-09-11 20:42:55 +02:00
in {
imports = [
(disko.config cfg)
];
environment.systemPackages = with pkgs;[
(pkgs.writeScriptBin "tsp-create" (disko.create cfg))
(pkgs.writeScriptBin "tsp-mount" (disko.mount cfg))
];
}