Deployment tool #5

Closed
opened 2020-12-04 18:11:04 +01:00 by simon · 1 comment

To address #4 (and to some extent #2), I should use a deployment tool.

It has to support the following:

  • Secrets with pass (place them under /var/secrets with configurable permissions; see #4)
  • Pinning nixpkgs (ideally with flakes (see #3))
  • Local and remote activation
  • Optional: Support for system.autoUpgrade (optional since this breaks reproducibility)

Possible deployment tools

NixOps

Advantages

  • Support for secrets (with pass support when using pass branch)
  • Flake support
  • Can deploy locally with localhost as host

Disadvantages

  • Does not update channel (not needed anymore when using flakes; #3)
  • Uses nixpkgs from $NIX_PATH (also not a problem anymore when using flakes; #3)
  • Adds more complexity (e.g. deployments)
  • Makes things that rely on /etc/nixos/configuration.nix (e.g. system.autoUpgrade) not work
  • State

Krops

Advantages

  • Fairly simple (runs a shell script that uses rsync, ssh and nixos-rebuild)
  • Native support for pass (no need for hacks)
  • No state

Disadvantages

  • Does not stop rebuild when ^Cing script
  • Strictly evals on the target (so it only copies configuration.nix and not dependent files)

Morph

Advantages

  • Native support for secrets (including advanced permission management)
  • No state

Disadvantages

  • Only supports secrets from files, not from a variable or pass
  • Seems to ignore nixpkgs config in configuration.nix (alternative: Create file that builds nixpkgs with all overlays and specific config)

Plan

Krops looks most promising (supports secrets with pass, pinning nixpkgs, activation on every ssh enabled host and optionally system.autoUpgrade). The only caveat is, that it has no interal ability to set the permissions of secrets. This, however can be circumvented by using system.activationScripts or a systemd unit (see https://github.com/krebs/krops/issues/4 for more examples).

Even without permissions, krops is better than the current situation, since that means every machine knows every secret.

To address #4 (and to some extent #2), I should use a deployment tool. It has to support the following: * Secrets with `pass` (place them under `/var/secrets` with configurable permissions; see #4) * Pinning `nixpkgs` (ideally with flakes (see #3)) * Local and remote activation * Optional: Support for `system.autoUpgrade` (optional since this breaks reproducibility) ## Possible deployment tools ### NixOps #### Advantages * Support for secrets (with pass support when using [`pass` branch](https://git.sbruder.de/simon/nixos-config/src/branch/pass)) * Flake support * Can deploy locally with `localhost` as host #### Disadvantages * Does not update channel (not needed anymore when using flakes; #3) * Uses nixpkgs from $NIX_PATH (also not a problem anymore when using flakes; #3) * Adds more complexity (e.g. deployments) * Makes things that rely on `/etc/nixos/configuration.nix` (e.g. `system.autoUpgrade`) not work * State ### Krops #### Advantages * Fairly simple (runs a shell script that uses `rsync`, `ssh` and `nixos-rebuild`) * Native support for `pass` (no need for hacks) * No state #### Disadvantages * Does not stop rebuild when `^C`ing script * Strictly evals on the target (so it only copies `configuration.nix` and not dependent files) ### Morph #### Advantages * Native support for secrets (including advanced permission management) * No state #### Disadvantages * Only supports secrets from files, not from a variable or `pass` * Seems to ignore nixpkgs config in `configuration.nix` (alternative: Create file that builds nixpkgs with all overlays and specific config) ## Plan Krops looks most promising (supports secrets with `pass`, pinning nixpkgs, activation on every ssh enabled host and optionally `system.autoUpgrade`). The only caveat is, that it has no interal ability to set the permissions of secrets. This, however can be circumvented by using `system.activationScripts` or a systemd unit (see https://github.com/krebs/krops/issues/4 for more examples). Even without permissions, krops is better than the current situation, since that means every machine knows every secret.
simon added a new dependency 2020-12-04 20:26:34 +01:00
simon added the
affects/style
affects/reproducibility
labels 2020-12-04 20:31:13 +01:00
simon added this to the Reproducible milestone 2020-12-05 23:10:31 +01:00
simon removed a dependency 2020-12-10 22:52:43 +01:00
Poster
Owner

Fixed in f53b777a7e

Fixed in f53b777a7e6a618b482ed8b2fa6d39c8d4f7d003
simon closed this issue 2020-12-12 16:17:49 +01:00
simon added the
type
feature
label 2021-01-31 22:38:35 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: simon/nixos-config#5
There is no content yet.