diff --git a/machines/DavidsServer/configuration.nix b/machines/DavidsServer/configuration.nix new file mode 100644 index 0000000..e1e605b --- /dev/null +++ b/machines/DavidsServer/configuration.nix @@ -0,0 +1,18 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ + imports = [ + ./hardware-configuration.nix + ]; + + system.autoUpgrade.enable = false; + + programs.zsh.promptInit = "PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[magenta]%}%n@)%m %{$fg_bold[green]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '"; + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system.stateVersion = "19.03"; +} diff --git a/machines/DavidsServer/options.nix b/machines/DavidsServer/options.nix new file mode 100644 index 0000000..606b836 --- /dev/null +++ b/machines/DavidsServer/options.nix @@ -0,0 +1,44 @@ +{ lib, ... }: + +with lib; + +{ + imports = [ + ../../options/machine.nix + ]; + + config.machine = rec { + hostName = "DavidsServer"; + administrators = [ { name = "david"; id = 1000; } ]; + mailAccounts = [ "david" ]; + domain = "davids-planet.de"; + allowUnfree = true; + conffiles = [ + "security" + "zsh" + ]; + pkgs = [ + "base" + "server" + ]; + services = [ + "fail2ban" + "mailserver" + "mariaDB" + "nextcloud" + "nginx" + "openssh" + ]; + vHosts = (let base = domain; in [ + { domain = base; service = "nextcloud"; } + { domain = "mail.${base}"; service = "mail"; } + ]); + firewall = { + allowPing = false; + allowedUDPPorts = [ 22 80 443 ]; + allowedTCPPorts = [ 80 443 ]; + allowedUDPPortRanges = []; + allowedTCPPortRanges = []; + }; + }; +}