Merge pull request #107 from numtide/developer-guide

Move and improve developer guide
This commit is contained in:
Jörg Thalheim 2023-05-14 14:46:20 +01:00 committed by GitHub
commit fae3915b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 20 deletions

23
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,23 @@
To run `nixos-anywhere` from the repo:
```console
nix run . -- --help
```
To format the code:
```console
nix fmt
```
To run all tests:
```console
nix flake check -vL
```
To run an individual test:
```
nix build .#checks.x86_64-linux.from-nixos -vL
```

View File

@ -187,12 +187,12 @@ Once youve created the disk configuration and the flake, you can run the tool
with a single nix command, which may look like this:
```
nix run github:numtide/nixos-anywhere -- --flake github:JillThornhill/flakes-example#hetzner-cloud root@135.181.254.201
nix run github:numtide/nixos-anywhere -- --flake .#hetzner-cloud root@135.181.254.201
```
Note that this command references the URL of your flake, in this case
github:JillThornhill/flakes-example, together with the name of the system
#hetzner-cloud, as highlighted by the comment in the sample flake.
Note that this command references the URL of your flake, in this case `.#`,
together with the name of the system `hetzner-cloud`, as highlighted by the
comment in the sample flake.
The [Quickstart Guide](./docs/quickstart.md) gives more information on how to
run **nixos-anywhere** in its simplest form. For more specific instructions to

View File

@ -49,20 +49,6 @@ Options:
build the closure on the remote machine instead of locally and copy-closuring it
```
## Developer guide
To run `nixos-anywhere` from the repo:
```shell
nix run . -- --help
```
To format the code
```shell
nix fmt
```
## Explanation of known error messages
TODO: List actual error messages and meanings. Include:

View File

@ -2,9 +2,9 @@ test:
{ pkgs ? import <nixpkgs> { }
, nixos-anywhere ? pkgs.callPackage ../../src { }
, disko ? "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix"
, kexec-installer ? builtins.fetchurl "https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-${pkgs.stdenv.hostPlatform.system}.tar.gz"
, kexec-installer ? builtins.fetchurl "https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-${pkgs.stdenv.hostPlatform.system}.tar.gz"
, ...
}@args:
}:
let
inherit (pkgs) lib;
nixos-lib = import (pkgs.path + "/nixos/lib") { };