summaryrefslogtreecommitdiff
path: root/default.nix
blob: 8f2a38273c07defd7f27886d965eb77d6e845f38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
let
  nixpkgs = import ./Biz/Bild/Nixpkgs.nix;
  build = import ./Biz/Bild/Rules.nix { inherit nixpkgs; };
  nixos-mailserver = let ver = "v2.3.0"; in builtins.fetchTarball {
    url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/${ver}/nixos-mailserver-${ver}.tar.gz";
    sha256 = "0lpz08qviccvpfws2nm83n7m2r8add2wvfg9bljx9yxx8107r919";
  };
in rec {
  # Cloud infrastructure, always online. Mostly for messaging-related
  # stuff.
  #
  Biz.Cloud = build.os {
    imports = [
      ./Biz/Packages.nix
      ./Biz/Users.nix
      ./Biz/Cloud/Chat.nix
      ./Biz/Cloud/Git.nix
      ./Biz/Cloud/Hardware.nix
      ./Biz/Cloud/Mail.nix
      ./Biz/Cloud/Networking.nix
      ./Biz/Cloud/Web.nix
      ./Biz/Cloud/Znc.nix
      nixos-mailserver
    ];
    networking.hostName = "simatime";
    networking.domain = "simatime.com";
  };
  # Dev machine for work and building stuff.
  #
  Biz.Dev = build.os {
    imports = [
      ./Biz/Packages.nix
      ./Biz/Users.nix
      ./Biz/Dev/Configuration.nix
      ./Biz/Dev/Hardware.nix
    ];
    networking.hostName = "lithium";
    networking.domain = "dev.simatime.com";
  };
  # The production server for que.run
  #
  Que.Prod = build.os {
    imports = [
      ./Biz/Packages.nix
      ./Biz/Users.nix
      ./Que/Host.nix
      ./Que/Site.nix
      ./Que/Prod.nix
    ];
    networking.hostName = "prod-que";
    networking.domain = "que.run";
    services.que-server = {
      enable = true;
      port = 80;
      package = Que.Host;
    };
    services.que-website = {
      enable = true;
      namespace = "_";
      package = Que.Site;
    };
  };
  # Production server for herocomics.app
  Hero.Prod = build.os {
    imports = [
      ./Biz/Packages.nix
      ./Biz/Users.nix
      ./Hero/Service.nix
      ./Hero/Prod.nix
    ];
    networking.hostName = "prod-herocomics";
    networking.domain = "herocomics.app";
    services.herocomics = {
      enable = true;
      port = 3000;
      host = Hero.Host;
      node = Hero.Node;
      keep = "/var/lib/hero";
    };
  };
  # Haskell targets
  #
  Biz.Ibb.Server = build.ghc Biz/Ibb/Server.hs;
  Biz.Ibb.Client = build.ghcjs Biz/Ibb/Client.hs;
  Hero.Host = build.ghc Hero/Host.hs;
  Hero.Node =  build.ghcjs Hero/Node.hs;
  Que.Host = build.ghc ./Que/Host.hs;
  Que.Site = build.ghc ./Que/Site.hs;
  # Development environment
  env = build.env;
  # Fall through to any of our overlay packages
  inherit nixpkgs;
}