diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/config-gpt-bios.nix | 33 | ||||
-rw-r--r-- | example/config.nix | 1 | ||||
-rw-r--r-- | example/default.nix | 8 |
3 files changed, 39 insertions, 3 deletions
diff --git a/example/config-gpt-bios.nix b/example/config-gpt-bios.nix new file mode 100644 index 0000000..9dfcffa --- /dev/null +++ b/example/config-gpt-bios.nix @@ -0,0 +1,33 @@ +# Example to create a bios compatible gpt partition +{ + type = "devices"; + content = { + sda = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + start = "0"; + end = "1M"; + part-type = "primary"; + flags = ["bios_grub"]; + content.type = "noop"; + } + { + type = "partition"; + # leave space for the grub aka BIOS boot + start = "1M"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; +} diff --git a/example/config.nix b/example/config.nix index 199412d..1a64b1c 100644 --- a/example/config.nix +++ b/example/config.nix @@ -24,6 +24,7 @@ part-type = "primary"; start = "1024MiB"; end = "100%"; + flags = [ "bios_grub" ]; content = { type = "luks"; algo = "aes-xts..."; diff --git a/example/default.nix b/example/default.nix index f2826c9..bf8cd43 100644 --- a/example/default.nix +++ b/example/default.nix @@ -3,11 +3,13 @@ let # TODO: get rid of NIX_PATH dependency here pkgs = import <nixpkgs> {}; + cfg = import ./config.nix; + #cfg = import ./config-gpt-bios.nix; in with import ../lib { inherit (pkgs) lib;}; { - config = config (import ./config.nix); - create = create (import ./config.nix); - mount = mount (import ./config.nix); + config = config cfg; + create = create cfg; + mount = mount cfg; } |