mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-22 03:41:26 +00:00
It builds!
This commit is contained in:
parent
85aaf52635
commit
4ba0dd5396
|
@ -35,7 +35,7 @@
|
|||
};
|
||||
nameservers = [ "1.1.1.1" "1.0.0.1" ];
|
||||
};
|
||||
time.timeZone = "Europe/Uzhgorod";
|
||||
time.timeZone = config.services.userdata.timezone;
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
users.users.root.openssh.authorizedKeys.keys = config.services.userdata.rootSshKeys;
|
||||
services.openssh = {
|
||||
|
|
|
@ -43,24 +43,24 @@ in
|
|||
stop;
|
||||
}
|
||||
'';
|
||||
} // builtins.listToAttrs (builtins.map
|
||||
(user: {
|
||||
name = "${user.username}@${cfg.domain}";
|
||||
value = {
|
||||
hashedPassword = user.hashedPassword;
|
||||
catchAll = [ cfg.domain ];
|
||||
sieveScript = ''
|
||||
require ["fileinto", "mailbox"];
|
||||
if header :contains "Chat-Version" "1.0"
|
||||
{
|
||||
fileinto :create "DeltaChat";
|
||||
stop;
|
||||
}
|
||||
'';
|
||||
};
|
||||
})
|
||||
cfg.users);
|
||||
};
|
||||
};
|
||||
} // builtins.listToAttrs (builtins.map
|
||||
(user: {
|
||||
name = "${user.username}@${cfg.domain}";
|
||||
value = {
|
||||
hashedPassword = user.hashedPassword;
|
||||
catchAll = [ cfg.domain ];
|
||||
sieveScript = ''
|
||||
require ["fileinto", "mailbox"];
|
||||
if header :contains "Chat-Version" "1.0"
|
||||
{
|
||||
fileinto :create "DeltaChat";
|
||||
stop;
|
||||
}
|
||||
'';
|
||||
};
|
||||
})
|
||||
cfg.users);
|
||||
|
||||
extraVirtualAliases = {
|
||||
"admin@${cfg.domain}" = "${cfg.username}@${cfg.domain}";
|
||||
|
|
|
@ -37,5 +37,7 @@ in
|
|||
'';
|
||||
users.users.pleroma = {
|
||||
extraGroups = [ "postgres" ];
|
||||
isNormalUser = false;
|
||||
isSystemUser = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
"hashedMasterPassword": {
|
||||
"type": "string"
|
||||
},
|
||||
"timezone": {
|
||||
"type": "string"
|
||||
},
|
||||
"backblaze": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
17
users.nix
17
users.nix
|
@ -1,12 +1,23 @@
|
|||
{ pkgs, config, ... }:
|
||||
let
|
||||
cfg = config.services.userdata;
|
||||
in
|
||||
{
|
||||
users.mutableUsers = false;
|
||||
users = {
|
||||
users = {
|
||||
"${config.services.userdata.username}" = {
|
||||
"${cfg.username}" = {
|
||||
isNormalUser = true;
|
||||
hashedPassword = config.services.userdata.hashedMasterPassword;
|
||||
hashedPassword = cfg.hashedMasterPassword;
|
||||
};
|
||||
};
|
||||
} // builtins.listToAttrs (builtins.map
|
||||
(user: {
|
||||
name = "${user.username}";
|
||||
value = {
|
||||
isNormalUser = true;
|
||||
hashedPassword = user.hashedPassword;
|
||||
};
|
||||
})
|
||||
cfg.users);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,19 +8,6 @@ let
|
|||
if cfg.direction == ""
|
||||
then ""
|
||||
else "--direction=${cfg.direction}";
|
||||
userDef = {
|
||||
options = {
|
||||
username = mkOption {
|
||||
type = types.nullOr types.string;
|
||||
};
|
||||
hashedPassword = mkOption {
|
||||
type = types.nullOr types.string;
|
||||
};
|
||||
sshKeys = mkOption {
|
||||
type = types.nullOr types.listOf types.string;
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.services.userdata = {
|
||||
|
@ -134,7 +121,7 @@ in
|
|||
description = ''
|
||||
Root SSH Keys
|
||||
'';
|
||||
type = types.nullOr types.listOf types.string;
|
||||
type = types.nullOr (types.listOf types.string);
|
||||
};
|
||||
timezone = mkOption {
|
||||
description = ''
|
||||
|
@ -147,7 +134,7 @@ in
|
|||
description = ''
|
||||
Users that will be created on the server
|
||||
'';
|
||||
type = with types; nullOr listOf attrsOf (submodule userDef);
|
||||
type = types.nullOr (types.listOf (types.attrsOf types.anything));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services = {
|
||||
userdata = builtins.fromJSON (builtins.readFile "./userdata/userdata.json");
|
||||
userdata = builtins.fromJSON (builtins.readFile ./userdata/userdata.json);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue