From 8aece8bcd79e77b97ec8eaedf4beff63efb34daa Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Tue, 10 Jun 2025 11:18:18 -0500 Subject: [PATCH] move sops to config file --- configuration.nix | 27 ++++++++++++++++++++++++++- home.nix | 13 +------------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/configuration.nix b/configuration.nix index b213558..e3e806e 100755 --- a/configuration.nix +++ b/configuration.nix @@ -32,6 +32,23 @@ ]; }; + # SOPS config + sops = { + age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + age.keyFile = "/var/lib/sops-nix/key.txt"; + age.generateKey = true; + defaultSopsFormat = "json"; + defaultSopsFile = ./secrets/roy.json; + + # test secrets + secrets = { + "testKey" = { + sopsFile = ./secrets/roy.json; + key = "testKey"; + }; + }; + }; + # needed to allowOther in home.nix programs.fuse.userAllowOther = true; @@ -151,7 +168,15 @@ }; # Enable the OpenSSH daemon. - services.openssh.enable = true; + services.openssh = { + enable = true; + hostKeys = [ + { + type = "ed25519"; + path = "/persist/etc/ssh/ssh_host_ed25519_key"; + } + ]; + }; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; diff --git a/home.nix b/home.nix index 19bd2f4..4ff7667 100755 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ pkgs, inputs, ... }: +{ config, pkgs, inputs, ... }: { @@ -43,7 +43,6 @@ "rp" ".mozilla/firefox/roy/storage/default" ".cache/mozilla/firefox/roy" - "age" ]; files = [ ".bash_history" @@ -54,16 +53,6 @@ allowOther = true; }; - # SOPS config - sops = { - age.keyFile = "/persist/home/roy/age/.age-key.txt"; - defaultSopsFormat = "json"; - defaultSopsFile = ./secrets/roy.json; - # secrets.test = { - # path = "%r/test.txt"; - #}; - }; - # User services must come after sops secrets systemd.user.services.mbsync.unitConfig.After = [ "sops-nix.service" ];