git.iko.soy/typeable/nixpkgs
on master help sign in
leaps: 0.5.1 + add a service + test
commit47d81ed3473f33cfb48f2be079f50cdfac60f1e7 authorJoachim Schiele <js@lastlog.de> dateSun 6 Nov 2016, 10:33 (10 years ago) parent4440cf6
7 files changed+191−13
nixos/modules/misc/ids.nix+2 nixos/modules/module-list.nix+1 nixos/modules/services/misc/leaps.nix+62 nixos/release.nix+1 nixos/tests/leaps.nix+29 pkgs/development/tools/leaps/default.nix+9−9 pkgs/development/tools/leaps/deps.nix+87−4
nixos/modules/misc/ids.nix+2
@@ -277,6 +277,7 @@
277277 gitlab-runner = 257;
278278 postgrey = 258;
279279 hound = 259;
280+ leaps = 260;
280281
281282 # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
282283
@@ -524,6 +525,7 @@
524525 gitlab-runner = 257;
525526 postgrey = 258;
526527 hound = 259;
528+ leaps = 260;
527529
528530 # When adding a gid, make sure it doesn't match an existing
529531 # uid. Users and groups with the same name should have equal
nixos/modules/module-list.nix+1
@@ -251,6 +251,7 @@
251251 ./services/misc/gitolite.nix
252252 ./services/misc/gpsd.nix
253253 ./services/misc/ihaskell.nix
254+ ./services/misc/leaps.nix
254255 ./services/misc/mantisbt.nix
255256 ./services/misc/mathics.nix
256257 ./services/misc/matrix-synapse.nix
nixos/modules/services/misc/leaps.nixnew file+62
@@ -0,0 +1,62 @@
1+{ config, pkgs, lib, ... } @ args:
2+
3+with lib;
4+
5+let
6+ cfg = config.services.leaps;
7+ stateDir = "/var/lib/leaps/";
8+in
9+{
10+ options = {
11+ services.leaps = {
12+ enable = mkEnableOption "leaps";
13+ port = mkOption {
14+ type = types.int;
15+ default = 8080;
16+ description = "A port where leaps listens for incoming http requests";
17+ };
18+ address = mkOption {
19+ default = "";
20+ type = types.str;
21+ example = "127.0.0.1";
22+ description = "Hostname or IP-address to listen to. By default it will listen on all interfaces.";
23+ };
24+ path = mkOption {
25+ default = "/";
26+ type = types.path;
27+ description = "Subdirectory used for reverse proxy setups";
28+ };
29+ };
30+ };
31+
32+ config = mkIf cfg.enable {
33+ users = {
34+ users.leaps = {
35+ uid = config.ids.uids.leaps;
36+ description = "Leaps server user";
37+ group = "leaps";
38+ home = stateDir;
39+ createHome = true;
40+ };
41+
42+ groups.leaps = {
43+ gid = config.ids.gids.leaps;
44+ };
45+ };
46+
47+ systemd.services.leaps = {
48+ description = "leaps service";
49+ wantedBy = [ "multi-user.target" ];
50+ after = [ "network.target" ];
51+
52+ serviceConfig = {
53+ User = "leaps";
54+ Group = "leaps";
55+ Restart = "on-failure";
56+ WorkingDirectory = stateDir;
57+ PrivateTmp = true;
58+ ExecStart = "${pkgs.leaps.bin}/bin/leaps -path ${toString cfg.path} -address ${cfg.address}:${toString cfg.port}";
59+ };
60+ };
61+ };
62+}
nixos/release.nix+1
@@ -275,6 +275,7 @@ in rec {
275275 tests.networkingProxy = callTest tests/networking-proxy.nix {};
276276 tests.nfs3 = callTest tests/nfs.nix { version = 3; };
277277 tests.nfs4 = callTest tests/nfs.nix { version = 4; };
278+ tests.leaps = callTest tests/leaps.nix { };
278279 tests.nsd = callTest tests/nsd.nix {};
279280 tests.openssh = callTest tests/openssh.nix {};
280281 #tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
nixos/tests/leaps.nixnew file+29
@@ -0,0 +1,29 @@
1+import ./make-test.nix ({ pkgs, ... }:
2+
3+{
4+ name = "leaps";
5+ meta = with pkgs.stdenv.lib.maintainers; {
6+ maintainers = [ qknight ];
7+ };
8+
9+ nodes =
10+ {
11+ client = { };
12+
13+ server =
14+ { services.leaps = {
15+ enable = true;
16+ port = 6666;
17+ path = "/leaps/";
18+ };
19+ networking.firewall.enable = false;
20+ };
21+ };
22+
23+ testScript =
24+ ''
25+ startAll;
26+ $server->waitForOpenPort(6666);
27+ $client->succeed("curl http://server:6666/leaps/ | grep -i 'leaps'");
28+ '';
29+})
pkgs/development/tools/leaps/default.nix+9−9
@@ -1,26 +1,26 @@
1−{ stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:
1+{ stdenv, buildGoPackage, fetchFromGitHub, fetchhg, fetchbzr, fetchsvn }:
22
33buildGoPackage rec {
44 name = "leaps-${version}";
5− version = "20160626-${stdenv.lib.strings.substring 0 7 rev}";
6− rev = "5cf7328a8c498041d2a887e89f22f138498f4621";
5+ version = "0.5.1";
76
87 goPackagePath = "github.com/jeffail/leaps";
98
10− src = fetchgit {
11− inherit rev;
12− url = "https://github.com/jeffail/leaps";
13− sha256 = "1qbgz48x9yi0w9yz39zsnnhx5nx2xmrns9v8hx28jah2bvag6sq7";
14− fetchSubmodules = false;
9+ src = fetchFromGitHub {
10+ owner = "jeffail";
11+ repo = "leaps";
12+ sha256 = "0w63y777h5qc8fwnkrbawn3an9px0l1zz3649x0n8lhk125fvchj";
13+ rev = "v${version}";
1514 };
1615
1716 goDeps = ./deps.nix;
17+
1818 meta = {
1919 description = "A pair programming tool and library written in Golang";
2020 homepage = "https://github.com/jeffail/leaps/";
2121 license = "MIT";
2222 maintainers = with stdenv.lib.maintainers; [ qknight ];
2323 meta.platforms = stdenv.lib.platforms.linux;
24− broken = true;
2524 };
2625}
26+
pkgs/development/tools/leaps/deps.nix+87−4
@@ -1,11 +1,94 @@
11[
22 {
3− goPackagePath = "golang.org/x/net";
3+ goPackagePath = "github.com/amir/raidman";
44 fetch = {
55 type = "git";
6− url = "https://go.googlesource.com/net";
7− rev = "07b51741c1d6423d4a6abab1c49940ec09cb1aaf";
8− sha256 = "12lvdj0k2gww4hw5f79qb9yswqpy4i3bgv1likmf3mllgdxfm20w";
6+ url = "https://github.com/amir/raidman";
7+ rev = "91c20f3f475cab75bb40ad7951d9bbdde357ade7";
8+ sha256 = "0pkqy5hzjkk04wj1ljq8jsyla358ilxi4lkmvkk73b3dh2wcqvpp";
9+ };
10+ }
11+ {
12+ goPackagePath = "github.com/elazarl/go-bindata-assetfs";
13+ fetch = {
14+ type = "git";
15+ url = "https://github.com/elazarl/go-bindata-assetfs";
16+ rev = "57eb5e1fc594ad4b0b1dbea7b286d299e0cb43c2";
17+ sha256 = "1za29pa15y2xsa1lza97jlkax9qj93ks4a2j58xzmay6rczfkb9i";
18+ };
19+ }
20+ {
21+ goPackagePath = "github.com/garyburd/redigo";
22+ fetch = {
23+ type = "git";
24+ url = "https://github.com/garyburd/redigo";
25+ rev = "8873b2f1995f59d4bcdd2b0dc9858e2cb9bf0c13";
26+ sha256 = "1lzhb99pcwwf5ddcs0bw00fwf9m1d0k7b92fqz2a01jlij4pm5l2";
27+ };
28+ }
29+ {
30+ goPackagePath = "github.com/go-sql-driver/mysql";
31+ fetch = {
32+ type = "git";
33+ url = "https://github.com/go-sql-driver/mysql";
34+ rev = "7ebe0a500653eeb1859664bed5e48dec1e164e73";
35+ sha256 = "1gyan3lyn2j00di9haq7zm3zcwckn922iigx3fvml6s2bsp6ljas";
36+ };
37+ }
38+ {
39+ goPackagePath = "github.com/golang/protobuf";
40+ fetch = {
41+ type = "git";
42+ url = "https://github.com/golang/protobuf";
43+ rev = "bf531ff1a004f24ee53329dfd5ce0b41bfdc17df";
44+ sha256 = "10lnvmq28jp2wk1xc32mdk4745lal2bmdvbjirckb9wlv07zzzf0";
45+ };
46+ }
47+ {
48+ goPackagePath = "github.com/jeffail/gabs";
49+ fetch = {
50+ type = "git";
51+ url = "https://github.com/jeffail/gabs";
52+ rev = "ee1575a53249b51d636e62464ca43a13030afdb5";
53+ sha256 = "0svv57193n8m86r7v7n0y9lny0p6nzr7xvz98va87h00mg146351";
54+ };
55+ }
56+ {
57+ goPackagePath = "github.com/jeffail/util";
58+ fetch = {
59+ type = "git";
60+ url = "https://github.com/jeffail/util";
61+ rev = "48ada8ff9fcae546b5986f066720daa9033ad523";
62+ sha256 = "0k8zz7gdv4hb691fdyb5mhlixppcq8x4ny84fanflypnv258a3i0";
63+ };
64+ }
65+ {
66+ goPackagePath = "github.com/lib/pq";
67+ fetch = {
68+ type = "git";
69+ url = "https://github.com/lib/pq";
70+ rev = "3cd0097429be7d611bb644ef85b42bfb102ceea4";
71+ sha256 = "1q7qfzyfgjk6rvid548r43fi4jhvsh4dhfvfjbp2pz4xqsvpsm7a";
72+ };
73+ }
74+ {
75+ goPackagePath = "github.com/satori/go.uuid";
76+ fetch = {
77+ type = "git";
78+ url = "https://github.com/satori/go.uuid";
79+ rev = "f9ab0dce87d815821e221626b772e3475a0d2749";
80+ sha256 = "0z18j6zxq9kw4lgcpmhh3k7jrb9gy1lx252xz5qhs4ywi9w77xwi";
81+ };
82+ }
83+
84+ {
85+ goPackagePath = "golang.org/x/net";
86+ fetch = {
87+ type = "git";
88+ url = "https://go.googlesource.com/net";
89+ rev = "07b51741c1d6423d4a6abab1c49940ec09cb1aaf";
90+ sha256 = "12lvdj0k2gww4hw5f79qb9yswqpy4i3bgv1likmf3mllgdxfm20w";
991 };
1092 }
1193]
94+