feat: moar nix

This commit is contained in:
nullishamy 2025-06-18 21:41:53 +01:00
parent 7e3bf4d6f3
commit 2025eb74a4
Signed by: amy
SSH key fingerprint: SHA256:WmV0uk6WgAQvDJlM8Ld4mFPHZo02CLXXP5VkwQ5xtyk
23 changed files with 1408 additions and 15 deletions

44
config/services/kener.nix Normal file
View file

@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.kener;
src = builtins.fetchTarball {
url = "https://github.com/rajnandan1/kener/archive/refs/tags/3.2.12.tar.gz";
sha256 = "sha256:0a301jz8vqi2bd93k4lyabinshvadz084jfnkzrmxqrfr7w9gqbl";
};
in {
options = {
services.kener = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable Kener.
'';
};
};
};
config = mkIf cfg.enable {
systemd.services.kener =
let
kener = (pkgs.callPackage ./kener-pkg.nix {});
in {
path = [
pkgs.nodejs
pkgs.unixtools.ping
];
environment = {
"DATABASE_URL" = "sqlite:///opt/kener/kener.db";
"ORIGIN" = "https://amy.mov";
"KENER_SECRET_KEY" = "my-super-strong-key";
};
name = "kener.service";
enable = true;
script = "node ${kener}/main.js";
description = "Kener";
};
};
}