1
0
Fork 0
mirror of https://cgit.krebsco.de/krops synced 2024-12-23 10:19:52 +01:00
Mirror of Krops
Find a file
2018-05-01 15:56:49 +02:00
lib import stockholm's deployment tools 2018-02-28 21:02:21 +01:00
pkgs populate: support rsyncing files 2018-04-24 19:54:01 +02:00
README.md init README.md 2018-05-01 15:56:49 +02:00

kops (krebs ops)

kops is a lightweigt toolkit to deploy nixos systems, remotely or locally.

fancy features include:

  • store your secrets in passwordstore
  • build your system remotely
  • minimal overhead
  • run from custom nixpkgs branch/checkout/fork

minimal example:

create a kops.nix somewhere

let
  kops = (import <nixpkgs> {}).fetchgit {
    url = https://cgit.krebsco.de/kops/;
    rev = "3022582ade8049e6ccf18f358cedb996d6716945";
    sha256 = "0wg8d80sxa46z4i7ir79sci2hwmv3qskzqdgksi64p6vazy8vckb";
  };

  lib = import "${kops}/lib";
  pkgs = import "${kops}/pkgs" {};

  source = lib.evalSource [{
    nixpkgs.git = {
      ref = "4b4bbce199d3b3a8001ee93495604289b01aaad3";
      url = https://github.com/NixOS/nixpkgs;
    };
    nixos-config.file = pkgs.writeText "nixos-config" ''
      { config, pkgs, ... }:
      {
        imports =
          [ # Include the results of the hardware scan.
            ./hardware-configuration.nix
          ];

        # Use the GRUB 2 boot loader.
        boot.loader.grub.enable = true;
        boot.loader.grub.version = 2;
        # boot.loader.grub.efiSupport = true;
        # boot.loader.grub.efiInstallAsRemovable = true;
        # boot.loader.efi.efiSysMountPoint = "/boot/efi";
        # Define on which hard drive you want to install Grub.
        boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
      }
    '';
  }];
in
  pkgs.kops.writeDeploy "deploy" {
    source = source;
    target = "localhost";
  }

and run nix-build kops.nix