From: Patrick Date: Sun, 13 Apr 2025 20:01:14 +0000 (+0200) Subject: update config X-Git-Url: https://gitweb.ps.run/flake_server/commitdiff_plain/eacd07da1b91fc1dc317b6da7fe8d22179e20d89?hp=14b4c9f1028e9161b29ed10758ab5b23c5a857c1 update config --- diff --git a/configuration.nix b/configuration.nix index 4c1a2ba..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 = @@ -146,34 +146,52 @@ services.caddy = { enable = true; virtualHosts."psch.dev".extraConfig = '' - respond hello :D + respond "hello :D" ''; virtualHosts."chirp.psch.dev".extraConfig = '' - reverse_proxy http://localhost:8080 + reverse_proxy http://localhost:8080 { + request_buffers 8192 + } tls { protocols tls1.3 tls1.3 } ''; + virtualHosts."git.psch.dev".extraConfig = '' + ''; }; - services.dbus.enable = true; - - # virtualHosts."git.psch.dev".extraConfig = '' - # reverse_proxy unix//run/fcgiwrap.socket { - # transport fastcgi { - # split .cgi - # } - # } - # ''; - # 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."cgit".cgit = { - # enable = true; - # scanPath = "/srv/git"; - # }; + services.gitDaemon = { + enable = true; + basePath = "/srv/git"; + repositories = [ "/srv/git" ]; + exportAll = true; + port = 9418; + }; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; diff --git a/flake.lock b/flake.lock index 1c24d2e..8d45946 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "chirp": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1744574273, + "narHash": "sha256-1Pxl3Ew+P+YW0XI1Jz/K0O2/9X1g610ggx71LAXGHQ0=", + "ref": "refs/heads/main", + "rev": "d20342bd4fd63a9d098678c4a954c40fe48b7af7", + "revCount": 65, + "submodules": true, + "type": "git", + "url": "git://psch.dev/chirp" + }, + "original": { + "type": "git", + "url": "git://psch.dev/chirp" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -18,13 +38,47 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1744309437, - "narHash": "sha256-QZnNHM823am8apCqKSPdtnzPGTy2ZB4zIXOVoBp5+W0=", + "lastModified": 1744463964, + "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1744440957, + "narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f9ebe33a928b5d529c895202263a5ce46bdf12f7", + "rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d", "type": "github" }, "original": { @@ -36,8 +90,9 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "chirp": "chirp", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" } }, "systems": { @@ -54,6 +109,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 404062c..7ae4716 100644 --- a/flake.nix +++ b/flake.nix @@ -5,16 +5,18 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; flake-utils.url = "github:numtide/flake-utils"; - # chirp.url = "path:/srv/git/chirp"; + chirp.url = "git://psch.dev/chirp"; }; - outputs = { self, nixpkgs, flake-utils, ... }: { + outputs = { self, nixpkgs, flake-utils, chirp, ... }@inputs: { nixosConfigurations = { default = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ./configuration.nix - # chirp.nixosModules.default + { + config._module.args.chirp = chirp; + } ]; }; };