summaryrefslogtreecommitdiff
path: root/bragi.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-04-12 13:50:41 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-04-12 13:50:41 +0200
commit805c2616e0256b6ff076dbdf85014bbbb4d72a9a (patch)
tree88324b4a4aaf96c678fe7755449118033b5dcf42 /bragi.nix
parent54a2e3b2433476b5a85818367bdd2cb8886e6d4b (diff)
downloadnixos-805c2616e0256b6ff076dbdf85014bbbb4d72a9a.tar
nixos-805c2616e0256b6ff076dbdf85014bbbb4d72a9a.tar.gz
nixos-805c2616e0256b6ff076dbdf85014bbbb4d72a9a.tar.bz2
nixos-805c2616e0256b6ff076dbdf85014bbbb4d72a9a.tar.xz
nixos-805c2616e0256b6ff076dbdf85014bbbb4d72a9a.zip
strip out thermoprint
Diffstat (limited to 'bragi.nix')
-rw-r--r--bragi.nix55
1 files changed, 1 insertions, 54 deletions
diff --git a/bragi.nix b/bragi.nix
index 2cb560d9..3b634767 100644
--- a/bragi.nix
+++ b/bragi.nix
@@ -33,9 +33,6 @@ in rec {
33 inherit 33 inherit
34 (lib.mapAttrs (name: oldPkgs.haskell.lib.dontCheck) super) 34 (lib.mapAttrs (name: oldPkgs.haskell.lib.dontCheck) super)
35 Glob filelock; 35 Glob filelock;
36 inherit
37 (self.callPackage ./custom/thermoprint { inherit (self) Glob; inherit (pkgs) runCommand makeWrapper; extraPackages = (p: with p; [ persistent-postgresql ]); })
38 thermoprint-spec thermoprint-bbcode thermoprint-client thermoprint-server thermoprint-webgui tprint bbcode;
39 }; 36 };
40 }; 37 };
41 38
@@ -43,7 +40,7 @@ in rec {
43 40
44 mpd = oldPkgs.mpd.override { gmeSupport = false; pulseaudioSupport = false; }; 41 mpd = oldPkgs.mpd.override { gmeSupport = false; pulseaudioSupport = false; };
45 42
46 inherit (haskellPackages) trivmix thermoprint-server thermoprint-webgui tprint; 43 inherit (haskellPackages) trivmix;
47 }; 44 };
48 45
49 nixpkgs.config.allowUnfree = true; 46 nixpkgs.config.allowUnfree = true;
@@ -315,41 +312,6 @@ in rec {
315 openssh.authorizedKeys.keyFiles = template.openssh.authorizedKeys.keyFiles; 312 openssh.authorizedKeys.keyFiles = template.openssh.authorizedKeys.keyFiles;
316 }; 313 };
317 314
318 users.extraUsers."thermoprint" = {
319 name = "thermoprint";
320 group = "lp";
321 isSystemUser = true;
322 createHome = true;
323 home = "/var/lib/thermoprint";
324 };
325
326 systemd.services."thermoprint" = {
327 environment = {
328 THERMOPRINT_CONFIG = ./bragi/thermoprint-server;
329 THERMOPRINT_CACHE = ''${users.extraUsers."thermoprint".home}/dyre'';
330 };
331 requires = [ "postgresql.service" ];
332 wantedBy = [ "default.target" ];
333 serviceConfig = {
334 Type = "simple";
335 ExecStart = ''${pkgs.thermoprint-server}/bin/thermoprint-server --force-reconf'';
336 User = users.extraUsers."thermoprint".name;
337 Group = users.extraUsers."thermoprint".group;
338 WorkingDirectory = "~";
339 };
340 };
341
342 systemd.services."thermoprint-webgui" = {
343 wantedBy = [ "default.target" ];
344 serviceConfig = {
345 Type = "simple";
346 ExecStart = ''${pkgs.thermoprint-webgui}/bin/thermoprint-webgui -P 80 -A localhost -F /thermoprint/api/ -a "localhost" -p 8081'';
347 User = users.extraUsers."thermoprint".name;
348 Group = users.extraUsers."thermoprint".group;
349 WorkingDirectory = "~";
350 };
351 };
352
353 users.extraUsers."bar" = { 315 users.extraUsers."bar" = {
354 name = "bar"; 316 name = "bar";
355 group = "nogroup"; 317 group = "nogroup";
@@ -424,17 +386,6 @@ in rec {
424 listen *:80; 386 listen *:80;
425 server_name _; 387 server_name _;
426 388
427 location /thermoprint/api/ {
428 proxy_pass http://[::1]:8080/;
429 proxy_http_version 1.1;
430 proxy_set_header Upgrade $http_upgrade;
431 proxy_set_header Connection "upgrade";
432 }
433
434 location /thermoprint/ {
435 proxy_pass http://localhost:8081/;
436 }
437
438 location /bar/ { 389 location /bar/ {
439 proxy_pass http://[::1]:8082/; 390 proxy_pass http://[::1]:8082/;
440 } 391 }
@@ -450,10 +401,6 @@ in rec {
450 host all all 10.141.0.0/16 md5 401 host all all 10.141.0.0/16 md5
451 ''; 402 '';
452 initialScript = pkgs.writeText "schema.sql" '' 403 initialScript = pkgs.writeText "schema.sql" ''
453 CREATE USER thermoprint;
454 CREATE DATABASE thermoprint WITH OWNER = thermoprint;
455 GRANT ALL ON DATABASE thermoprint TO thermoprint;
456
457 CREATE USER bar; 404 CREATE USER bar;
458 CREATE DATABASE bar WITH OWNER = bar; 405 CREATE DATABASE bar WITH OWNER = bar;
459 GRANT ALL ON DATABASE bar TO bar; 406 GRANT ALL ON DATABASE bar TO bar;