summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2026-09-24 18:40:08 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2026-09-24 18:40:08 +0200
commit9a85dc9c31a10eaf0640d228230e9f2de79238b4 (patch)
treeed50109441d812ddbf2845f75fd56931807039aa
parentd2e6663085652df3c581062d85e063c013f905cf (diff)
downloadnixos-9a85dc9c31a10eaf0640d228230e9f2de79238b4.tar
nixos-9a85dc9c31a10eaf0640d228230e9f2de79238b4.tar.gz
nixos-9a85dc9c31a10eaf0640d228230e9f2de79238b4.tar.bz2
nixos-9a85dc9c31a10eaf0640d228230e9f2de79238b4.tar.xz
nixos-9a85dc9c31a10eaf0640d228230e9f2de79238b4.zip
...
-rw-r--r--accounts/gkleen@skadhi/default.nix2
-rw-r--r--accounts/gkleen@skadhi/ssh/default.nix26
-rw-r--r--system-profiles/openssh/default.nix4
-rw-r--r--user-profiles/core.nix9
4 files changed, 38 insertions, 3 deletions
diff --git a/accounts/gkleen@skadhi/default.nix b/accounts/gkleen@skadhi/default.nix
index 80efa8d8..352a52d2 100644
--- a/accounts/gkleen@skadhi/default.nix
+++ b/accounts/gkleen@skadhi/default.nix
@@ -56,7 +56,7 @@ in {
56 home-manager.users.${userName} = { sysConfig, config, ... }: { 56 home-manager.users.${userName} = { sysConfig, config, ... }: {
57 imports = [ 57 imports = [
58 flakeInputs.nix-index-database.homeModules.nix-index 58 flakeInputs.nix-index-database.homeModules.nix-index
59 ./niri.nix ./shell ./emacs ./zsh 59 ./niri.nix ./shell ./emacs ./zsh ./ssh
60 ]; 60 ];
61 61
62 home.stateVersion = "26.05"; 62 home.stateVersion = "26.05";
diff --git a/accounts/gkleen@skadhi/ssh/default.nix b/accounts/gkleen@skadhi/ssh/default.nix
new file mode 100644
index 00000000..93e4bdfa
--- /dev/null
+++ b/accounts/gkleen@skadhi/ssh/default.nix
@@ -0,0 +1,26 @@
1{ ... }:
2{
3 config = {
4 programs.ssh.matchBlocks = {
5 "surtr" = {
6 hostname = "surtr.yggdrasil";
7 identityFile = "~/.ssh/gkleen@skadhi.yggdrasil";
8 };
9 "surtr.yggdrasil.li" = {
10 identityFile = "~/.ssh/gkleen@skadhi.yggdrasil";
11 };
12 "sif" = {
13 hostname = "sif.yggdrasil";
14 identityFile = "~/.ssh/gkleen@skadhi.yggdrasil";
15 };
16 "vidhar" = {
17 hostname = "vidhar.yggdrasil";
18 identityFile = "~/.ssh/gkleen@skadhi.yggdrasil";
19 };
20 "ymir" = {
21 hostname = "ymir.yggdrasil.li";
22 identityFile = "~/.ssh/gkleen@skadhi.yggdrasil";
23 };
24 };
25 };
26}
diff --git a/system-profiles/openssh/default.nix b/system-profiles/openssh/default.nix
index e60e72d9..774c2f20 100644
--- a/system-profiles/openssh/default.nix
+++ b/system-profiles/openssh/default.nix
@@ -66,11 +66,15 @@ in {
66 services.openssh = mkIf cfg.enable { 66 services.openssh = mkIf cfg.enable {
67 startWhenNeeded = true; 67 startWhenNeeded = true;
68 hostKeys = mkIf cfg.staticHostKeys (mkForce []); # done manually 68 hostKeys = mkIf cfg.staticHostKeys (mkForce []); # done manually
69 authorizedKeysInHomedir = mkDefault false;
69 settings = { 70 settings = {
70 inherit Ciphers Macs KexAlgorithms; 71 inherit Ciphers Macs KexAlgorithms;
71 HostKeyAlgorithms = concatStringsSep "," HostKeyAlgorithms; 72 HostKeyAlgorithms = concatStringsSep "," HostKeyAlgorithms;
72 PubkeyAcceptedAlgorithms = concatStringsSep "," PubkeyAcceptedAlgorithms; 73 PubkeyAcceptedAlgorithms = concatStringsSep "," PubkeyAcceptedAlgorithms;
73 CASignatureAlgorithms = concatStringsSep "," CASignatureAlgorithms; 74 CASignatureAlgorithms = concatStringsSep "," CASignatureAlgorithms;
75 TrustedUserCAKeys = toString (pkgs.writeText "trusted_user_ca_keys" ''
76 ${builtins.readFile ./ca/ca.pub}
77 '');
74 78
75 LogLevel = "VERBOSE"; 79 LogLevel = "VERBOSE";
76 RevokedKeys = toString ./ca/krl.bin; 80 RevokedKeys = toString ./ca/krl.bin;
diff --git a/user-profiles/core.nix b/user-profiles/core.nix
index 7034f17e..8b8da681 100644
--- a/user-profiles/core.nix
+++ b/user-profiles/core.nix
@@ -1,10 +1,15 @@
1{ flake, flakeInputs, sources, path, userName, config, lib, utils, ... }: 1{ flake, flakeInputs, sources, path, userName, hostName, config, lib, utils, ... }:
2 2
3with lib; 3with lib;
4 4
5{ 5{
6 config = { 6 config = {
7 users.users.${userName} = {}; # Just make sure the user is created 7 users.users.${userName} = { # Make sure the user is created
8 openssh.authorizedPrincipals = [
9 "${userName}@${hostName}"
10 "${userName}@*"
11 ];
12 };
8 home-manager.users.${userName} = let sysConfig = config; in { config, ... }: { 13 home-manager.users.${userName} = let sysConfig = config; in { config, ... }: {
9 config._module.args = { 14 config._module.args = {
10 inherit sysConfig flake flakeInputs sources; 15 inherit sysConfig flake flakeInputs sources;