1
0
nuc-configurations/global/software-configuration.nix

88 lines
1.7 KiB
Nix
Raw Normal View History

2023-09-25 01:11:58 +00:00
{ pkgs, pkgs-unstable, ... }:
2023-09-25 00:15:15 +00:00
let
databases = [
"k3s"
"gitea"
"vaultwarden"
"saysthbot"
];
in
{
# Enable automatic login for the user.
services = {
logrotate.checkConfig = false;
sshd.enable = true;
ntp = {
enable = true;
servers = [
"ntp.ntsc.ac.cn" # China
];
};
k3s = {
enable = true;
2023-12-01 23:53:47 +00:00
package = pkgs-unstable.k3s_1_28;
2023-09-25 00:15:15 +00:00
configPath = "/etc/rancher/k3s/config.yaml";
};
postgresql = {
enable = true;
package = pkgs.postgresql_14;
authentication = ''
host all all 10.42.0.0/16 md5
host all all fd01::/56 md5
'';
enableTCPIP = true;
ensureDatabases = databases;
ensureUsers = [
{
name = "k3s";
2023-12-02 00:02:48 +00:00
ensureDBOwnership = true;
2023-09-25 00:15:15 +00:00
ensureClauses = {
login = true;
};
}
{
name = "gitea";
2023-12-02 00:02:48 +00:00
ensureDBOwnership = true;
2023-09-25 00:15:15 +00:00
ensureClauses = {
login = true;
};
}
{
name = "vaultwarden";
2023-12-02 00:02:48 +00:00
ensureDBOwnership = true;
2023-09-25 00:15:15 +00:00
ensureClauses = {
login = true;
};
}
{
name = "saysthbot";
2023-12-02 00:02:48 +00:00
ensureDBOwnership = true;
2023-09-25 00:15:15 +00:00
ensureClauses = {
login = true;
};
}
];
};
postgresqlBackup = {
enable = true;
databases = databases;
compressionLevel = 9;
location = "/backup/postgresql";
startAt = "*-*-* 01:15:00";
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
nerdctl
vim
gnumake42
2023-09-26 08:19:12 +00:00
git
2023-09-25 00:15:15 +00:00
];
}