summaryrefslogtreecommitdiffstats
path: root/example/stand-alone
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2022-09-04 13:09:10 +0200
committerJörg Thalheim <joerg@thalheim.io>2022-09-04 13:09:10 +0200
commit68f950bf2045573b03cd0e1ceebe7131ea999873 (patch)
treecba2f7972cb82ff445e68383a46927c8a25ec763 /example/stand-alone
parent65bd5a97f8dddaa6710df085cfd643d8eefead38 (diff)
add test for standalone nixos config
Diffstat (limited to 'example/stand-alone')
-rw-r--r--example/stand-alone/configuration.nix69
1 files changed, 44 insertions, 25 deletions
diff --git a/example/stand-alone/configuration.nix b/example/stand-alone/configuration.nix
index 2a15c32..600f6f9 100644
--- a/example/stand-alone/configuration.nix
+++ b/example/stand-alone/configuration.nix
@@ -1,39 +1,58 @@
-{ pkgs, lib, ... }:
-let
- disko = import (builtins.fetchGit {
- url = "https://github.com/nix-community/disko";
- ref = "master";
- }) {
+{
+ pkgs,
+ lib,
+ ...
+}: let
+ # We just import from the repository for testing here:
+ diskoNixos = import ../../. {
inherit lib;
};
+ disko = import ../../. {
+ inherit lib;
+ inherit pkgs;
+ };
+ # In your own system use something like this:
+ #import (builtins.fetchGit {
+ # url = "https://github.com/nix-community/disko";
+ # ref = "master";
+ #}) {
+ # inherit lib;
+ #};
cfg = {
- type = "devices";
- content = {
+ disk = {
sda = {
- type = "table";
- format = "msdos";
- partitions = [{
- type = "partition";
- part-type = "primary";
- start = "1M";
- end = "100%";
- bootable = true;
- content = {
- type = "filesystem";
- format = "ext4";
- mountpoint = "/";
- };
- }];
+ 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)
+ (diskoNixos.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))
];
}
-