summaryrefslogtreecommitdiffstats
path: root/modules/by-name/op
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-31 10:21:40 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-31 10:21:40 +0100
commit2ccbdd3242dd58df81de738a3c538cf68ba51c95 (patch)
tree3d3c6cad924e73d9a498ca6039643534858389eb /modules/by-name/op
parent{modules,treefmt}: Align last files with the server repository (diff)
downloadnixos-config-2ccbdd3242dd58df81de738a3c538cf68ba51c95.zip
treewide: Align modules with server directory
Diffstat (limited to 'modules/by-name/op')
-rw-r--r--modules/by-name/op/openssh/module.nix57
1 files changed, 37 insertions, 20 deletions
diff --git a/modules/by-name/op/openssh/module.nix b/modules/by-name/op/openssh/module.nix
index f77c357b..3182f7ba 100644
--- a/modules/by-name/op/openssh/module.nix
+++ b/modules/by-name/op/openssh/module.nix
@@ -1,42 +1,59 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
config,
lib,
libraries,
...
}: let
- cfg = config.soispha.services.openssh;
+ cfg = config.vhack.openssh;
in {
- options.soispha.services.openssh = {
+ options.vhack.openssh = {
enable = libraries.base.options.mkEnable "openssh";
};
config = lib.mkIf cfg.enable {
+ /*
+ FIXME(@bpeetz):
+ This results in a boot error, as the `/var/lib/sshd` directory
+ is only mounted _after_ the stage 2 init and with it the system
+ activation. `agenix` needs the sshd hostkey however to decrypt the
+ secrets and thus we have to ensure that this directory is mounted
+ _before_ the system activation. Alas the only way I see to achieve
+ that is to store the ssh hostkey directly on /srv, which is mounted
+ before (it's marked as 'neededForBoot' after all).
+
+ It should be possible to achieve this with impermanence however,
+ as `/var/log` is mounted in the stage 1 init; The problem is that
+ I have no idea _why_ only this is mounted and nothing else.
+
+
+ vhack.persist.directories = [
+ {
+ directory = "/var/lib/sshd";
+ user = "root";
+ group = "root";
+ mode = "0755";
+ }
+ ];
+ */
+
+ users = {
+ users.sshd.uid = config.vhack.constants.ids.uids.sshd;
+ groups.sshd.gid = config.vhack.constants.ids.gids.sshd;
+ };
+
services.openssh = {
enable = true;
+ settings.PasswordAuthentication = false;
hostKeys = [
{
- path = "/srv/sshd/ssh_host_ed25519_key";
+ # FIXME: Remove the dependency on `/srv` this workaround.
+ # See the explanation for using `/srv` above.
+ path = "/srv/var/lib/sshd/ssh_host_ed25519_key";
+
rounds = 1000;
type = "ed25519";
}
];
-
- settings = {
- PasswordAuthentication = false;
- };
- };
- users = {
- users.sshd.uid = config.soispha.constants.ids.uids.sshd;
- groups.sshd.gid = config.soispha.constants.ids.gids.sshd;
};
};
}