parent
c9951e3774
commit
148cbd4b48
2 changed files with 21 additions and 4 deletions
|
@ -6,14 +6,13 @@
|
|||
}: let
|
||||
sshdTmpDirectory = "${config.user.home}/sshd-tmp";
|
||||
sshdDirectory = "${config.user.home}/sshd";
|
||||
pathToPubKey = "/mnt/sdcard/Download/picard_host_key.pub";
|
||||
port = 8022;
|
||||
in {
|
||||
# Backup etc files instead of failing to activate generation if a file already exists in /etc
|
||||
environment.etcBackupExtension = ".bak";
|
||||
|
||||
# Read the changelog before changing this value
|
||||
system.stateVersion = "23.11";
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
# Set up nix for flakes
|
||||
nix.extraOptions = ''
|
||||
|
@ -23,9 +22,24 @@ in {
|
|||
# Set your time zone
|
||||
time.timeZone = "Europe/Rome";
|
||||
|
||||
build.activation.sshd = ''
|
||||
home-manager.config = {pkgs, ...}: {
|
||||
home.stateVersion = "24.05";
|
||||
_module.args = {
|
||||
hostname = "janeway";
|
||||
};
|
||||
imports = [../../hmModules/shell];
|
||||
};
|
||||
|
||||
build.activation.sshd = let
|
||||
keys = (builtins.import ../../lib).keys;
|
||||
inherit (keys) hosts users;
|
||||
in ''
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh"
|
||||
$DRY_RUN_CMD cat ${pathToPubKey} > "${config.user.home}/.ssh/authorized_keys"
|
||||
$DRY_RUN_CMD echo ${hosts.picard} > "${config.user.home}/.ssh/authorized_keys"
|
||||
$DRY_RUN_CMD echo ${hosts.sisko} >> "${config.user.home}/.ssh/authorized_keys"
|
||||
$DRY_RUN_CMD echo ${hosts.kirk} >> "${config.user.home}/.ssh/authorized_keys"
|
||||
$DRY_RUN_CMD echo ${users.ccr-ssh} >> "${config.user.home}/.ssh/authorized_keys"
|
||||
$DRY_RUN_CMD echo ${users.ccr-gpg} >> "${config.user.home}/.ssh/authorized_keys"
|
||||
|
||||
if [[ ! -d "${sshdDirectory}" ]]; then
|
||||
$DRY_RUN_CMD rm $VERBOSE_ARG --recursive --force "${sshdTmpDirectory}"
|
||||
|
@ -48,6 +62,7 @@ in {
|
|||
pkgs.stress
|
||||
pkgs.openssh
|
||||
pkgs.git
|
||||
pkgs.btop
|
||||
(pkgs.writeScriptBin "sshd-start" ''
|
||||
#!${pkgs.runtimeShell}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue