[ssh] Move to actual module

This commit is contained in:
Tibo De Peuter 2023-10-18 18:54:27 +02:00
parent 197fcdbb81
commit 37b3968722
10 changed files with 100 additions and 78 deletions

View file

@ -1,8 +1,7 @@
{ lib, ... }:
{
imports = [
./programs
./services
./users
./virtualisation
];

View file

@ -1,6 +1,7 @@
{
imports = [
./home-manager
./ssh
./zellij
];
}

View file

@ -0,0 +1,13 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sisyphus.programs.ssh;
in {
options.sisyphus.programs.ssh.enable = lib.mkEnableOption "SSH";
config = lib.mkIf cfg.enable {
programs.ssh = {
enableAskPassword = false;
};
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./openssh
];
}

View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sisyphus.services.openssh;
in {
options.sisyphus.services.openssh.enable = lib.mkEnableOption "OpenSSH";
config = lib.mkIf cfg.enable {
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
};
}

View file

@ -21,6 +21,8 @@ in {
fonts.fonts = with pkgs; [
font-awesome_5 # Dependency of Vifm config
noto-fonts # Dependency of Zellij config
noto-fonts-cjk # Dependency of Zellij config
];
home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable {
@ -48,6 +50,7 @@ in {
unzip
vifm # File manager
zathura # PDF viewer
zellij # Tmux + screen alternative
]) ++ (with pkgs-unstable; [
mpv
]);
@ -66,6 +69,10 @@ in {
source = ../../../../stow/mpv/.config/mpv;
};
".ssh/config" = { # Always put SSH configuration
source = ../../../../stow/ssh/.ssh/config;
};
# Put Vifm files separately so history fill still works.
".config/vifm/colors" = lib.mkIf (builtins.elem pkgs.vifm installedPkgs) {
source = ../../../../stow/vifm/.config/vifm/colors;