diff options
| author | seth <[email protected]> | 2023-08-17 13:46:41 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-08-17 13:55:47 -0400 |
| commit | 6ca79241fe6a45ca4468e4c54c778df116c0b14f (patch) | |
| tree | ca6bbd7eaec86125c0e59a2553922ea4ef4a2b9b /users/seth/programs/ssh.nix | |
| parent | 76127171e4ed7abcb2a14039f358e117aac20181 (diff) | |
users/seth: make everything a module
Diffstat (limited to 'users/seth/programs/ssh.nix')
| -rw-r--r-- | users/seth/programs/ssh.nix | 80 |
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; + }; } |
