nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.09k stars 80 forks source link

/nix/store/[hash]-sshd.conf-validated line 59: Subsystem 'sftp' already defined, and `sshd_config' not being created #90

Open shadowrylander opened 2 years ago

shadowrylander commented 2 years ago

Hello! I do sincerely apologize for all these issues! 😭

With the following:

{ config, ... }:
{
    services.openssh = {
        enable = true;
        extraConfig = mkOrder 0 ''
            TCPKeepAlive yes
            ClientAliveCountMax 480
            ClientAliveInterval 3m
        '';
        permitRootLogin = "yes";
    };
    environment.persistence."/persist".directories = [ "/etc/ssh" ];
}

I get the errors in the issue title. While the first is resolved with allowSFTP = false;, the sshd_config file itself is still prevented from being created, and I'd still like to use sftp. I still want the /etc/ssh directory to persist in case I create any manually controlled files down the line. Could you give any insight into what might be happening?

Thank you kindly for all the help, and again, I do sincerely apologize for taking up so much of your time!

shadowrylander commented 2 years ago

I believe I may have solved the first issue, but the second issue persists; what seems to be happening is that the config is being created, then /etc/ssh is being linked, overriding the config. Is there a way to have the persistent directories linked first, then let everything happen?

Also, enabling neededForBoot for / isn't solving this either! 😅