Skip to content

Commit b98b201

Browse files
fricklerhandwerkmergify[bot]
authored andcommitted
make a working example
1 parent 6d9266f commit b98b201

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

docs/howtos/use-without-flakes.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,29 @@ in your NixOS configuration and define disko devices as described in the
66
[examples](https://github.com/nix-community/disko/tree/master/example).
77

88
Let's assume that your NixOS configuration lives in `configuration.nix` and your
9-
target machine is called `machine`.
9+
target machine is called `machine`:
1010

1111
```nix
1212
# configuration.nix
1313
{
14-
pkgs ? import (fetchTarball channel:nixos-24.05) {};
14+
sources ? {
15+
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05";
16+
disko = fetchTarball "https://github.com/nix-community/disko/tarball/v1.6.1";
17+
},
18+
system ? builtins.currentSystem,
19+
pkgs ? import sources.nixpkgs { inherit system; config = {}; overlays = []; },
1520
}:
16-
{
17-
config = { config, pkgs, ... }: { /* ... */ };
21+
rec {
1822
machine = pkgs.nixos config;
23+
config = { config, pkgs, ... }: {
24+
system.stateVersion = "24.05";
25+
imports = [
26+
"${sources.disko}/module.nix"
27+
"${sources.disko}/example/hybrid.nix"
28+
];
29+
disko.devices.disk.main.device = "/dev/sda";
30+
boot.loader.systemd-boot.enable = true;
31+
};
1932
}
2033
```
2134

0 commit comments

Comments
 (0)