# 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 =
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 = [ ... ];
{
"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"
"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": {
},
"root": {
"inputs": {
- "flake-utils": "flake-utils",
- "nixpkgs": "nixpkgs"
+ "chirp": "chirp",
+ "flake-utils": "flake-utils_2",
+ "nixpkgs": "nixpkgs_2"
}
},
"systems": {
"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",
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;
+ }
];
};
};