diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-11-02 19:55:32 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-11-05 22:47:43 +0100 |
| commit | 83f0daa6c54c26ad240c46722d3ad84f853f517a (patch) | |
| tree | 64ea00623691af7ba27d36a8bb3d0faa9a67096f /modules/by-name/ba/backup/module.nix | |
| parent | pkgs/*: Use a `stable`/`unstable` marker in the filename (diff) | |
| download | nixos-config-83f0daa6c54c26ad240c46722d3ad84f853f517a.zip | |
modules/*: Fix various name mistakes and other issues
Diffstat (limited to '')
| -rw-r--r-- | modules/by-name/ba/backup/module.nix | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/modules/by-name/ba/backup/module.nix b/modules/by-name/ba/backup/module.nix index ca7a469c..7ac6e081 100644 --- a/modules/by-name/ba/backup/module.nix +++ b/modules/by-name/ba/backup/module.nix @@ -113,10 +113,31 @@ in { }; }; - vhack.programs.ssh = lib.mkIf cfg.storagebox.enable { - enable = true; - rootKnownHosts = { - "[${cfg.storagebox.user}.your-storagebox.de]:23" = cfg.storagebox.sshHostKey; + systemd.tmpfiles.settings = lib.mkIf cfg.storagebox.enable { + "10-backup-module" = { + "/root/.ssh/config".f = let + knownHostsFile = pkgs.writeTextFile { + name = "known-hosts-file"; + text = '' + [${cfg.storagebox.user}.your-storagebox.de]:23 ${cfg.storagebox.sshHostKey} + ''; + }; + in { + group = "root"; + user = "root"; + mode = "0755"; + + # Don't try to authenticate via password for these, because we need to use the + # forced commands, and they are only provided via the ssh key login. + # So password login is a footgun (it is, however, valid to use it for non-root + # use-cases) + argument = '' + Host *.your-storagebox.de + PasswordAuthentication no + Port 23 + UserKnownHostsFile ${knownHostsFile} + ''; + }; }; }; |
