1
0
Fork 0
code.dumpstack.io/configuration.nix

91 lines
1.8 KiB
Nix
Raw Permalink Normal View History

2022-03-20 16:33:00 +00:00
# nix-channel --add https://nixos.org/channels/nixos-unstable nixos
# nix-channel --update
#
{ config, pkgs, lib, ... }:
2019-02-02 19:45:05 +00:00
let
secrets = import ./secrets.nix;
hostname = "code.dumpstack.io";
in {
imports = [
./hardware-configuration.nix
];
2019-02-02 19:45:05 +00:00
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/vda";
2022-03-20 16:33:00 +00:00
swapDevices = [
{ device = "/var/swapfile";
size = 2048; # MiB
}
];
networking.hostName = builtins.replaceStrings ["."] ["-"] "${hostname}";
2019-02-02 19:45:05 +00:00
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 443 ];
};
users.extraUsers.root = {
openssh.authorizedKeys.keys = [ secrets.pubkey ];
};
services.openssh.enable = true;
environment.systemPackages = with pkgs; [
vim
];
services.gitea = {
enable = true;
appName = "${hostname}";
domain = "${hostname}";
rootUrl = "https://${hostname}";
2022-03-20 16:33:00 +00:00
disableRegistration = true;
settings = {
"ui" = {
DEFAULT_THEME = "gitea";
};
"attachment" = {
ENABLED = true;
ALLOWED_TYPES = "*/*";
};
"other" = {
SHOW_FOOTER_VERSION = false;
};
"repository.signing" = {
DEFAULT_TRUST_MODEL = "committer";
};
};
2019-02-02 19:45:05 +00:00
};
2022-03-20 16:33:00 +00:00
security.acme.email = "letsencrypt@dumpstack.io";
security.acme.acceptTerms = true;
2019-02-02 19:45:05 +00:00
services.nginx = {
enable = true;
virtualHosts."${hostname}" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://127.0.0.1:3000";
};
};
2022-03-20 16:33:00 +00:00
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
2019-04-12 17:24:45 +00:00
system.stateVersion = "19.03";
2019-04-12 17:25:39 +00:00
2019-04-12 17:41:59 +00:00
nix = {
optimise.automatic = true;
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
};
2019-02-02 19:45:05 +00:00
}