From bcdaaa94ecc8ee89d6d0b2ae68d2dc76efd6e19b Mon Sep 17 00:00:00 2001 From: zimbatm Date: Wed, 21 Dec 2022 19:34:34 +0100 Subject: [PATCH] add minimal docs framework --- docs/SUMMARY.md | 17 ++++++++++ docs/book.toml | 6 ++++ docs/cli.md | 20 ++++++++++++ docs/default.nix | 17 ++++++++++ docs/installation.md | 7 ++++ docs/introduction.md | 7 ++++ flake.nix | 57 ++++++++++++++++++--------------- package.nix => nixos-remote.nix | 0 8 files changed, 105 insertions(+), 26 deletions(-) create mode 100644 docs/SUMMARY.md create mode 100644 docs/book.toml create mode 100644 docs/cli.md create mode 100644 docs/default.nix create mode 100644 docs/installation.md create mode 100644 docs/introduction.md rename package.nix => nixos-remote.nix (100%) diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md new file mode 100644 index 0000000..fae0c82 --- /dev/null +++ b/docs/SUMMARY.md @@ -0,0 +1,17 @@ +# Table of Content + +- [Introduction](./introduction.md) + - [What is nixos-remote?](#) + - [Quickstart](#) + - [Getting Started](#) + - [System Requirements](#) + - [Support Matrix](#) +- [Installation](./installation.md) + - [Bare Metal Platforms](#) + - [Virtualized Platforms](#) + - [Cloud Platforms](#) + - [Local Platforms](#) + - [Single Board Computers](#) +- [Avanced Guides](#) +- [Reference](#) + - [CLI](./cli.md) diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 0000000..f1a7056 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,6 @@ +[book] +authors = [ ] +language = "en" +multilingual = false +src = "." +title = "nixos-remote - install NixOS everywhere" diff --git a/docs/cli.md b/docs/cli.md new file mode 100644 index 0000000..c39d36b --- /dev/null +++ b/docs/cli.md @@ -0,0 +1,20 @@ +# CLI + +``` +Usage: nixos-remote [options] ssh-host + +Options: + +* -f, --flake flake + set the flake to install the system from +* -s, --store-paths + set the store paths to the disko-script and nixos-system directly + if this is give, flake is not needed +* --no-ssh-copy + skip copying ssh-keys to target system +* --kexec url + use another kexec tarball to bootstrap NixOS +* --debug + enable debug output + +``` diff --git a/docs/default.nix b/docs/default.nix new file mode 100644 index 0000000..8c68ae7 --- /dev/null +++ b/docs/default.nix @@ -0,0 +1,17 @@ +{ mdbook, stdenv, writeShellScriptBin }: + +stdenv.mkDerivation { + name = "nixos-remote-docs"; + buildInputs = [ mdbook ]; + src = ./.; + buildPhase = "mdbook build"; + installPhase = '' + mv book $out + ''; + + # > nix run .#docs.serve + passthru.serve = writeShellScriptBin "serve" '' + cd docs + ${mdbook}/bin/mdbook serve + ''; +} diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..bbe2cb5 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,7 @@ +# Installation + +- [Bare Metal Platforms](#) +- [Virtualized Platforms](#) +- [Cloud Platforms](#) +- [Local Platforms](#) +- [Single Board Computers](#) diff --git a/docs/introduction.md b/docs/introduction.md new file mode 100644 index 0000000..2df5ffe --- /dev/null +++ b/docs/introduction.md @@ -0,0 +1,7 @@ +# Introduction + +- [What is nixos-remote?](#) +- [Quickstart](#) +- [Getting Started](#) +- [System Requirements](#) +- [Support Matrix](#) diff --git a/flake.nix b/flake.nix index ad89adc..1eb56b9 100644 --- a/flake.nix +++ b/flake.nix @@ -5,31 +5,36 @@ inputs.disko.url = "github:nix-community/disko/master"; inputs.disko.inputs.nixpkgs.follows = "nixpkgs"; - outputs = { self, disko, nixpkgs, ... }: let - supportedSystems = [ - "x86_64-linux" - "i686-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - in { - packages = forAllSystems (system: let - pkgs = nixpkgs.legacyPackages.${system}; - in { - nixos-remote = pkgs.callPackage ./package.nix {}; - default = self.packages.${system}.nixos-remote; - }); - checks.x86_64-linux = let - pkgs = nixpkgs.legacyPackages.x86_64-linux; - in { - from-nixos = import ./tests/from-nixos.nix { - inherit pkgs; - disko = disko.nixosModules.disko; - makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix"); - eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix"); - }; + outputs = { self, disko, nixpkgs, ... }: + let + supportedSystems = [ + "x86_64-linux" + "i686-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + in + { + packages = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + default = self.packages.${system}.nixos-remote; + docs = pkgs.callPackage ./docs { }; + nixos-remote = pkgs.callPackage ./nixos-remote.nix { }; + }); + checks.x86_64-linux = + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in + { + from-nixos = import ./tests/from-nixos.nix { + inherit pkgs; + disko = disko.nixosModules.disko; + makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix"); + eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix"); + }; + }; }; - }; } diff --git a/package.nix b/nixos-remote.nix similarity index 100% rename from package.nix rename to nixos-remote.nix