Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion configurations/preview.nix

This file was deleted.

7 changes: 7 additions & 0 deletions configurations/preview.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
cardano = {
network = "preview";
node.enable = true;
ogmios.enable = true;
};
}
16 changes: 7 additions & 9 deletions docs/getting-started/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ An easy way to get started is to use the [flake template](https://zero-to-nix.co
mkdir myproject
cd myproject
nix flake init --template github:mlabs-haskell/cardano.nix
git init
git add .
```

### Run a virtual machine
Expand All @@ -30,22 +28,22 @@ This machine is set up just like the one in [Run a VM](vm.md), but can be custom

#### `flake.nix`

This [Nix Flake](https://zero-to-nix.com/concepts/flakes) is the entry point to the project. It locks inputs and provides the following inputs:
This [Nix Flake](https://zero-to-nix.com/concepts/flakes) is the entry point to the project. It locks inputs and provides the following outputs:

- a NixOS configuration for the virtual machine, under `nixosConfigurations.server-vm`
- an app to run the virtual machine as above, under `apps.x86_64-linux.server-vm`
- a NixOS configuration for the virtual machine, under `nixosConfigurations.vm`
- an app to run the virtual machine as above, under `apps.x86_64-linux.vm`

#### `preview.nix`
#### `configuration.nix`

This is the [NixOS configuration](https://zero-to-nix.com/concepts/nixos#configuration) to run cardano services for the machine.
This is the [NixOS configuration](https://zero-to-nix.com/concepts/nixos#configuration) to run cardano services on the machine.

#### `vm.nix`

This NixOS configuration sets virtual machine options such as cores, memory and port forwarding. It is included in the configuration for the `nixosConfigurations.server-vm` virtual machine in `flake.nix`.
Local VM configuration for convenient development. Don't use this in the cloud, it is insecure with an empty root password. Sets virtual machine options such as cores, memory and port forwarding. It is included in the configuration for the `nixosConfigurations.vm` virtual machine in `flake.nix`.

### Customize

To learn more, browse available [NixOS options in nixpkgs](https://search.nixos.org/options) and [NixOS options provided by cardano.nix](../reference/module-options/cardano.md) (see other modules in the menu on the left). You can ad these options to `preview.nix` to configure the system.
To learn more, browse available [NixOS options in nixpkgs](https://search.nixos.org/options) and [NixOS options provided by cardano.nix](../reference/module-options/cardano.md) (see other modules in the menu on the left). You can ad these options to `configuration.nix` to configure the system.

### Deployment options

Expand Down
File renamed without changes.
10 changes: 9 additions & 1 deletion templates/default/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@
system = "x86_64-linux";
modules = [
inputs.cardano-nix.nixosModules.default
./preview.nix
./configuration.nix
./vm.nix
];
};
server = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
inputs.cardano-nix.nixosModules.default
./configuration.nix
# add server configuraition here
];
};
};
apps.x86_64-linux = {
vm = {
Expand Down