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`
|
||||
|
||||
```
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
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
|
||||
on the machine `server01.mydomain.org`.
|
||||
|
||||
```
|
||||
```nix
|
||||
let
|
||||
krops = builtins.fetchGit {
|
||||
url = "https://cgit.krebsco.de/krops/";
|
||||
};
|
||||
lib = import "${krops}/lib";
|
||||
pkgs = import "${krops}/pkgs" {};
|
||||
|
||||
krops = builtins.fetchGit {
|
||||
url = "https://cgit.krebsco.de/krops/";
|
||||
};
|
||||
source = lib.evalSource [
|
||||
{
|
||||
nixpkgs.git = {
|
||||
ref = "nixos-18.03";
|
||||
url = https://github.com/NixOS/nixpkgs-channels;
|
||||
};
|
||||
nixos-config.file = toString ./configuration.nix;
|
||||
}
|
||||
];
|
||||
|
||||
lib = import "${krops}/lib";
|
||||
pkgs = import "${krops}/pkgs" {};
|
||||
|
||||
source = lib.evalSource [
|
||||
{
|
||||
nixpkgs.git = {
|
||||
ref = "nixos-18.03";
|
||||
url = https://github.com/NixOS/nixpkgs-channels;
|
||||
};
|
||||
|
||||
nixos-config.file = toString ./configuration.nix;
|
||||
in {
|
||||
server01 = pkgs.krops.writeDeploy "deploy-server01" {
|
||||
source = source;
|
||||
target = "root@server01.mydomain.org";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
server01 = pkgs.krops.writeDeploy "deploy-server01" {
|
||||
source = source;
|
||||
target = "root@server01.mydomain.org";
|
||||
};
|
||||
|
||||
in {
|
||||
|
||||
server01 = server01;
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
Now you can deploy the machine by running:
|
||||
```
|
||||
|
||||
```shell
|
||||
$> nix-build ./krops.nix -A server01 && result
|
||||
```
|
||||
You need to make sure you have ssh access to the root user on `server01.mydomain.org`
|
||||
|
|
Loading…
Reference in a new issue