feat: moar nix
This commit is contained in:
parent
7e3bf4d6f3
commit
2025eb74a4
23 changed files with 1408 additions and 15 deletions
43
config/services/upsnap.nix
Normal file
43
config/services/upsnap.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.upsnap;
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://github.com/seriousm4x/UpSnap/releases/download/5.0.4/UpSnap_5.0.4_linux_amd64.zip";
|
||||
sha256 = "sha256:1qlav9if6f2c50rzakyilxgzmq2c5bzcs6lx1w7sffxhl440nxhs";
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
services.upsnap = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable UpSnap.
|
||||
'';
|
||||
};
|
||||
|
||||
bind = mkOption {
|
||||
type = types.str;
|
||||
default = "0.0.0.0:8090";
|
||||
description = ''
|
||||
The bind address/port
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.upsnap = {
|
||||
environment = {
|
||||
"HOME" = "/opt/upsnap";
|
||||
};
|
||||
name = "upsnap.service";
|
||||
enable = true;
|
||||
script = "${src} serve --http ${cfg.bind}";
|
||||
description = "UpSnap";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue