summaryrefslogtreecommitdiff
path: root/default.nix
blob: 2d7fb8f89aaf257f527e336376932cfca7fc06aa (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
94
95
96
97
98
99
100
101
102
103
let
  nixpkgs-tar = builtins.fetchTarball (import ./nixpkgs.nix);
  overlay = import ./overlay.nix;
  bizpkgs = import "${nixpkgs-tar}" { overlays = [ overlay ]; };
  nixos = import "${nixpkgs-tar}/nixos";
  biz = import ./biz.nix { nixpkgs = bizpkgs; };
  buildOS = import ./Biz/buildOS.nix nixos;
  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 = buildOS {
    enableVpn = true;
    ipAddress = "159.89.128.69";
    configuration = {
      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 = buildOS {
    enableVpn = true;
    ipAddress = "73.222.221.63";
    deps = {
      wemux = bizpkgs.wemux;
    };
    configuration = {
      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 = buildOS {
    deps = {
      que-server = Que.Server;
      que-website = Que.Website;
    };
    configuration = {
      imports = [
        ./Biz/packages.nix
        ./Biz/users.nix
        ./Que/Server.nix
        ./Que/Website.nix
        ./Que/Prod.nix
      ];
      networking.hostName = "prod-que";
      networking.domain = "que.run";
    };
  };
  # Production server for herocomics.app
  Hero.Prod = buildOS {
    deps = {
      herocomics-server = Hero.Server;
      herocomics-client = Hero.Client;
    };
    configuration = {
      imports = [
        ./Biz/packages.nix
        ./Biz/users.nix
        ./Hero/Service.nix
        ./Hero/Prod.nix
      ];
      networking.hostName = "prod-herocomics";
      networking.domain = "herocomcis.app";
    };
  };
  # Haskell targets
  #
  Biz.Ibb.Server = biz.buildGhc Biz/Ibb/Server.hs;
  Biz.Ibb.Client = biz.buildGhcjs Biz/Ibb/Client.hs;
  Hero.Server = biz.buildGhc Hero/Server.hs;
  Hero.Client = biz.buildGhcjs Hero/Client.hs;
  Que.Server = biz.buildGhc ./Que/Server.hs;
  Que.Website = biz.buildGhc ./Que/Website.hs;
  # Development environment
  repl = biz.globalGhc;
  # Fall through to any of our overlay packages
  inherit bizpkgs;
}