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; isNormalUser = true;
description = "Aleksandr Lebedev"; description = "Aleksandr Lebedev";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
#initialPassword = "1234"; initialPassword = "1234";
hashedPasswordFile = config.sops.secrets."users/${username}".path;
packages = with pkgs; []; packages = with pkgs; [];
}; };
}; };
#test = {
# isNormalUser = true;
# initialPassword = "1234";
# extraGroups = [ "networkmanager" ];
#};
}; };
qt = { 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]; environment.systemPackages = with pkgs; [sops];
sops.defaultSopsFile = ./secrets/secrets.yaml; sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.defaultSopsFormat = "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 # This will generate a new key if the key specified above does not exist
sops.age.generateKey = true; sops.age.generateKey = true;
@ -12,4 +15,8 @@
neededForUsers = true; neededForUsers = true;
}; };
}; };
users.users.${username} = {
hashedPasswordFile = config.sops.secrets."users/${username}".path;
initialPassword = lib.mkForce null;
};
} }