indention of the text
This commit is contained in:
parent
2734ea30e9
commit
40b97e47ba
|
@ -104,7 +104,7 @@ it is a library you use to write executables which do the actual deployment.
|
||||||
|
|
||||||
Let's say you have a very simple `configuration.nix`
|
Let's say you have a very simple `configuration.nix`
|
||||||
|
|
||||||
```
|
```nix
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ pkgs.git ];
|
environment.systemPackages = [ pkgs.git ];
|
||||||
|
@ -114,13 +114,11 @@ Let's say you have a very simple `configuration.nix`
|
||||||
Than you can use the following script (let's name it `krops.nix`) to deploy it
|
Than you can use the following script (let's name it `krops.nix`) to deploy it
|
||||||
on the machine `server01.mydomain.org`.
|
on the machine `server01.mydomain.org`.
|
||||||
|
|
||||||
```
|
```nix
|
||||||
let
|
let
|
||||||
|
|
||||||
krops = builtins.fetchGit {
|
krops = builtins.fetchGit {
|
||||||
url = "https://cgit.krebsco.de/krops/";
|
url = "https://cgit.krebsco.de/krops/";
|
||||||
};
|
};
|
||||||
|
|
||||||
lib = import "${krops}/lib";
|
lib = import "${krops}/lib";
|
||||||
pkgs = import "${krops}/pkgs" {};
|
pkgs = import "${krops}/pkgs" {};
|
||||||
|
|
||||||
|
@ -130,24 +128,21 @@ source = lib.evalSource [
|
||||||
ref = "nixos-18.03";
|
ref = "nixos-18.03";
|
||||||
url = https://github.com/NixOS/nixpkgs-channels;
|
url = https://github.com/NixOS/nixpkgs-channels;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixos-config.file = toString ./configuration.nix;
|
nixos-config.file = toString ./configuration.nix;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
in {
|
||||||
server01 = pkgs.krops.writeDeploy "deploy-server01" {
|
server01 = pkgs.krops.writeDeploy "deploy-server01" {
|
||||||
source = source;
|
source = source;
|
||||||
target = "root@server01.mydomain.org";
|
target = "root@server01.mydomain.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
|
||||||
|
|
||||||
server01 = server01;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you can deploy the machine by running:
|
Now you can deploy the machine by running:
|
||||||
```
|
|
||||||
|
```shell
|
||||||
$> nix-build ./krops.nix -A server01 && result
|
$> nix-build ./krops.nix -A server01 && result
|
||||||
```
|
```
|
||||||
You need to make sure you have ssh access to the root user on `server01.mydomain.org`
|
You need to make sure you have ssh access to the root user on `server01.mydomain.org`
|
||||||
|
|
Loading…
Reference in a new issue