depot/ops/nixos/bvm-twitterchiver/default.nix

43 lines
906 B
Nix

# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ ... }:
{
imports = [
../lib/bvm.nix
];
# Networking!
networking = {
hostName = "bvm-twitterchiver";
hostId = "c7ff157c";
interfaces.enp1s0 = {
ipv4.addresses = [{ address = "10.100.0.201"; prefixLength = 23; }];
};
};
my.ip.tailscale = "100.119.86.55";
services.postgresql = {
enable = true;
ensureDatabases = [
"twitterchiver"
];
ensureUsers = [{
name = "twitterchiver";
ensurePermissions = { "DATABASE twitterchiver" = "ALL PRIVILEGES"; };
}];
};
services.postgresqlBackup.enable = true;
users.groups.twitterchiver = {};
users.users.twitterchiver = {
home = "/srv/twitterchiver";
isSystemUser = true;
createHome = true;
group = "twitterchiver";
};
system.stateVersion = "21.05";
}