users and passwords
This commit is contained in:
@@ -10,25 +10,22 @@
|
||||
./snapshot
|
||||
./sshd
|
||||
./unitstatus
|
||||
./users
|
||||
./zfsborg
|
||||
];
|
||||
|
||||
options.mj = {
|
||||
options.mj = with lib.types; {
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
type = str;
|
||||
example = "22.11";
|
||||
description = "The NixOS state version to use for this system";
|
||||
};
|
||||
|
||||
timeZone = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
type = str;
|
||||
example = "Europe/Vilnius";
|
||||
description = "Time zone for this system";
|
||||
};
|
||||
|
||||
stubPasswords = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
@@ -63,33 +60,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
users = let
|
||||
withPasswordFile = file: attrs:
|
||||
(
|
||||
if config.mj.stubPasswords
|
||||
then {
|
||||
initialPassword = "live";
|
||||
}
|
||||
else {
|
||||
passwordFile = file;
|
||||
}
|
||||
)
|
||||
// attrs;
|
||||
in {
|
||||
mutableUsers = false;
|
||||
|
||||
users = {
|
||||
motiejus = withPasswordFile config.age.secrets.motiejus-passwd-hash.path {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel"];
|
||||
uid = 1000;
|
||||
openssh.authorizedKeys.keys = [myData.ssh_pubkeys.motiejus];
|
||||
};
|
||||
|
||||
root = withPasswordFile config.age.secrets.root-passwd-hash.path {};
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
jc # parse different formats and command outputs to json
|
||||
|
||||
Reference in New Issue
Block a user