Moved some configuration

This commit is contained in:
Aleksandr Lebedev 2024-12-18 10:22:40 +01:00
parent b83c4f77c7
commit 8959ab4ff5
2 changed files with 15 additions and 4 deletions

View file

@ -95,11 +95,15 @@
isNormalUser = true;
description = "Aleksandr Lebedev";
extraGroups = [ "networkmanager" "wheel" ];
#initialPassword = "1234";
hashedPasswordFile = config.sops.secrets."users/${username}".path;
initialPassword = "1234";
packages = with pkgs; [];
};
};
#test = {
# isNormalUser = true;
# initialPassword = "1234";
# extraGroups = [ "networkmanager" ];
#};
};
qt = {

View file

@ -1,9 +1,12 @@
{ pkgs, inputs, username, hwconfig, ... }:
{ config, pkgs, inputs, username, lib, hwconfig, ... }:
let
keyPath = (if hwconfig.useImpermanence then "/persist/sops/age/keys.txt" else "/var/lib/sops/age/keys.txt");
in
{
environment.systemPackages = with pkgs; [sops];
sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = (if hwconfig.useImpermanence then "/persist/sops/age/keys.txt" else "/home/${username}/.config/sops/age/keys.txt");
sops.age.keyFile = keyPath;
# This will generate a new key if the key specified above does not exist
sops.age.generateKey = true;
@ -12,4 +15,8 @@
neededForUsers = true;
};
};
users.users.${username} = {
hashedPasswordFile = config.sops.secrets."users/${username}".path;
initialPassword = lib.mkForce null;
};
}