my Nix configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pub.nix 702B

12345678910111213141516171819202122232425
  1. { config, pkgs, lib, ... }:
  2. let cfg = config.services.yorick.public; in
  3. {
  4. options.services.yorick.public = {
  5. enable = lib.mkEnableOption "public hosting";
  6. vhost = lib.mkOption { type = lib.types.string; };
  7. };
  8. #imports = [../modules/nginx.nix];
  9. config = lib.mkIf cfg.enable {
  10. users.extraUsers.public = {
  11. home = "/home/public";
  12. useDefaultShell = true;
  13. openssh.authorizedKeys.keys = with (import ../sshkeys.nix); [public];
  14. createHome = true;
  15. };
  16. services.nginx.virtualHosts.${cfg.vhost} = {
  17. forceSSL = true;
  18. enableACME = true;
  19. locations."/" = {
  20. root = "/home/public/public";
  21. index = "index.html";
  22. };
  23. };
  24. };
  25. }