1
0
code.dumpstack.io/configuration.nix

94 lines
1.8 KiB
Nix
Raw 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}";
2024-06-24 10:12:16 +00:00
2022-03-20 16:33:00 +00:00
settings = {
2024-06-24 10:12:16 +00:00
server = {
root_url = "https://${hostname}";
domain = "${hostname}";
};
service = {
disable_registration = true;
2022-03-20 16:33:00 +00:00
};
2024-06-24 10:12:16 +00:00
attachment = {
enabled = false;
2022-03-20 16:33:00 +00:00
};
2024-06-24 10:12:16 +00:00
other = {
show_footer_version = false;
2022-03-20 16:33:00 +00:00
};
2024-06-24 10:12:16 +00:00
repository = {
signing = {
default_trust_model = "committer";
};
2022-03-20 16:33:00 +00:00
};
};
2019-02-02 19:45:05 +00:00
};
2024-06-24 10:12:16 +00:00
security.acme.defaults.email = "letsencrypt@dumpstack.io";
2022-03-20 16:33:00 +00:00
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
}