diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-09-08 14:44:52 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-09-08 14:44:52 +0200 |
commit | 0c1a178890baa67d5407663b05823d3092ff660a (patch) | |
tree | f8c22f9da831b1151adf6fd93ce97627588d3de6 | |
parent | 3583c11b77ece68ba4c35f8cd1fbdaff820ac7d1 (diff) | |
download | nixos-0c1a178890baa67d5407663b05823d3092ff660a.tar nixos-0c1a178890baa67d5407663b05823d3092ff660a.tar.gz nixos-0c1a178890baa67d5407663b05823d3092ff660a.tar.bz2 nixos-0c1a178890baa67d5407663b05823d3092ff660a.tar.xz nixos-0c1a178890baa67d5407663b05823d3092ff660a.zip |
bar depends on thermoprint
-rw-r--r-- | custom/bar-service.nix | 10 | ||||
-rw-r--r-- | custom/thermoprint-service.nix | 18 |
2 files changed, 26 insertions, 2 deletions
diff --git a/custom/bar-service.nix b/custom/bar-service.nix index 2a492ce1..aa08f7cd 100644 --- a/custom/bar-service.nix +++ b/custom/bar-service.nix | |||
@@ -53,6 +53,8 @@ in { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | config = mkIf cfg.enable { | 55 | config = mkIf cfg.enable { |
56 | imports = [ ./thermoprint-service.nix ]; | ||
57 | |||
56 | assertions = [ | 58 | assertions = [ |
57 | { assertion = config.services.postgresql.enable; | 59 | { assertion = config.services.postgresql.enable; |
58 | message = "bar requires PostgreSQL"; | 60 | message = "bar requires PostgreSQL"; |
@@ -69,8 +71,12 @@ in { | |||
69 | 71 | ||
70 | users.groups."${cfg.group}" = {}; | 72 | users.groups."${cfg.group}" = {}; |
71 | 73 | ||
72 | nixpkgs.overlays = [(self: super: { | 74 | nixpkgs.overlays = [(selfPkgs: superPkgs: { |
73 | bar = self.callPackage ./bar { inherit (self) haskellPackages; }; | 75 | haskellPackages = superPkgs.haskellPackages.extend (selfH: superH: { |
76 | bar = superPkgs.callPackage ./bar { haskellPackages = selfH }; | ||
77 | }); | ||
78 | |||
79 | inherit (selfPkgs.haskellPackages) bar; | ||
74 | })]; | 80 | })]; |
75 | 81 | ||
76 | systemd.services."bar" = { | 82 | systemd.services."bar" = { |
diff --git a/custom/thermoprint-service.nix b/custom/thermoprint-service.nix new file mode 100644 index 00000000..8773706c --- /dev/null +++ b/custom/thermoprint-service.nix | |||
@@ -0,0 +1,18 @@ | |||
1 | { config, lib, pkgs, ... }: | ||
2 | |||
3 | with lib; | ||
4 | |||
5 | { | ||
6 | config = { | ||
7 | nixpkgs.overlays = [(selfPkgs: superPkgs: { | ||
8 | haskellPackages = superPkgs.haskellPackages.extend (selfH: superH: | ||
9 | import ./custom/thermoprint { | ||
10 | callPackage = superPkgs.lib.callPackageWith (selfH // { inherit (superPkgs) stdenv makeWrapper runCommand; }); | ||
11 | extraPackages = (p: []); | ||
12 | } | ||
13 | ); | ||
14 | |||
15 | inherit (selfPkgs.haskellPackages) thermoprint-server thermoprint-webgui tprint; | ||
16 | }; | ||
17 | }; | ||
18 | } | ||