mirror of
https://cgit.krebsco.de/krops
synced 2024-11-23 11:39:48 +01:00
README: add more words to the example =)
This commit is contained in:
parent
75e1338628
commit
b922b41fe3
1 changed files with 11 additions and 10 deletions
21
README.md
21
README.md
|
@ -1,20 +1,20 @@
|
||||||
# krops (krebs ops)
|
# krops (krebs ops)
|
||||||
|
|
||||||
krops is a lightweigt toolkit to deploy nixos systems, remotely or locally.
|
krops is a lightweigt toolkit to deploy NixOS systems, remotely or locally.
|
||||||
|
|
||||||
fancy features include:
|
## Some Features
|
||||||
|
|
||||||
- store your secrets in passwordstore
|
- store your secrets in passwordstore
|
||||||
- build your system remotely
|
- build your system remotely
|
||||||
- minimal overhead
|
- minimal overhead (it's basically just `nixos-rebuild switch`!)
|
||||||
- run from custom nixpkgs branch/checkout/fork
|
- run from custom nixpkgs branch/checkout/fork
|
||||||
|
|
||||||
minimal example:
|
## Minimal Example
|
||||||
|
|
||||||
|
Create a file named `krops.nix` (name doesn't matter) with following content:
|
||||||
|
|
||||||
create a krops.nix somewhere
|
|
||||||
```
|
```
|
||||||
let
|
let
|
||||||
#krops = ./.;
|
|
||||||
krops = (import <nixpkgs> {}).fetchgit {
|
krops = (import <nixpkgs> {}).fetchgit {
|
||||||
url = https://cgit.krebsco.de/krops/;
|
url = https://cgit.krebsco.de/krops/;
|
||||||
rev = "3022582ade8049e6ccf18f358cedb996d6716945";
|
rev = "3022582ade8049e6ccf18f358cedb996d6716945";
|
||||||
|
@ -28,11 +28,9 @@ let
|
||||||
nixpkgs.git = {
|
nixpkgs.git = {
|
||||||
ref = "4b4bbce199d3b3a8001ee93495604289b01aaad3";
|
ref = "4b4bbce199d3b3a8001ee93495604289b01aaad3";
|
||||||
url = https://github.com/NixOS/nixpkgs;
|
url = https://github.com/NixOS/nixpkgs;
|
||||||
|
|
||||||
};
|
};
|
||||||
nixos-config.file = toString (pkgs.writeText "nixos-config" ''
|
nixos-config.file = toString (pkgs.writeText "nixos-config" ''
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
fileSystems."/" = { device = "/dev/sda1"; };
|
fileSystems."/" = { device = "/dev/sda1"; };
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
@ -47,8 +45,11 @@ in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
and run `$(nix-build krops.nix)`. This results in a script which deploys the machine via ssh & rsync on the target machine.
|
and run `$(nix-build --no-out-link krops.nix)` to deploy the target machine.
|
||||||
|
|
||||||
|
Under the hood, this will make the sources available on the target machine
|
||||||
|
below `/var/src`, and execute `nixos-rebuild switch -I /var/src`.
|
||||||
|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
- [Blog post with in-depth example](http://tech.ingolf-wagner.de/nixos/krops/) by [Ingolf Wagner](https://ingolf-wagner.de/)
|
- [In-depth example](http://tech.ingolf-wagner.de/nixos/krops/) by [Ingolf Wagner](https://ingolf-wagner.de/)
|
||||||
|
|
Loading…
Reference in a new issue