security: start setting permissions on secrets properly

This commit is contained in:
Christoph Hollizeck 2025-12-01 23:53:27 +01:00
parent 01fb6d8ec9
commit ad9862019c
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
11 changed files with 126 additions and 53 deletions

View file

@ -1,8 +1,4 @@
{
config,
...
}:
{
topLevel: {
flake = {
meta.users = {
cholli = {
@ -22,12 +18,13 @@
modules = {
nixos.cholli =
{ pkgs, ... }:
{ config, pkgs, ... }:
{
programs.fish.enable = true;
sops.secrets.passwordHash.neededForUsers = true;
users.users.cholli = {
description = config.flake.meta.users.cholli.name;
description = topLevel.config.flake.meta.users.cholli.name;
isNormalUser = true;
createHome = true;
extraGroups = [
@ -39,13 +36,12 @@
"wheel"
];
shell = pkgs.fish;
# TODO: fix this with sops
initialPassword = "asdf";
hashedPasswordFile = config.sops.secrets.passwordHash.path;
openssh.authorizedKeys.keys = config.flake.meta.users.cholli.authorizedKeys;
openssh.authorizedKeys.keys = topLevel.config.flake.meta.users.cholli.authorizedKeys;
};
nix.settings.trusted-users = [ config.flake.meta.users.cholli.username ];
nix.settings.trusted-users = [ topLevel.config.flake.meta.users.cholli.username ];
};