Setup SSH added, hms fixed, removed shared SSH keys
This commit is contained in:
@@ -62,6 +62,9 @@ in rec {
|
||||
hms = super.callPackage ./hms.nix {
|
||||
pkgs = self.pkgs;
|
||||
};
|
||||
setup-ssh = super.callPackage ./setup-ssh.nix {
|
||||
pkgs = self.pkgs;
|
||||
};
|
||||
kiwix-tools = super.callPackage ./kiwix-tools.nix {};
|
||||
libkiwix = super.callPackage ./libkiwix.nix {};
|
||||
zimlib = super.callPackage ./zimlib.nix {};
|
||||
|
||||
@@ -7,9 +7,11 @@ if [ "$(uname -s)" == "Darwin" ]; then
|
||||
# On macOS
|
||||
src="${HOME}/.config/nix/"
|
||||
flavor="gui"
|
||||
arch="${arch}-darwin"
|
||||
elif [ x"${WSL_DISTRO_NAME}" != "x" ]; then
|
||||
src=/etc/nixos
|
||||
flavor="cli"
|
||||
arch="${arch}-linux"
|
||||
else
|
||||
# On Linux systems
|
||||
if [ -z "${DISPLAY}" ]; then
|
||||
@@ -18,6 +20,7 @@ else
|
||||
flavor="gdm"
|
||||
fi
|
||||
src=/etc/nixos
|
||||
arch="${arch}-linux"
|
||||
fi
|
||||
|
||||
# Build and switch
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
pkgs.writeShellScriptBin "setup-ssh" (builtins.readFile ./setup-ssh.sh)
|
||||
@@ -0,0 +1,11 @@
|
||||
# vim: set ft=bash:
|
||||
if [ ! -f "${HOME}/.ssh/id_rsa" ]; then
|
||||
echo "Generating a new key"
|
||||
ssh-keygen -t rsa -b 8192 -f "${HOME}/.ssh/id_rsa" -N ''
|
||||
cat "${HOME}/.ssh/id_rsa.pub" >> /etc/nixos/home/ssh/authorized_keys
|
||||
|
||||
echo "Authing key to GitHub - may fail"
|
||||
gh auth refresh -h github.com -s admin:public_key
|
||||
gh ssh-key add -t ${HOSTNAME}-auto ~/.ssh/id_rsa.pub || true
|
||||
fi
|
||||
cp /etc/nixos/home/ssh/authorized_keys "${HOME}/.ssh/authorized_keys"
|
||||
Reference in New Issue
Block a user