summaryrefslogtreecommitdiff
path: root/users/seth/programs/ssh.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/seth/programs/ssh.nix')
-rw-r--r--users/seth/programs/ssh.nix80
1 files changed, 44 insertions, 36 deletions
diff --git a/users/seth/programs/ssh.nix b/users/seth/programs/ssh.nix
index 69a7b57..7be5f0e 100644
--- a/users/seth/programs/ssh.nix
+++ b/users/seth/programs/ssh.nix
@@ -1,48 +1,56 @@
{
config,
+ lib,
pkgs,
...
-}: {
- programs.ssh = {
- enable = true;
- package = pkgs.openssh;
-
- matchBlocks = let
- sshDir = "${config.home.homeDirectory}/.ssh";
- in {
- # git forges
- "github.com" = {
- identityFile = "${sshDir}/github";
- user = "git";
- };
+}: let
+ cfg = config.getchoo.programs.ssh;
+ inherit (lib) mkEnableOption mkIf;
+in {
+ options.getchoo.programs.ssh.enable = mkEnableOption "ssh" // {default = true;};
- "codeberg.org" = {
- identityFile = "${sshDir}/codeberg";
- user = "git";
- };
+ config = mkIf cfg.enable {
+ programs.ssh = {
+ enable = true;
+ package = pkgs.openssh;
- # linux packaging
- "aur.archlinux.org" = {
- identityFile = "${sshDir}/aur";
- user = "aur";
- };
+ matchBlocks = let
+ sshDir = "${config.home.homeDirectory}/.ssh";
+ in {
+ # git forges
+ "github.com" = {
+ identityFile = "${sshDir}/github";
+ user = "git";
+ };
- "pagure.io" = {
- identityFile = "${sshDir}/copr";
- user = "git";
- };
+ "codeberg.org" = {
+ identityFile = "${sshDir}/codeberg";
+ user = "git";
+ };
- # router
- "192.168.1.1" = {
- identityFile = "${sshDir}/openwrt";
- user = "root";
- };
+ # linux packaging
+ "aur.archlinux.org" = {
+ identityFile = "${sshDir}/aur";
+ user = "aur";
+ };
- # servers
- "atlas".user = "atlas";
- "p-body".user = "p-body";
+ "pagure.io" = {
+ identityFile = "${sshDir}/copr";
+ user = "git";
+ };
+
+ # router
+ "192.168.1.1" = {
+ identityFile = "${sshDir}/openwrt";
+ user = "root";
+ };
+
+ # servers
+ "atlas".user = "atlas";
+ "p-body".user = "p-body";
+ };
};
- };
- services.ssh-agent.enable = pkgs.stdenv.isLinux;
+ services.ssh-agent.enable = pkgs.stdenv.isLinux;
+ };
}