diff --git a/doc/.vitepress/config.ts b/doc/.vitepress/config.ts index 5a37c38..5febadc 100644 --- a/doc/.vitepress/config.ts +++ b/doc/.vitepress/config.ts @@ -89,6 +89,7 @@ export default withMermaid( collapsed: false, items: [ { text: "Install wire", link: "/guides/installation" }, + { text: "Migrate to wire", link: "/guides/migrate" }, { text: "Apply your Config", link: "/guides/apply" }, { text: "Use a non-root user", link: "/guides/non-root-user" }, { text: "Target Nodes", link: "/guides/targeting" }, diff --git a/doc/guides/installation.md b/doc/guides/installation.md index 7f7da68..5cbf839 100644 --- a/doc/guides/installation.md +++ b/doc/guides/installation.md @@ -41,6 +41,9 @@ your hive from, sourced from the `stable` branch. With npins you may allow it to use release tags instead of the `stable` branch. +Using npins specifically is not required, you can pin your sources in any way +you'd like, really. + ```sh $ npins add github mrshmllow wire ``` diff --git a/doc/guides/migrate.md b/doc/guides/migrate.md new file mode 100644 index 0000000..a7aaae8 --- /dev/null +++ b/doc/guides/migrate.md @@ -0,0 +1,63 @@ +--- +comment: true +title: Migrate to wire +description: How-to migrate from other tools to wire tool. +--- + +# {{ $frontmatter.title }} + +{{ $frontmatter.description }} + +## From Colmena + +::: tip +You should also follow [installation](/guides/installation) to install the +binary. +::: + +### As a Flake + +```nix [flake.nix] +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + colmena.url = "github:zhaofengli/colmena"; # [!code --] + wire.url = "github:mrshmllow/wire/stable"; # [!code ++] + }; + outputs = + { nixpkgs, colmena, ... }: + { + colmenaHive = colmena.lib.makeHive { # [!code --] + wire = colmena.lib.makeHive { # [!code ++] + # .. + }; + }; +} +``` + +### Non-flake + +::: tip +You should also follow [installation](/guides/installation) to setup +npins and install the binary. +::: + +Unlike colmena, you must call `makeHive` directly even in non-flake hives. + +```nix [hive.nix] +let + sources = import ./npins; + wire = import sources.wire; +in +{ # [!code --] +wire.makeHive { # [!code ++] + + meta.nixpkgs = ; # [!code --] + meta.nixpkgs = import sources.nixpkgs { }; # [!code ++] + + # ... +} +``` + +Replacing `` with a pinned source is optional, but you should +probably use one if you ask me \:)