indention of the text

This commit is contained in:
Ingolf Wagner 2018-09-30 09:12:03 +02:00
parent 2734ea30e9
commit 40b97e47ba

View file

@ -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,40 +114,35 @@ 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 {
url = "https://cgit.krebsco.de/krops/";
};
lib = import "${krops}/lib";
pkgs = import "${krops}/pkgs" {};
krops = builtins.fetchGit { source = lib.evalSource [
url = "https://cgit.krebsco.de/krops/"; {
}; nixpkgs.git = {
ref = "nixos-18.03";
url = https://github.com/NixOS/nixpkgs-channels;
};
nixos-config.file = toString ./configuration.nix;
}
];
lib = import "${krops}/lib"; in {
pkgs = import "${krops}/pkgs" {}; server01 = pkgs.krops.writeDeploy "deploy-server01" {
source = source;
source = lib.evalSource [ target = "root@server01.mydomain.org";
{ };
nixpkgs.git = {
ref = "nixos-18.03";
url = https://github.com/NixOS/nixpkgs-channels;
};
nixos-config.file = toString ./configuration.nix;
} }
];
server01 = pkgs.krops.writeDeploy "deploy-server01" {
source = source;
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`