diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index 128bfed..1c1dc75 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -9,6 +9,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix ./modules/age + ./modules/ssh ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; @@ -210,30 +211,6 @@ secrets = { "syncthing-cert".file = ../../secrets/pinwheel/syncthing-cert.age; "syncthing-key".file = ../../secrets/pinwheel/syncthing-key.age; - "alex.pinwheel-sombrero" = { - file = ../../secrets/pinwheel/alex.pinwheel-sombrero.age; - path = "/home/alex/.ssh/alex.pinwheel-sombrero"; - owner = "alex"; - group = "users"; - }; - "alex.pinwheel-sombrero.pub" = { - file = ../../secrets/pinwheel/alex.pinwheel-sombrero.pub.age; - path = "/home/alex/.ssh/alex.pinwheel-sombrero.pub"; - owner = "alex"; - group = "users"; - }; - "alex.pinwheel-github.com" = { - file = ../../secrets/pinwheel/alex.pinwheel-github.com.age; - path = "/home/alex/.ssh/alex.pinwheel-github.com"; - owner = "alex"; - group = "users"; - }; - "alex.pinwheel-github.com.pub" = { - file = ../../secrets/pinwheel/alex.pinwheel-github.com.pub.age; - path = "/home/alex/.ssh/alex.pinwheel-github.com.pub"; - owner = "alex"; - group = "users"; - }; }; }; diff --git a/hosts/pinwheel/home.nix b/hosts/pinwheel/home.nix index 59a7622..a1bd6ef 100644 --- a/hosts/pinwheel/home.nix +++ b/hosts/pinwheel/home.nix @@ -17,23 +17,6 @@ bemenu ]; - programs.ssh = { - enable = true; - - matchBlocks = { - "sombrero.local" = { - hostname = "192.168.50.200"; - user = "alex"; - identityFile = "/home/alex/.ssh/alex.pinwheel-sombrero"; - port = 1122; - }; - "github.com" = { - hostname = "github.com"; - identityFile = "/home/alex/.ssh/alex.pinwheel-github.com"; - }; - }; - }; - programs.git = { enable = true; includes = [ diff --git a/hosts/pinwheel/modules/ssh/default.nix b/hosts/pinwheel/modules/ssh/default.nix new file mode 100644 index 0000000..0fc9b13 --- /dev/null +++ b/hosts/pinwheel/modules/ssh/default.nix @@ -0,0 +1,53 @@ +{ home-manager, pkgs, ... }: +{ + home-manager.users.alex.programs.ssh = { + enable = true; + + matchBlocks = { + "sombrero.local" = { + hostname = "192.168.50.200"; + user = "alex"; + identityFile = "/home/alex/.ssh/alex.pinwheel-sombrero"; + port = 1122; + }; + "github.com" = { + hostname = "github.com"; + identityFile = "/home/alex/.ssh/alex.pinwheel-github.com"; + }; + }; + }; + + age = { + identityPaths = [ + "/etc/ssh/pinwheel" + "/home/alex/.ssh/alex.pinwheel" + ]; + + secrets = { + "alex.pinwheel-sombrero" = { + file = ../../../../secrets/pinwheel/alex.pinwheel-sombrero.age; + path = "/home/alex/.ssh/alex.pinwheel-sombrero"; + owner = "alex"; + group = "users"; + }; + "alex.pinwheel-sombrero.pub" = { + file = ../../../../secrets/pinwheel/alex.pinwheel-sombrero.pub.age; + path = "/home/alex/.ssh/alex.pinwheel-sombrero.pub"; + owner = "alex"; + group = "users"; + }; + "alex.pinwheel-github.com" = { + file = ../../../../secrets/pinwheel/alex.pinwheel-github.com.age; + path = "/home/alex/.ssh/alex.pinwheel-github.com"; + owner = "alex"; + group = "users"; + }; + "alex.pinwheel-github.com.pub" = { + file = ../../../../secrets/pinwheel/alex.pinwheel-github.com.pub.age; + path = "/home/alex/.ssh/alex.pinwheel-github.com.pub"; + owner = "alex"; + group = "users"; + }; + }; + }; +}