X-Git-Url: https://gitweb.ps.run/flake_server/blobdiff_plain/1967a1ba5d8679be812b4075ad29337d07aa2ef6..eacd07da1b91fc1dc317b6da7fe8d22179e20d89:/configuration.nix?ds=inline diff --git a/configuration.nix b/configuration.nix index 3015dc8..5017789 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, chirp, ... }: { imports = @@ -19,6 +19,7 @@ # boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.package = pkgs.nixVersions.nix_2_28; networking.hostName = "nixos"; # Define your hostname. # Pick only one of the below networking options. @@ -27,7 +28,7 @@ networking.firewall = { enable = true; - allowedTCPPorts = [ 80 443 ]; + allowedTCPPorts = [ 80 443 9418 ]; }; # Set your time zone. @@ -48,9 +49,6 @@ # Enable the X11 windowing system. # services.xserver.enable = true; - - - # Configure keymap in X11 # services.xserver.xkb.layout = "us"; # services.xserver.xkb.options = "eurosign:e,caps:escape"; @@ -115,6 +113,8 @@ enable = true; config = { init.defaultBranch = "main"; + user.name = "Patrick"; + user.email = "patrick.schoenberger@posteo.de"; }; }; @@ -145,17 +145,54 @@ services.caddy = { enable = true; + virtualHosts."psch.dev".extraConfig = '' + respond "hello :D" + ''; virtualHosts."chirp.psch.dev".extraConfig = '' - reverse_proxy http://127.0.0.1:8080 + reverse_proxy http://localhost:8080 { + request_buffers 8192 + } tls { protocols tls1.3 tls1.3 } ''; virtualHosts."git.psch.dev".extraConfig = '' - reverse_proxy http://127.0.0.1:3000 ''; }; + # services.chirp = { + # enable = true; + # }; + users.users.chirp = { + isSystemUser = true; + group = "chirp"; + home = "/var/lib/chirp"; + createHome = true; + }; + users.groups.chirp = {}; + + systemd.services.chirp = { + description = "Chirp SystemD Service"; + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + serviceConfig = { + WorkingDirectory = "/var/lib/chirp"; + ExecStart = "${chirp.packages.${pkgs.system}.default}/bin/chirp"; + Restart = "always"; + Type = "simple"; + User = "chirp"; + Group = "chirp"; + }; + }; + + services.gitDaemon = { + enable = true; + basePath = "/srv/git"; + repositories = [ "/srv/git" ]; + exportAll = true; + port = 9418; + }; + # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];