mirror of
https://github.com/nix-community/disko.git
synced 2024-11-12 18:15:46 +03:00
{example,tests}: add hybrid-tmpfs-on-root
This commit is contained in:
parent
d3bbbfe4f4
commit
3e0b4ddd3b
52
example/hybrid-tmpfs-on-root.nix
Normal file
52
example/hybrid-tmpfs-on-root.nix
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{ disks ? [ "/dev/sda" ], ... }:
|
||||||
|
{
|
||||||
|
disk.main = {
|
||||||
|
device = builtins.elemAt disks 0;
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [
|
||||||
|
{
|
||||||
|
name = "boot";
|
||||||
|
type = "partition";
|
||||||
|
start = "0";
|
||||||
|
end = "1M";
|
||||||
|
flags = [ "bios_grub" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "partition";
|
||||||
|
name = "ESP";
|
||||||
|
start = "1M";
|
||||||
|
end = "512M";
|
||||||
|
bootable = true;
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "nix";
|
||||||
|
type = "partition";
|
||||||
|
start = "512M";
|
||||||
|
end = "100%";
|
||||||
|
part-type = "primary";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nodev."/" = {
|
||||||
|
fsType = "tmpfs";
|
||||||
|
mountOptions = [
|
||||||
|
"size=2G"
|
||||||
|
"defaults"
|
||||||
|
"mode=755"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
10
tests/hybrid-tmpfs-on-root.nix
Normal file
10
tests/hybrid-tmpfs-on-root.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs ? (import <nixpkgs> { })
|
||||||
|
, makeDiskoTest ? (pkgs.callPackage ./lib.nix { }).makeDiskoTest
|
||||||
|
}:
|
||||||
|
makeDiskoTest {
|
||||||
|
disko-config = ../example/hybrid-tmpfs-on-root.nix;
|
||||||
|
extraTestScript = ''
|
||||||
|
machine.succeed("mountpoint /");
|
||||||
|
machine.succeed("findmnt / --types tmpfs");
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user