From 51c6175140f093e55ed0c366b434f28d9ea51e18 Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 16 May 2024 13:35:11 -0400 Subject: [PATCH] Finally got the new secrets format working right...I hope. I should really just use sops or agenix @_@ --- flake.nix | 3 --- hosts/Haven/hardware-configuration.nix | 3 +-- modules/autoimport.nix | 6 +++--- modules/services/msmtp.nix | 17 ++++++----------- nix-secrets | 2 +- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index fd3e100..7108ff2 100644 --- a/flake.nix +++ b/flake.nix @@ -79,9 +79,6 @@ useGlobalPkgs = true; useUserPackages = true; backupFileExtension = "home-manager-backup"; - extraSpecialArgs = { - inherit inputs; - }; }; } ]; diff --git a/hosts/Haven/hardware-configuration.nix b/hosts/Haven/hardware-configuration.nix index 05138da..57a62b7 100644 --- a/hosts/Haven/hardware-configuration.nix +++ b/hosts/Haven/hardware-configuration.nix @@ -4,7 +4,6 @@ lib, pkgs, modulesPath, - nix-secrets, ... }: { @@ -34,7 +33,7 @@ enable = true; mdadmConf = lib.mkIf (config.networking.hostName == "Haven") '' ARRAY /dev/md/Sapana metadata=1.2 UUID=51076daf:efdb34dd:bce48342:3b549fcb - MAILADDR ${nix-secrets.users.aires.email} + MAILADDR ${config.secrets.users.aires.email} ''; }; }; diff --git a/modules/autoimport.nix b/modules/autoimport.nix index ce87eec..a11e600 100644 --- a/modules/autoimport.nix +++ b/modules/autoimport.nix @@ -5,10 +5,10 @@ with lib; let # Fetch secrets # IMPORTANT: Make sure this repo exists on the filesystem first! - nix-secrets-ssh = builtins.fetchGit { + nix-secrets = builtins.fetchGit { url = "/home/aires/Development/nix-configuration/nix-secrets"; ref = "main"; - rev = "18340f7a56b754d807a5be2ef84f12ea3b34ce4e"; + rev = "be1b413b4215984d10e15ffbd4a47a038d5a4292"; }; # Recursively constructs an attrset of a given folder, recursing on directories, value of attrs is the filetype @@ -33,5 +33,5 @@ let ); in { - imports = [ "${nix-secrets-ssh}" ] ++ validFiles ./.; + imports = [ "${nix-secrets}" ] ++ validFiles ./.; } diff --git a/modules/services/msmtp.nix b/modules/services/msmtp.nix index cd37582..252887f 100644 --- a/modules/services/msmtp.nix +++ b/modules/services/msmtp.nix @@ -1,10 +1,5 @@ # See https://nixos.wiki/wiki/Msmtp -{ - config, - lib, - nix-secrets, - ... -}: +{ config, lib, ... }: let cfg = config.host.services.msmtp; @@ -19,15 +14,15 @@ with lib; programs.msmtp = { enable = true; accounts.default = { - host = nix-secrets.services.msmtp.host; - user = nix-secrets.services.msmtp.user; - password = nix-secrets.services.msmtp.password; + host = config.secrets.services.msmtp.host; + user = config.secrets.services.msmtp.user; + password = config.secrets.services.msmtp.password; auth = true; tls = true; tls_starttls = true; port = 587; - from = "${config.networking.hostName}@${nix-secrets.networking.primaryDomain}"; - to = nix-secrets.users.aires.email; + from = "${config.networking.hostName}@${config.secrets.networking.primaryDomain}"; + to = config.secrets.users.aires.email; }; }; }; diff --git a/nix-secrets b/nix-secrets index 18340f7..be1b413 160000 --- a/nix-secrets +++ b/nix-secrets @@ -1 +1 @@ -Subproject commit 18340f7a56b754d807a5be2ef84f12ea3b34ce4e +Subproject commit be1b413b4215984d10e15ffbd4a47a038d5a4292