summaryrefslogtreecommitdiffstats
path: root/example/stand-alone/configuration.nix
diff options
context:
space:
mode:
Diffstat (limited to 'example/stand-alone/configuration.nix')
-rw-r--r--example/stand-alone/configuration.nix55
1 files changed, 46 insertions, 9 deletions
diff --git a/example/stand-alone/configuration.nix b/example/stand-alone/configuration.nix
index 2ee1597..67576a0 100644
--- a/example/stand-alone/configuration.nix
+++ b/example/stand-alone/configuration.nix
@@ -1,17 +1,54 @@
-{ pkgs, ... }:
-let
- disko = (builtins.fetchGit {
- url = https://cgit.lassul.us/disko/;
- rev = "88f56a0b644dd7bfa8438409bea5377adef6aef4";
- }) + "/lib";
- cfg = builtins.fromJSON ./tsp-disk.json;
+{
+ pkgs,
+ lib,
+ ...
+}: let
+ # 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 = {
+ disk = {
+ sda = {
+ device = "/dev/sda";
+ type = "device";
+ content = {
+ type = "table";
+ format = "msdos";
+ partitions = [
+ {
+ name = "root";
+ type = "partition";
+ part-type = "primary";
+ start = "1M";
+ end = "100%";
+ bootable = true;
+ content = {
+ type = "filesystem";
+ format = "ext4";
+ mountpoint = "/";
+ };
+ }
+ ];
+ };
+ };
+ };
+ };
in {
imports = [
(disko.config cfg)
];
- environment.systemPackages = with pkgs;[
+ boot.loader.grub.devices = [ "/dev/sda" ];
+ system.stateVersion = "22.05";
+ environment.systemPackages = with pkgs; [
(pkgs.writeScriptBin "tsp-create" (disko.create cfg))
(pkgs.writeScriptBin "tsp-mount" (disko.mount cfg))
];
}
-