diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | bragi.nix | 18 | ||||
m--------- | custom/thermoprint | 0 | ||||
-rw-r--r-- | custom/thermoprint.nix | 23 |
4 files changed, 44 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules index 00f4bdeb..51c669ec 100644 --- a/.gitmodules +++ b/.gitmodules | |||
@@ -22,3 +22,6 @@ | |||
22 | [submodule "utils"] | 22 | [submodule "utils"] |
23 | path = utils | 23 | path = utils |
24 | url = git://git.yggdrasil.li/utils | 24 | url = git://git.yggdrasil.li/utils |
25 | [submodule "custom/thermoprint"] | ||
26 | path = custom/thermoprint | ||
27 | url = git://git.yggdrasil.li/thermoprint | ||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | let | 3 | let |
4 | trivmixService = opts: (pkgs.callPackage ./custom/trivmix-service.nix opts).out; | 4 | trivmixService = opts: (pkgs.callPackage ./custom/trivmix-service.nix opts).out; |
5 | thermoprint-servant = (pkgs.callPackage ./custom/thermoprint {}).thermoprint-servant; | ||
5 | in { | 6 | in { |
6 | imports = | 7 | imports = |
7 | [ | 8 | [ |
@@ -239,4 +240,21 @@ in { | |||
239 | inherit (template) shell; | 240 | inherit (template) shell; |
240 | openssh.authorizedKeys.keyFiles = template.openssh.authorizedKeys.keyFiles; | 241 | openssh.authorizedKeys.keyFiles = template.openssh.authorizedKeys.keyFiles; |
241 | }; | 242 | }; |
243 | |||
244 | users.extraUsers."thermoprint" = { | ||
245 | name = "thermoprint"; | ||
246 | group = "lp"; | ||
247 | isSystemUser = true; | ||
248 | createHome = true; | ||
249 | home = "/var/thermoprint"; | ||
250 | }; | ||
251 | |||
252 | systemd.services."thermoprint" = { | ||
253 | serviceConfig = { | ||
254 | Type = "simple"; | ||
255 | ExecStart = ''${thermoprint-servant}/bin/thermoprint --database /var/thermoprint/database.sqlite''; | ||
256 | User = "thermoprint"; | ||
257 | Group = "lp"; | ||
258 | }; | ||
259 | }; | ||
242 | } | 260 | } |
diff --git a/custom/thermoprint b/custom/thermoprint new file mode 160000 | |||
Subproject e65e1eaac335a4738abb9e8ee8da7a229f96c2c | |||
diff --git a/custom/thermoprint.nix b/custom/thermoprint.nix new file mode 100644 index 00000000..733da6c3 --- /dev/null +++ b/custom/thermoprint.nix | |||
@@ -0,0 +1,23 @@ | |||
1 | { stdenv ? (import <nixpkgs> {}).stdenv | ||
2 | , haskellPackages ? (import <nixpkgs> {}).haskellPackages | ||
3 | }: | ||
4 | |||
5 | let | ||
6 | override = stdenv.lib.overrideDerivation; | ||
7 | callPackage = haskellPackages.callPackage; | ||
8 | tprint = callPackage ./thermoprint/tprint/tprint.nix { | ||
9 | inherit thermoprint-servant thermoprint bbcode; | ||
10 | }; | ||
11 | bbcode = callPackage ./thermoprint/bbcode/bbcode.nix { | ||
12 | inherit thermoprint; | ||
13 | }; | ||
14 | thermoprint-servant = callPackage ./thermoprint/servant/servant.nix { | ||
15 | inherit thermoprint; | ||
16 | }; | ||
17 | thermoprint = callPackage ./thermoprint/thermoprint/thermoprint.nix {}; | ||
18 | in rec { | ||
19 | tprint = override tprint (oldAttrs: { src = ./thermoprint/tprint; }); | ||
20 | bbcode = override bbcode (oldAttrs: { src = ./thermoprint/bbcode; }); | ||
21 | thermoprint-servant = override thermoprint-servant (oldAttrs: { src = ./thermoprint/servant; }); | ||
22 | thermoprint = override thermoprint (oldAttrs: { src = ./thermoprint/thermoprint; }); | ||
23 | } | ||