parent
927839fdcb
commit
92eb5bc48e
@ -0,0 +1,62 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
with lib; |
||||
|
||||
let |
||||
cfg = config.services.ethercalc; |
||||
in { |
||||
options = { |
||||
services.ethercalc = { |
||||
enable = mkOption { |
||||
default = false; |
||||
type = types.bool; |
||||
description = '' |
||||
ethercalc, an online collaborative spreadsheet server. |
||||
|
||||
Persistent state will be maintained under |
||||
<filename>/var/lib/ethercalc</filename>. Upstream supports using a |
||||
redis server for storage and recommends the redis backend for |
||||
intensive use; however, the Nix module doesn't currently support |
||||
redis. |
||||
|
||||
Note that while ethercalc is a good and robust project with an active |
||||
issue tracker, there haven't been new commits since the end of 2020. |
||||
''; |
||||
}; |
||||
|
||||
package = mkOption { |
||||
default = pkgs.ethercalc; |
||||
defaultText = literalExpression "pkgs.ethercalc"; |
||||
type = types.package; |
||||
description = "Ethercalc package to use."; |
||||
}; |
||||
|
||||
host = mkOption { |
||||
type = types.str; |
||||
default = "0.0.0.0"; |
||||
description = "Address to listen on (use 0.0.0.0 to allow access from any address)."; |
||||
}; |
||||
|
||||
port = mkOption { |
||||
type = types.port; |
||||
default = 8000; |
||||
description = "Port to bind to."; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
systemd.services.ethercalc = { |
||||
description = "Ethercalc service"; |
||||
wantedBy = [ "multi-user.target" ]; |
||||
after = [ "network.target" ]; |
||||
serviceConfig = { |
||||
DynamicUser = true; |
||||
ExecStart = "${cfg.package}/bin/ethercalc --host ${cfg.host} --port ${toString cfg.port}"; |
||||
Restart = "always"; |
||||
StateDirectory = "ethercalc"; |
||||
WorkingDirectory = "/var/lib/ethercalc"; |
||||
}; |
||||
}; |
||||
}; |
||||
} |
@ -0,0 +1,27 @@ |
||||
{ stdenv |
||||
, pkgs |
||||
, lib |
||||
, nodejs-14_x |
||||
}: |
||||
|
||||
let |
||||
nodejs = nodejs-14_x; |
||||
|
||||
nodePackages = import ./node-packages.nix { |
||||
inherit pkgs nodejs; |
||||
inherit (stdenv.hostPlatform) system; |
||||
}; |
||||
|
||||
ethercalc = lib.head (lib.attrValues nodePackages); |
||||
|
||||
combined = ethercalc.override { |
||||
meta = with lib; { |
||||
description = "Online collaborative spreadsheet"; |
||||
license = with licenses; [ cpal10 artistic2 mit asl20 cc0 mpl20 ]; |
||||
homepage = "https://github.com/audreyt/ethercalc"; |
||||
maintainers = with maintainers; [ iblech ]; |
||||
platforms = platforms.unix; |
||||
}; |
||||
}; |
||||
in |
||||
combined |
@ -0,0 +1,15 @@ |
||||
#!/usr/bin/env nix-shell |
||||
#! nix-shell -i bash -p nodePackages.node2nix |
||||
|
||||
# Run this script not via `./generate.sh`, but via `$PWD/generate.sh`. |
||||
# Else `nix-shell` will not find this script. |
||||
|
||||
set -euo pipefail |
||||
|
||||
cd -- "$(dirname -- "$BASH_SOURCE[0]")" |
||||
|
||||
node2nix \ |
||||
--input node-packages.json \ |
||||
--output node-packages-generated.nix \ |
||||
--composition node-packages.nix \ |
||||
--node-env ../../../development/node-packages/node-env.nix |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@ |
||||
[ |
||||
{ "whitebophir": "git+https://github.com/audreyt/ethercalc.git#b196277081d677be991d104e454a52d242ef0189" } |
||||
] |
@ -0,0 +1,17 @@ |
||||
# This file has been generated by node2nix 1.9.0. Do not edit! |
||||
|
||||
{pkgs ? import <nixpkgs> { |
||||
inherit system; |
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}: |
||||
|
||||
let |
||||
nodeEnv = import ../../../development/node-packages/node-env.nix { |
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; |
||||
inherit pkgs nodejs; |
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; |
||||
}; |
||||
in |
||||
import ./node-packages-generated.nix { |
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; |
||||
inherit nodeEnv; |
||||
} |
Loading…
Reference in new issue