diff --git a/modules/apps/default.nix b/modules/apps/default.nix index 45fd057..1717cbc 100644 --- a/modules/apps/default.nix +++ b/modules/apps/default.nix @@ -12,6 +12,7 @@ ./mangohud ./nh ./obs + ./ssh ./steam ./sunshine ./syncthing diff --git a/modules/apps/ssh/default.nix b/modules/apps/ssh/default.nix new file mode 100644 index 0000000..0f4fab0 --- /dev/null +++ b/modules/apps/ssh/default.nix @@ -0,0 +1,91 @@ +{ + lib, + config, + username, + ... +}: +let + cfg = config.ssh; +in +{ + options = { + ssh = { + enable = lib.mkEnableOption "Enable ssh in NixOS"; + }; + }; + config = lib.mkIf cfg.enable { + programs.ssh = { + startAgent = true; + }; + services.openssh = { + enable = true; + listenAddresses = [ + { + addr = "0.0.0.0"; + port = 15995; + } + ]; + ports = [ 15995 ]; + settings = { + AllowUsers = [ "${username}" ]; + # Allow forwarding ports to everywhere + GatewayPorts = "clientspecified"; + KbdInteractiveAuthentication = false; + KexAlgorithms = [ + "sntrup761x25519-sha512@openssh.com" + "curve25519-sha256" + "curve25519-sha256@libssh.org" + #"diffie-hellman-group-exchange-sha256" + ]; + PasswordAuthentication = false; + PermitRootLogin = "no"; + # Automatically remove stale sockets + StreamLocalBindUnlink = "yes"; + UseDns = true; + X11Forwarding = true; + }; + }; + home-manager.users.${username} = + { config, pkgs, ... }: + { + home.file = { + desktop-entry-ssh-add = { + enable = true; + text = '' + [Desktop Entry] + Exec=ssh-add -q .ssh/id_ed25519 + Name=ssh-add + Type=Application + ''; + target = "${config.xdg.configHome}/autostart/ssh-add.desktop"; + }; + }; + home.packages = with pkgs; [ sshs ]; + programs.ssh = { + enable = true; + extraConfig = '' + Host thalia + HostName thalia + User ${username} + Port 6777 + Host orion + HostName orion + User ${username} + Port 6777 + Host media + HostName media.home + User ryan + Port 22 + Host proxmox + HostName proxmox.home + User root + Port 22 + Host router + HostName router.home + User root + Port 22 + ''; + }; + }; + }; +} diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 3a55b05..89d6774 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -45,7 +45,7 @@ in # nvim.enable = true; # pay-respects.enable = true; # ripgrep.enable = true; - # ssh.enable = true; + ssh.enable = true; # starship.enable = true; # tailscale.enable = true; # tealdeer.enable = true; diff --git a/todo b/todo index 652d1a4..3548476 100644 --- a/todo +++ b/todo @@ -2,11 +2,12 @@ DONE secrets DONE syncthing DONE Logseq DONE mouse speed +TODO git thru ssh TODO boot into Hyprland TODO autologin on boot -TODO git thru ssh TODO zsh error TODO ags TODO sudo nopasswd TODO brightness controls -TODO sounds (disable bell!!!) \ No newline at end of file +TODO sounds (disable bell!!!) +TODO KDEConnect \ No newline at end of file