From 2623f5b1465d20f1a8c5b353a1f6724b970b2b95 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sun, 30 Jun 2024 23:31:42 +0530 Subject: [PATCH] all: refactor secrets --- common/default.nix | 8 ++++++-- common/secrets.nix | 19 ------------------- common/users.nix | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 21 deletions(-) delete mode 100644 common/secrets.nix diff --git a/common/default.nix b/common/default.nix index b69520c..fe710ec 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,3 +1,7 @@ -{ ... }: { - imports = [ ./nix.nix ./secrets.nix ./users.nix ]; +_: { + imports = [ ./nix.nix ./users.nix ]; + + sops = { + defaultSopsFile = ../secrets.yaml; + }; } diff --git a/common/secrets.nix b/common/secrets.nix deleted file mode 100644 index a316be5..0000000 --- a/common/secrets.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, ... }: { - sops = { - defaultSopsFile = ../secrets.yaml; - secrets = { - "passwd/root" = { - mode = "400"; - owner = config.users.users.root.name; - group = config.users.users.root.group; - neededForUsers = true; - }; - "passwd/adtya" = { - mode = "400"; - owner = config.users.users.root.name; - group = config.users.users.root.group; - neededForUsers = true; - }; - }; - }; -} diff --git a/common/users.nix b/common/users.nix index 335e4bf..67cabe5 100644 --- a/common/users.nix +++ b/common/users.nix @@ -1,4 +1,20 @@ { config, pkgs, username, ... }: { + sops = { + secrets = { + "passwd/root" = { + mode = "400"; + owner = config.users.users.root.name; + group = config.users.users.root.group; + neededForUsers = true; + }; + "passwd/adtya" = { + mode = "400"; + owner = config.users.users.root.name; + group = config.users.users.root.group; + neededForUsers = true; + }; + }; + }; users.mutableUsers = false; users.users = { root = {