aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-12-22 15:15:31 -0500
committerXe Iaso <me@xeiaso.net>2024-12-22 15:15:31 -0500
commit055f65719a2caf68d0504b2ca12680115a08a6e7 (patch)
treeed09e8aa8b1245213c4398899d3503dd168e5cfa
parent4224f3e264f8d68c987257241cbb81b71598b5d4 (diff)
downloadx-055f65719a2caf68d0504b2ca12680115a08a6e7.tar.xz
x-055f65719a2caf68d0504b2ca12680115a08a6e7.zip
prune nix
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--.envrc2
-rw-r--r--.go.mod.sri1
-rwxr-xr-xbumperate.sh8
-rw-r--r--flake.lock207
-rw-r--r--flake.nix575
-rw-r--r--nix/aegis.nix52
-rw-r--r--nix/hlang.nix76
-rw-r--r--nix/sanguisuga.nix47
-rw-r--r--nix/todayinmarch2020.nix65
-rw-r--r--nix/vest-pit-near.nix50
-rw-r--r--nix/within-website.nix56
11 files changed, 0 insertions, 1139 deletions
diff --git a/.envrc b/.envrc
deleted file mode 100644
index 66b5e68..0000000
--- a/.envrc
+++ /dev/null
@@ -1,2 +0,0 @@
-use flake
-watch_file .go.mod.sri
diff --git a/.go.mod.sri b/.go.mod.sri
deleted file mode 100644
index 7674959..0000000
--- a/.go.mod.sri
+++ /dev/null
@@ -1 +0,0 @@
-sha256-2jimy336TEScL1GNeD9xH4FkhCx7h1gCFxFffBXOfM4=
diff --git a/bumperate.sh b/bumperate.sh
deleted file mode 100755
index 2cbf3b7..0000000
--- a/bumperate.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-OUT=$(mktemp -d -t nar-hash-XXXXXX)
-rm -rf $OUT
-
-go mod vendor -o $OUT
-go run tailscale.com/cmd/nardump --sri $OUT > .go.mod.sri
-rm -rf $OUT
diff --git a/flake.lock b/flake.lock
deleted file mode 100644
index feca571..0000000
--- a/flake.lock
+++ /dev/null
@@ -1,207 +0,0 @@
-{
- "nodes": {
- "alpineLinux": {
- "flake": false,
- "locked": {
- "narHash": "sha256-5GM+4nNrWrE3idQiWlAq7bghb7IE6j/JncEfG1qM4jM=",
- "type": "file",
- "url": "https://cdn.xeiaso.net/file/christine-static/hack/alpine-amd64-3.19.0-1.tar"
- },
- "original": {
- "type": "file",
- "url": "https://cdn.xeiaso.net/file/christine-static/hack/alpine-amd64-3.19.0-1.tar"
- }
- },
- "iaso-fonts": {
- "inputs": {
- "nixpkgs": "nixpkgs",
- "utils": "utils"
- },
- "locked": {
- "lastModified": 1698939764,
- "narHash": "sha256-CH68pMKscwAxi/N5xbRlZ5i2NNzMZx6fjzcQkPN3bSw=",
- "owner": "Xe",
- "repo": "iosevka",
- "rev": "faa4a6ed96820a85790244f9b65c4b0f4604ae2d",
- "type": "github"
- },
- "original": {
- "owner": "Xe",
- "repo": "iosevka",
- "type": "github"
- }
- },
- "naersk": {
- "inputs": {
- "nixpkgs": [
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1721727458,
- "narHash": "sha256-r/xppY958gmZ4oTfLiHN0ZGuQ+RSTijDblVgVLFi1mw=",
- "owner": "nix-community",
- "repo": "naersk",
- "rev": "3fb418eaf352498f6b6c30592e3beb63df42ef11",
- "type": "github"
- },
- "original": {
- "owner": "nix-community",
- "repo": "naersk",
- "type": "github"
- }
- },
- "nixpkgs": {
- "locked": {
- "lastModified": 1698611440,
- "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735",
- "type": "github"
- },
- "original": {
- "id": "nixpkgs",
- "ref": "nixos-unstable",
- "type": "indirect"
- }
- },
- "nixpkgs_2": {
- "locked": {
- "lastModified": 1723637854,
- "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
- "type": "github"
- },
- "original": {
- "id": "nixpkgs",
- "ref": "nixos-unstable",
- "type": "indirect"
- }
- },
- "root": {
- "inputs": {
- "alpineLinux": "alpineLinux",
- "iaso-fonts": "iaso-fonts",
- "naersk": "naersk",
- "nixpkgs": "nixpkgs_2",
- "rust-overlay": "rust-overlay",
- "utils": "utils_2",
- "xess": "xess"
- }
- },
- "rust-overlay": {
- "inputs": {
- "nixpkgs": [
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1723774846,
- "narHash": "sha256-m53hVat6XXiKooV1oUDEMnPcdNKqSn/kAW+g8juSq84=",
- "owner": "oxalica",
- "repo": "rust-overlay",
- "rev": "519f4892641bc04a6ac7c2d260cc68356f9ae90f",
- "type": "github"
- },
- "original": {
- "owner": "oxalica",
- "repo": "rust-overlay",
- "type": "github"
- }
- },
- "systems": {
- "locked": {
- "lastModified": 1681028828,
- "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
- "owner": "nix-systems",
- "repo": "default",
- "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
- "type": "github"
- },
- "original": {
- "owner": "nix-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"
- }
- },
- "utils": {
- "inputs": {
- "systems": "systems"
- },
- "locked": {
- "lastModified": 1694529238,
- "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
- }
- },
- "utils_2": {
- "inputs": {
- "systems": "systems_2"
- },
- "locked": {
- "lastModified": 1710146030,
- "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
- }
- },
- "xess": {
- "inputs": {
- "nixpkgs": [
- "nixpkgs"
- ],
- "utils": [
- "utils"
- ]
- },
- "locked": {
- "lastModified": 1690727923,
- "narHash": "sha256-9+CctgoaS3QHqP9rhlNBXSlnGliXtAb1sxC2uuPNK2g=",
- "owner": "Xe",
- "repo": "Xess",
- "rev": "8dd92fef20723d73f3784b2344d03f847d14b801",
- "type": "github"
- },
- "original": {
- "owner": "Xe",
- "repo": "Xess",
- "type": "github"
- }
- }
- },
- "root": "root",
- "version": 7
-}
diff --git a/flake.nix b/flake.nix
deleted file mode 100644
index 2219636..0000000
--- a/flake.nix
+++ /dev/null
@@ -1,575 +0,0 @@
-{
- description = "/x/perimental code";
-
- inputs = {
- nixpkgs.url = "nixpkgs/nixos-unstable";
- utils.url = "github:numtide/flake-utils";
-
- naersk = {
- url = "github:nix-community/naersk";
- inputs.nixpkgs.follows = "nixpkgs";
- };
-
- rust-overlay = {
- url = "github:oxalica/rust-overlay";
- inputs.nixpkgs.follows = "nixpkgs";
- inputs.flake-utils.follows = "utils";
- };
-
- xess = {
- url = "github:Xe/Xess";
- inputs.nixpkgs.follows = "nixpkgs";
- inputs.utils.follows = "utils";
- };
-
- ## don't follow nixpkgs because that causes a very long font build process.
- iaso-fonts.url = "github:Xe/iosevka";
-
- alpineLinux = {
- flake = false;
- url = "file+https://cdn.xeiaso.net/file/christine-static/hack/alpine-amd64-3.19.0-1.tar";
- };
- };
-
- outputs =
- { self, nixpkgs, utils, rust-overlay, naersk, xess, iaso-fonts, alpineLinux }@inputs:
- utils.lib.eachSystem [
- "x86_64-linux"
- "aarch64-linux"
- "x86_64-darwin"
- "aarch64-darwin"
- ]
- (system:
- let
- graft = pkgs: pkg:
- pkg.override { buildGoModule = pkgs.buildGo123Module; };
- pkgs = import nixpkgs {
- inherit system;
- overlays = [
- (final: prev: {
- go = prev.go_1_23;
- go-tools = graft prev prev.go-tools;
- gotools = graft prev prev.gotools;
- gopls = graft prev prev.gopls;
- })
- rust-overlay.overlays.default
- #(final: prev: self.packages.${system})
- ];
- };
-
- vendorHash = pkgs.lib.fileContents ./.go.mod.sri;
-
- version = "${self.sourceInfo.lastModifiedDate}";
-
- rust = pkgs.rust-bin.stable.latest.default.override {
- extensions = [ "rust-src" "rust-analysis" "clippy" "rustfmt" ];
- targets = [
- "wasm32-wasi"
- "wasm32-unknown-unknown"
- "riscv64gc-unknown-linux-gnu"
- ];
- };
-
- naersk' = pkgs.callPackage naersk {
- cargo = rust;
- rustc = rust;
- };
-
- everything = pkgs.buildGo123Module {
- pname = "xe-x-composite";
- inherit version vendorHash;
- src = ./.;
-
- nativeBuildInputs = with pkgs; [ pkg-config ];
- buildInputs = with pkgs; [
- pkg-config
- libaom
- libavif
- sqlite-interactive
- ];
- };
-
- future-sight = pkgs.buildGo123Module {
- pname = "future-sight";
- inherit version vendorHash;
- src = ./.;
- subPackages = [ "cmd/future-sight" ];
- };
-
- mi = pkgs.buildGo123Module {
- pname = "mi";
- inherit version vendorHash;
- src = ./.;
- subPackages = [ "cmd/mi" ];
- };
-
- mimi = pkgs.buildGo123Module {
- pname = "mimi";
- inherit version vendorHash;
- src = ./.;
- subPackages = [ "cmd/mimi" ];
- buildInputs = with pkgs; [
- cmake
- libheif
- x265
- libde265
- libjpeg
- libtool
- ];
- };
-
- within-website = pkgs.buildGo123Module {
- pname = "within.website";
- inherit version vendorHash;
- src = ./.;
- subPackages = [ "cmd/within.website" ];
- };
-
- azurda = pkgs.buildGo123Module {
- pname = "azurda";
- inherit version vendorHash;
- src = ./.;
- subPackages = [ "cmd/azurda" ];
- };
-
- tourian = pkgs.buildGo123Module {
- pname = "tourian";
- inherit version vendorHash;
- src = ./.;
- subPackages = [ "cmd/tourian" ];
- };
-
- xedn = pkgs.buildGo123Module {
- pname = "xedn";
- inherit version vendorHash;
- src = ./.;
- subPackages = [ "cmd/xedn" "cmd/xedn/uplodr" ];
-
- nativeBuildInputs = with pkgs; [ pkg-config ];
- buildInputs = with pkgs; [ pkg-config libaom libavif ];
- };
-
- xedn-static = pkgs.stdenvNoCC.mkDerivation {
- dontUnpack = true;
- pname = "xedn-static";
- version = xedn.version;
-
- buildPhase = ''
- mkdir -p $out/static/css/iosevka
- mkdir -p $out/static/pkg/iosevka
- mkdir -p $out/static/pkg/xess
- mkdir -p $out/static/pkg/xeact
-
- tar xf ${
- pkgs.fetchurl {
- name = "xeact-0.69.71";
- url =
- "https://registry.npmjs.org/@xeserv/xeact/-/xeact-0.69.71.tgz";
- sha256 = "19rfg5fbiz69vh4hzg6694szm9agz3hfk4sfsfj6ws0cq4ss805l";
- }
- }
-
- mkdir -p $out/static/pkg/xeact/0.69.71
- cp -vrf ./package/* $out/static/pkg/xeact/0.69.71
- rm -rf package
-
- tar xf ${
- pkgs.fetchurl {
- name = "xeact-0.70.0";
- url =
- "https://registry.npmjs.org/@xeserv/xeact/-/xeact-0.70.0.tgz";
- sha256 = "1mxwrs04vj1mixs418cy7gd5dy3nfaqcc00vmrjwsgzc36wnmwxz";
- }
- }
-
- mkdir -p $out/static/pkg/xeact/0.70.0
- cp -vrf ./package/* $out/static/pkg/xeact/0.70.0
- rm -rf package
-
- tar xf ${
- pkgs.fetchurl {
- name = "xeact-0.71.0";
- url =
- "https://registry.npmjs.org/@xeserv/xeact/-/xeact-0.71.0.tgz";
- sha256 = "069qky042lmlvslbgsyl9j8jmkhl2hr6hy5slf1b03g3fzvkp6x4";
- }
- }
-
- mkdir -p $out/static/pkg/xeact/0.71.0
- cp -vrf ./package/* $out/static/pkg/xeact/0.71.0
- rm -rf package
-
- ln -s ${
- xess.packages.${system}.aoi
- }/static/css/xess.css $out/static/css/xess.css
- for file in ${iaso-fonts.packages.${system}.default}/*; do
- ln -s $file $out/static/css/iosevka
- ln -s $file $out/static/pkg/iosevka
- done
-
- for file in ${xess.packages.${system}.combined}/*; do
- ln -s $file $out/static/pkg/xess
- done
-
- mkdir -p $out/static/pkg/podkova
- cp ${./xess/static/podkova.css} $out/static/pkg/podkova/family.css
- cp ${./xess/static/podkova.woff2} $out/static/pkg/podkova/podkova.woff2
- '';
- };
-
- robocadey2 = pkgs.buildGo123Module {
- pname = "robocadey2";
- inherit version vendorHash;
- src = ./.;
- nativeBuildInputs = with pkgs; [ pkg-config ];
- subPackages = [ "cmd/robocadey2" ];
- };
-
- sapientwindex = pkgs.buildGo123Module {
- pname = "sapientwindex";
- inherit version vendorHash;
- src = ./.;
- nativeBuildInputs = with pkgs; [ pkg-config ];
- subPackages = [ "cmd/sapientwindex" ];
- };
-
- copyFile = { pname, path ? pname }:
- pkgs.stdenv.mkDerivation {
- inherit pname;
- inherit (everything) version;
- src = everything;
-
- installPhase = ''
- mkdir -p $out/bin
- cp $src/bin/$pname $out/bin/$path
- '';
- };
-
- gowasi = pkgs.writeShellScriptBin "gowasi" ''
- export GOOS=wasip1
- export GOARCH=wasm
- exec ${pkgs.go}/bin/go $*
- '';
- in
- {
- overlays.default = final: prev:
- let
- system = prev.system;
- selfpkgs = self.packages.${system};
- in
- { xeserv = selfpkgs; };
-
- packages = rec {
- default = everything;
-
- mastosan-wasm = naersk'.buildPackage {
- src = ./web/mastosan;
- targets = [ "wasm32-wasi" ];
- };
-
- license = copyFile {
- pname = "license";
- path = "xlicense";
- };
- makeMastodonApp = copyFile {
- pname = "mkapp";
- path = "make-mastodon-app";
- };
-
- inherit xedn xedn-static future-sight robocadey2 azurda mimi mi tourian sapientwindex within-website;
-
- aegis = copyFile { pname = "aegis"; };
- cadeybot = copyFile { pname = "cadeybot"; };
- hlang = copyFile { pname = "hlang"; };
- johaus = copyFile { pname = "johaus"; };
- mainsanow = copyFile { pname = "mainsanow"; };
- prefix = copyFile { pname = "prefix"; };
- quickserv = copyFile { pname = "quickserv"; };
- sanguisuga = copyFile { pname = "sanguisuga"; };
- todayinmarch2020 = copyFile { pname = "todayinmarch2020"; };
- uploud = copyFile { pname = "uploud"; };
- vest-pit-near = copyFile { pname = "vest-pit-near"; };
- whoisfront = copyFile { pname = "whoisfront"; };
- yeet = copyFile { pname = "yeet"; };
- };
-
- legacyPackages = {
- docker =
- let
- robocadey2 = self.packages.${system}.robocadey2;
- xedn = self.packages.${system}.xedn;
- mi = self.packages.${system}.mi;
- mimi = self.packages.${system}.mimi;
- sapientwindex = self.packages.${system}.sapientwindex;
- tourian = self.packages.${system}.tourian;
- azurda = self.packages.${system}.azurda;
- within-website = self.packages.${system}.within-website;
- hlang = self.packages.${system}.hlang;
- future-sight = self.packages.${system}.future-sight;
-
- simple = { name, cmd, pkg, contents ? [ pkgs.cacert ] }:
- pkgs.dockerTools.buildLayeredImage {
- tag = "latest";
- inherit contents name;
- fromImage = alpineLinux;
- config = {
- Cmd = cmd;
- WorkingDir = "${pkg}";
- };
- };
- in
- {
- future-sight = simple {
- name = "ghcr.io/xe/x/future-sight";
- pkg = future-sight;
- cmd = [ "${future-sight}/bin/future-sight" ];
- };
- within-website = simple {
- name = "ghcr.io/xe/x/within-website";
- pkg = within-website;
- contents = with pkgs; [ cacert ];
- cmd = [ "${within-website}/bin/within.website" ];
- };
- azurda = simple {
- name = "registry.fly.io/azurda";
- pkg = azurda;
- contents = with pkgs; [ cacert ];
- cmd = [ "${azurda}/bin/azurda" ];
- };
- mi = simple {
- name = "ghcr.io/xe/x/mi";
- pkg = mi;
- contents = with pkgs; [ cacert sqlite-interactive ];
- cmd = [ "${mi}/bin/mi" ];
- };
- johaus = simple {
- name = "ghcr.io/xe/x/johaus";
- pkg = hlang;
- cmd = [ "${hlang}/bin/johaus" "-port=8080" ];
- };
- hlang = simple {
- name = "ghcr.io/xe/x/hlang";
- pkg = hlang;
- cmd = [ "${hlang}/bin/hlang" "-port=8080" ];
- };
- sapientwindex = simple {
- name = "ghcr.io/xe/x/sapientwindex";
- pkg = sapientwindex;
- cmd = [ "${sapientwindex}/bin/sapientwindex" ];
- };
- mimi = pkgs.dockerTools.buildLayeredImage {
- name = "ghcr.io/xe/x/mimi";
- tag = "latest";
- contents = with pkgs; [ cacert imagemagick ];
- fromImage = alpineLinux;
- config = {
- Cmd = [ "${mimi}/bin/mimi" ];
- WorkingDir = "${mimi}";
- };
- };
- robocadey2 = pkgs.dockerTools.buildLayeredImage {
- name = "registry.fly.io/xe-robocadey2";
- tag = "latest";
- contents = [ pkgs.cacert ];
- config = {
- Cmd = [ "${robocadey2}/bin/robocadey2" ];
- WorkingDir = "${robocadey2}";
- };
- };
- tourian = pkgs.dockerTools.buildLayeredImage {
- name = "registry.fly.io/tourian";
- tag = "latest";
- contents = [ pkgs.cacert ];
- config = {
- Cmd = [ "${tourian}/bin/tourian" ];
- WorkingDir = "${tourian}";
- };
- };
- xedn = pkgs.dockerTools.buildLayeredImage {
- name = "registry.fly.io/xedn";
- tag = "latest";
- contents =
- [ pkgs.cacert xedn self.packages.${system}.xedn-static ];
- config = {
- Cmd = [ "${xedn}/bin/xedn" ];
- WorkingDir = "${xedn}";
- Env = [ "XEDN_STATIC=${self.packages.${system}.xedn-static}" ];
- };
- };
- };
- portable = {
- xedn =
- let
- service = pkgs.substituteAll {
- name = "xedn.service";
- src = ./run/xedn.service.in;
- xedn = self.packages.${system}.xedn;
- };
- in
- pkgs.portableService {
- inherit (self.packages.${system}.xedn) version;
- pname = "xedn";
- description = "Xe's CDN service";
- homepage = "https://xeiaso.net";
- units = [ service ];
- symlinks = [{
- object = "${pkgs.cacert}/etc/ssl";
- symlink = "/etc/ssl";
- }];
- };
- };
- };
-
- devShells.default = pkgs.mkShell {
- buildInputs = with pkgs; [
- go
- gopls
- gotools
- go-tools
- python3
- hey
- boltbrowser
- opentofu
- litestream
- nodejs
- deno
- esbuild
- tailwindcss
-
- python3Packages.huggingface-hub
- python3Packages.datasets
-
- perl
-
- pkg-config
- libaom
- libavif
- sqlite-interactive
- imagemagick
-
- jq
- jo
-
- cargo-watch
- wasmtime
- binaryen
- wabt
- bloaty
- rust
- flyctl
-
- # kubermemes
- kubectl
- kubevirt
- k9s
-
- protobuf
- protoc-gen-go
- protoc-gen-twirp
- protoc-gen-go-grpc
-
- gowasi
- ];
-
- GOAMD64 = "v3";
- XEDN_STATIC = self.packages.${system}.xedn-static;
- };
- }) // {
- nixosModules = {
- overlay = { ... }: {
- nixpkgs.overlays = [
- (final: prev:
- let
- system = prev.system;
- selfpkgs = self.packages.${system};
- in
- { xeserv = selfpkgs; })
- ];
- };
-
- default = { ... }: {
- imports = with self.nixosModules; [
- overlay
- aegis
- hlang
- todayinmarch2020
- sanguisuga
- vest-pit-near
- within-website
- ];
- };
-
- aegis = import ./nix/aegis.nix self;
- hlang = import ./nix/hlang.nix self;
- todayinmarch2020 = import ./nix/todayinmarch2020.nix self;
- sanguisuga = import ./nix/sanguisuga.nix self;
- vest-pit-near = import ./nix/vest-pit-near.nix self;
- within-website = import ./nix/within-website.nix self;
- };
-
- checks.x86_64-linux =
- let
- pkgs = nixpkgs.legacyPackages.x86_64-linux;
- common = { pkgs, ... }: {
- users.groups.within = { };
- systemd.services.within-homedir-setup = {
- description = "Creates homedirs for /srv/within services";
- wantedBy = [ "multi-user.target" ];
-
- serviceConfig.Type = "oneshot";
-
- script = with pkgs; ''
- ${coreutils}/bin/mkdir -p /srv/within
- ${coreutils}/bin/chown root:within /srv/within
- ${coreutils}/bin/chmod 775 /srv/within
- ${coreutils}/bin/mkdir -p /srv/within/run
- ${coreutils}/bin/chown root:within /srv/within/run
- ${coreutils}/bin/chmod 770 /srv/within/run
- '';
- };
- };
- in
- {
- basic = pkgs.nixosTest ({
- name = "basic-tests";
- nodes.default = { config, pkgs, ... }: {
- imports = [ common self.nixosModules.default ];
-
- xeserv.services = {
- aegis.enable = true;
- hlang.enable = true;
- todayinmarch2020.enable = true;
- within-website.enable = true;
- };
- };
-
- testScript = ''
- start_all()
-
- default.wait_for_unit("hlang.service")
- print(
- default.wait_until_succeeds(
- "curl --unix-socket /srv/within/run/hlang.sock http://foo/"
- )
- )
-
- default.wait_for_unit("todayinmarch2020.service")
- print(
- default.wait_until_succeeds(
- "curl --unix-socket /srv/within/run/todayinmarch2020.sock http://foo/"
- )
- )
-
- default.wait_for_unit("within-website.service")
- print(
- default.wait_until_succeeds(
- "curl http://127.0.0.1:52838/"
- )
- )
-
- default.wait_for_unit("aegis.service")
- '';
- });
- };
- };
-}
diff --git a/nix/aegis.nix b/nix/aegis.nix
deleted file mode 100644
index bd67e79..0000000
--- a/nix/aegis.nix
+++ /dev/null
@@ -1,52 +0,0 @@
-self:
-{ config, lib, pkgs, ... }:
-with lib;
-let
- system = pkgs.system;
- cfg = config.xeserv.services.aegis;
- selfpkgs = self.packages.${system};
-in {
- options.xeserv.services.aegis = {
- enable = mkEnableOption "Activates Aegis (unix socket prometheus proxy)";
-
- hostport = mkOption {
- type = types.str;
- default = "[::1]:31337";
- description = "The host:port that aegis should listen for traffic on";
- };
-
- sockdir = mkOption {
- type = types.str;
- default = "/srv/within/run";
- example = "/srv/within/run";
- description = "The folder that aegis will read from";
- };
- };
-
- config = mkIf cfg.enable {
- users.users.aegis = {
- createHome = true;
- description = "tulpa.dev/cadey/aegis";
- isSystemUser = true;
- group = "within";
- home = "/srv/within/aegis";
- };
-
- systemd.services.aegis = {
- wantedBy = [ "multi-user.target" ];
-
- serviceConfig = {
- User = "aegis";
- Group = "within";
- Restart = "on-failure";
- WorkingDirectory = "/srv/within/aegis";
- RestartSec = "30s";
- };
-
- script = let aegis = selfpkgs.aegis;
- in ''
- exec ${aegis}/bin/aegis -sockdir="${cfg.sockdir}" -hostport="${cfg.hostport}"
- '';
- };
- };
-}
diff --git a/nix/hlang.nix b/nix/hlang.nix
deleted file mode 100644
index b625fdb..0000000
--- a/nix/hlang.nix
+++ /dev/null
@@ -1,76 +0,0 @@
-self:
-{ config, pkgs, lib, ... }:
-
-with lib;
-
-let cfg = config.xeserv.services.hlang;
-in {
- options.xeserv.services.hlang = {
- enable = mkEnableOption "Enables the H programming language";
- useACME = mkEnableOption "Enables ACME for cert stuff";
-
- domain = mkOption {
- type = types.str;
- default = "hlang.akua";
- example = "h.christine.website";
- description =
- "The domain name that nginx should check against for HTTP hostnames";
- };
-
- port = mkOption {
- type = types.int;
- default = 38288;
- example = 9001;
- description = "The port number hlang should listen on for HTTP traffic";
- };
-
- sockPath = mkOption rec {
- type = types.str;
- default = "/srv/within/run/hlang.sock";
- example = default;
- description = "The unix domain socket that printerfacts should listen on";
- };
- };
-
- config = mkIf cfg.enable {
- users.users.hlang = {
- createHome = true;
- description = "tulpa.dev/cadey/hlang";
- isSystemUser = true;
- group = "within";
- home = "/srv/within/hlang";
- };
-
- systemd.services.hlang = {
- wantedBy = [ "multi-user.target" ];
- after = [ "within-homedir.service" ];
-
- serviceConfig = {
- User = "hlang";
- Group = "within";
- Restart = "on-failure";
- WorkingDirectory = "/srv/within/hlang";
- RestartSec = "30s";
- UMask = "007";
- };
-
- script = let h = self.packages.${pkgs.system}.hlang;
- in ''
- export PATH=${pkgs.wabt}/bin:$PATH
- exec ${h}/bin/hlang -port=${toString cfg.port} -sockpath=${cfg.sockPath}
- '';
- };
-
- services.cfdyndns = mkIf cfg.useACME { records = [ "${cfg.domain}" ]; };
-
- services.nginx.virtualHosts."${cfg.domain}" = {
- serverName = "${cfg.domain}";
- locations."/".proxyPass = "http://unix:${cfg.sockPath}";
- forceSSL = cfg.useACME;
- enableACME = cfg.useACME;
- extraConfig = ''
- access_log /var/log/nginx/hlang.access.log;
- '';
- };
- };
-}
diff --git a/nix/sanguisuga.nix b/nix/sanguisuga.nix
deleted file mode 100644
index bf784ef..0000000
--- a/nix/sanguisuga.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-self:
-{ config, lib, pkgs, ... }:
-with lib;
-let
- system = pkgs.system;
- cfg = config.xeserv.services.sanguisuga;
- selfpkgs = self.packages.${system};
-in {
- options.xeserv.services.sanguisuga = {
- enable = mkEnableOption "Enables the sanguisuga torrent leeching agent";
-
- package = mkOption {
- type = types.package;
- default = selfpkgs.sanguisuga;
- description = "the package containing the sanguisuga binary";
- };
- };
- config = mkIf cfg.enable {
- users.users.sanguisuga = {
- isSystemUser = true;
- group = "sanguisuga";
- extraGroups = ["within"];
- createHome = true;
- };
- users.groups.sanguisuga = {};
- systemd.services.sanguisuga = {
- wantedBy = [ "multi-user.target" ];
- environment = {
- HOME = "/var/lib/sanguisuga";
- STATE_DIR = "/var/lib/sanguisuga";
- };
- path = with pkgs; [ docker ];
- serviceConfig = {
- User = "sanguisuga";
- Group = "sanguisuga";
- Restart = "always";
- RestartSec = "30s";
- ExecStart = "${cfg.package}/bin/sanguisuga --external-seed";
- RuntimeDirectory = "sanguisuga";
- RuntimeDirectoryMode = "0755";
- CacheDirectory = "sanguisuga";
- CacheDirectoryMode = "0750";
- WorkingDirectory = "/var/lib/sanguisuga";
- };
- };
- };
-}
diff --git a/nix/todayinmarch2020.nix b/nix/todayinmarch2020.nix
deleted file mode 100644
index 3bc9d10..0000000
--- a/nix/todayinmarch2020.nix
+++ /dev/null
@@ -1,65 +0,0 @@
-self:
-{ config, pkgs, lib, ... }:
-with lib;
-let
- system = pkgs.system;
- selfpkgs = self.packages.${system};
- cfg = config.xeserv.services.todayinmarch2020;
-in {
- options.xeserv.services.todayinmarch2020 = {
- enable = mkEnableOption "Lets you find out what day in 2020 today is";
- useACME = mkEnableOption "Enables ACME for cert stuff";
-
- domain = mkOption {
- type = types.str;
- default = "todayinmarch2020.xn--sz8hf6d.ws";
- example = "todayinmarch2020.xn--sz8hf6d.ws";
- description =
- "The domain name that nginx should check against for HTTP hostnames";
- };
-
- sockPath = mkOption rec {
- type = types.str;
- default = "/srv/within/run/todayinmarch2020.sock";
- example = default;
- description = "The unix domain socket that printerfacts should listen on";
- };
- };
-
- config = mkIf cfg.enable {
- users.users.todayinmarch2020 = {
- createHome = true;
- description = "tulpa.dev/cadey/todayinmarch2020";
- isSystemUser = true;
- group = "within";
- home = "/srv/within/todayinmarch2020";
- };
-
- systemd.services.todayinmarch2020 = {
- wantedBy = [ "multi-user.target" ];
- after = [ "within-homedir.service" ];
-
- serviceConfig = {
- User = "todayinmarch2020";
- Group = "within";
- Restart = "on-failure";
- WorkingDirectory = "/srv/within/todayinmarch2020";
- RestartSec = "30s";
- UMask = "007";
- };
-
- script = ''
- exec ${s