forked from mirrors/nixpkgs
leaps: 0.5.1 + add a service + test
This commit is contained in:
parent
4440cf6d81
commit
47d81ed347
|
@ -277,6 +277,7 @@
|
||||||
gitlab-runner = 257;
|
gitlab-runner = 257;
|
||||||
postgrey = 258;
|
postgrey = 258;
|
||||||
hound = 259;
|
hound = 259;
|
||||||
|
leaps = 260;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||||
|
|
||||||
|
@ -524,6 +525,7 @@
|
||||||
gitlab-runner = 257;
|
gitlab-runner = 257;
|
||||||
postgrey = 258;
|
postgrey = 258;
|
||||||
hound = 259;
|
hound = 259;
|
||||||
|
leaps = 260;
|
||||||
|
|
||||||
# When adding a gid, make sure it doesn't match an existing
|
# When adding a gid, make sure it doesn't match an existing
|
||||||
# uid. Users and groups with the same name should have equal
|
# uid. Users and groups with the same name should have equal
|
||||||
|
|
|
@ -251,6 +251,7 @@
|
||||||
./services/misc/gitolite.nix
|
./services/misc/gitolite.nix
|
||||||
./services/misc/gpsd.nix
|
./services/misc/gpsd.nix
|
||||||
./services/misc/ihaskell.nix
|
./services/misc/ihaskell.nix
|
||||||
|
./services/misc/leaps.nix
|
||||||
./services/misc/mantisbt.nix
|
./services/misc/mantisbt.nix
|
||||||
./services/misc/mathics.nix
|
./services/misc/mathics.nix
|
||||||
./services/misc/matrix-synapse.nix
|
./services/misc/matrix-synapse.nix
|
||||||
|
|
62
nixos/modules/services/misc/leaps.nix
Normal file
62
nixos/modules/services/misc/leaps.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
{ config, pkgs, lib, ... } @ args:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.leaps;
|
||||||
|
stateDir = "/var/lib/leaps/";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
services.leaps = {
|
||||||
|
enable = mkEnableOption "leaps";
|
||||||
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 8080;
|
||||||
|
description = "A port where leaps listens for incoming http requests";
|
||||||
|
};
|
||||||
|
address = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.str;
|
||||||
|
example = "127.0.0.1";
|
||||||
|
description = "Hostname or IP-address to listen to. By default it will listen on all interfaces.";
|
||||||
|
};
|
||||||
|
path = mkOption {
|
||||||
|
default = "/";
|
||||||
|
type = types.path;
|
||||||
|
description = "Subdirectory used for reverse proxy setups";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
users = {
|
||||||
|
users.leaps = {
|
||||||
|
uid = config.ids.uids.leaps;
|
||||||
|
description = "Leaps server user";
|
||||||
|
group = "leaps";
|
||||||
|
home = stateDir;
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
groups.leaps = {
|
||||||
|
gid = config.ids.gids.leaps;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.leaps = {
|
||||||
|
description = "leaps service";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
User = "leaps";
|
||||||
|
Group = "leaps";
|
||||||
|
Restart = "on-failure";
|
||||||
|
WorkingDirectory = stateDir;
|
||||||
|
PrivateTmp = true;
|
||||||
|
ExecStart = "${pkgs.leaps.bin}/bin/leaps -path ${toString cfg.path} -address ${cfg.address}:${toString cfg.port}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -275,6 +275,7 @@ in rec {
|
||||||
tests.networkingProxy = callTest tests/networking-proxy.nix {};
|
tests.networkingProxy = callTest tests/networking-proxy.nix {};
|
||||||
tests.nfs3 = callTest tests/nfs.nix { version = 3; };
|
tests.nfs3 = callTest tests/nfs.nix { version = 3; };
|
||||||
tests.nfs4 = callTest tests/nfs.nix { version = 4; };
|
tests.nfs4 = callTest tests/nfs.nix { version = 4; };
|
||||||
|
tests.leaps = callTest tests/leaps.nix { };
|
||||||
tests.nsd = callTest tests/nsd.nix {};
|
tests.nsd = callTest tests/nsd.nix {};
|
||||||
tests.openssh = callTest tests/openssh.nix {};
|
tests.openssh = callTest tests/openssh.nix {};
|
||||||
#tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
|
#tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
|
||||||
|
|
29
nixos/tests/leaps.nix
Normal file
29
nixos/tests/leaps.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
import ./make-test.nix ({ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "leaps";
|
||||||
|
meta = with pkgs.stdenv.lib.maintainers; {
|
||||||
|
maintainers = [ qknight ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes =
|
||||||
|
{
|
||||||
|
client = { };
|
||||||
|
|
||||||
|
server =
|
||||||
|
{ services.leaps = {
|
||||||
|
enable = true;
|
||||||
|
port = 6666;
|
||||||
|
path = "/leaps/";
|
||||||
|
};
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript =
|
||||||
|
''
|
||||||
|
startAll;
|
||||||
|
$server->waitForOpenPort(6666);
|
||||||
|
$client->succeed("curl http://server:6666/leaps/ | grep -i 'leaps'");
|
||||||
|
'';
|
||||||
|
})
|
|
@ -1,26 +1,26 @@
|
||||||
{ stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:
|
{ stdenv, buildGoPackage, fetchFromGitHub, fetchhg, fetchbzr, fetchsvn }:
|
||||||
|
|
||||||
buildGoPackage rec {
|
buildGoPackage rec {
|
||||||
name = "leaps-${version}";
|
name = "leaps-${version}";
|
||||||
version = "20160626-${stdenv.lib.strings.substring 0 7 rev}";
|
version = "0.5.1";
|
||||||
rev = "5cf7328a8c498041d2a887e89f22f138498f4621";
|
|
||||||
|
|
||||||
goPackagePath = "github.com/jeffail/leaps";
|
goPackagePath = "github.com/jeffail/leaps";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchFromGitHub {
|
||||||
inherit rev;
|
owner = "jeffail";
|
||||||
url = "https://github.com/jeffail/leaps";
|
repo = "leaps";
|
||||||
sha256 = "1qbgz48x9yi0w9yz39zsnnhx5nx2xmrns9v8hx28jah2bvag6sq7";
|
sha256 = "0w63y777h5qc8fwnkrbawn3an9px0l1zz3649x0n8lhk125fvchj";
|
||||||
fetchSubmodules = false;
|
rev = "v${version}";
|
||||||
};
|
};
|
||||||
|
|
||||||
goDeps = ./deps.nix;
|
goDeps = ./deps.nix;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A pair programming tool and library written in Golang";
|
description = "A pair programming tool and library written in Golang";
|
||||||
homepage = "https://github.com/jeffail/leaps/";
|
homepage = "https://github.com/jeffail/leaps/";
|
||||||
license = "MIT";
|
license = "MIT";
|
||||||
maintainers = with stdenv.lib.maintainers; [ qknight ];
|
maintainers = with stdenv.lib.maintainers; [ qknight ];
|
||||||
meta.platforms = stdenv.lib.platforms.linux;
|
meta.platforms = stdenv.lib.platforms.linux;
|
||||||
broken = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,94 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
goPackagePath = "golang.org/x/net";
|
goPackagePath = "github.com/amir/raidman";
|
||||||
fetch = {
|
fetch = {
|
||||||
type = "git";
|
type = "git";
|
||||||
url = "https://go.googlesource.com/net";
|
url = "https://github.com/amir/raidman";
|
||||||
rev = "07b51741c1d6423d4a6abab1c49940ec09cb1aaf";
|
rev = "91c20f3f475cab75bb40ad7951d9bbdde357ade7";
|
||||||
sha256 = "12lvdj0k2gww4hw5f79qb9yswqpy4i3bgv1likmf3mllgdxfm20w";
|
sha256 = "0pkqy5hzjkk04wj1ljq8jsyla358ilxi4lkmvkk73b3dh2wcqvpp";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/elazarl/go-bindata-assetfs";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/elazarl/go-bindata-assetfs";
|
||||||
|
rev = "57eb5e1fc594ad4b0b1dbea7b286d299e0cb43c2";
|
||||||
|
sha256 = "1za29pa15y2xsa1lza97jlkax9qj93ks4a2j58xzmay6rczfkb9i";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/garyburd/redigo";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/garyburd/redigo";
|
||||||
|
rev = "8873b2f1995f59d4bcdd2b0dc9858e2cb9bf0c13";
|
||||||
|
sha256 = "1lzhb99pcwwf5ddcs0bw00fwf9m1d0k7b92fqz2a01jlij4pm5l2";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/go-sql-driver/mysql";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/go-sql-driver/mysql";
|
||||||
|
rev = "7ebe0a500653eeb1859664bed5e48dec1e164e73";
|
||||||
|
sha256 = "1gyan3lyn2j00di9haq7zm3zcwckn922iigx3fvml6s2bsp6ljas";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/golang/protobuf";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/golang/protobuf";
|
||||||
|
rev = "bf531ff1a004f24ee53329dfd5ce0b41bfdc17df";
|
||||||
|
sha256 = "10lnvmq28jp2wk1xc32mdk4745lal2bmdvbjirckb9wlv07zzzf0";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/jeffail/gabs";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/jeffail/gabs";
|
||||||
|
rev = "ee1575a53249b51d636e62464ca43a13030afdb5";
|
||||||
|
sha256 = "0svv57193n8m86r7v7n0y9lny0p6nzr7xvz98va87h00mg146351";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/jeffail/util";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/jeffail/util";
|
||||||
|
rev = "48ada8ff9fcae546b5986f066720daa9033ad523";
|
||||||
|
sha256 = "0k8zz7gdv4hb691fdyb5mhlixppcq8x4ny84fanflypnv258a3i0";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/lib/pq";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/lib/pq";
|
||||||
|
rev = "3cd0097429be7d611bb644ef85b42bfb102ceea4";
|
||||||
|
sha256 = "1q7qfzyfgjk6rvid548r43fi4jhvsh4dhfvfjbp2pz4xqsvpsm7a";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
goPackagePath = "github.com/satori/go.uuid";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://github.com/satori/go.uuid";
|
||||||
|
rev = "f9ab0dce87d815821e221626b772e3475a0d2749";
|
||||||
|
sha256 = "0z18j6zxq9kw4lgcpmhh3k7jrb9gy1lx252xz5qhs4ywi9w77xwi";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
goPackagePath = "golang.org/x/net";
|
||||||
|
fetch = {
|
||||||
|
type = "git";
|
||||||
|
url = "https://go.googlesource.com/net";
|
||||||
|
rev = "07b51741c1d6423d4a6abab1c49940ec09cb1aaf";
|
||||||
|
sha256 = "12lvdj0k2gww4hw5f79qb9yswqpy4i3bgv1likmf3mllgdxfm20w";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue