From a2a2969828b3349e4f27eb783fd7ab8721aa3f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Tue, 28 May 2024 20:38:00 +0000 Subject: [PATCH] documentation and template fixes --- .reuse/dep5 | 4 ++-- docs/getting-started/deploy.md | 6 ++++++ docs/render.nix | 4 +++- template/.gitignore | 1 + template/flake.nix | 6 +++--- 5 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 template/.gitignore diff --git a/.reuse/dep5 b/.reuse/dep5 index 6f69647..e4bfe79 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -3,10 +3,10 @@ Upstream-Name: cardano.nix Upstream-Contact: Source: https://github.com/mlabs-haskell/cardano.nix -Files: *.lock *.nix *.md *.css docs/mkdocs.yml .envrc .gitignore +Files: *.lock *.nix *.md *.css docs/mkdocs.yml .envrc .gitignore */.gitignore Copyright: © 2023 MLabs LTD License: Apache-2.0 Files: docs/assets/favicon.png docs/assets/logo.svg Copyright: © 2023 MLabs LTD -License: LicenseRef-MLabs \ No newline at end of file +License: LicenseRef-MLabs diff --git a/docs/getting-started/deploy.md b/docs/getting-started/deploy.md index 128b0da..1253d1a 100644 --- a/docs/getting-started/deploy.md +++ b/docs/getting-started/deploy.md @@ -2,6 +2,8 @@ In order to access all the options available in `cardano.nix`, the [NixOS module ### Start new project with flake template +Before starting, follow the [installation instructions](installation.md). + An easy way to get started is to use the [flake template](https://zero-to-nix.com/concepts/flakes#templates) provided by this project. Here's how to start a new project using the template: ``` @@ -18,6 +20,10 @@ The default template provides a virtual machine configuration starting all the s `nix run .#vm` +A virtual machine is started, with `cardano-cli` available to query the node: + +`cardano-cli query tip --testnet-magic 2` + This machine is set up just like the one in [Run a VM](vm.md), but can be customized. ### Look around diff --git a/docs/render.nix b/docs/render.nix index 455758e..f3f24f4 100644 --- a/docs/render.nix +++ b/docs/render.nix @@ -237,6 +237,8 @@ in { ''; }; + packages."${cfg.packageName}-serve" = config.packages.${cfg.packageName}.serve; + devshells.default = { commands = let category = "documentation"; @@ -245,7 +247,7 @@ in { inherit category; name = "docs-serve"; help = "serve documentation web page"; - command = "nix run .#${cfg.packageName}.serve"; + command = "nix run .#${cfg.packageName}-serve"; } { inherit category; diff --git a/template/.gitignore b/template/.gitignore new file mode 100644 index 0000000..b511ae1 --- /dev/null +++ b/template/.gitignore @@ -0,0 +1 @@ +*.qcow2 diff --git a/template/flake.nix b/template/flake.nix index 585cf60..20c6e95 100644 --- a/template/flake.nix +++ b/template/flake.nix @@ -6,7 +6,7 @@ }; outputs = inputs @ {self, ...}: { nixosConfigurations = { - server-vm = inputs.nixpkgs.lib.nixosSystem { + vm = inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ inputs.cardano-nix.nixosModules.default @@ -16,9 +16,9 @@ }; }; apps.x86_64-linux = { - server-vm = { + vm = { type = "app"; - program = "${self.nixosConfigurations.server-vm.config.system.build.vm}/bin/run-nixos-vm"; + program = "${self.nixosConfigurations.vm.config.system.build.vm}/bin/run-nixos-vm"; }; }; };