diff options
author | Ben Sima <ben@bsima.me> | 2020-04-19 16:50:36 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-04-19 17:51:39 -0700 |
commit | 35f0ade5ea77d17544d253f970ef94dd1c7cd9f0 (patch) | |
tree | 588c20152bc338f8ded6cba434817b2f8fdd5d1c /default.nix | |
parent | 42d1fab5fd7af5682bd693d4784d9da1a2d4bfef (diff) |
Switch to niv for managing third party sources
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 143 |
1 files changed, 66 insertions, 77 deletions
diff --git a/default.nix b/default.nix index 2d7fb8f..de30805 100644 --- a/default.nix +++ b/default.nix @@ -1,10 +1,6 @@ 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; + nixpkgs = import ./nix/nixpkgs.nix; + build = import ./nix/build.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"; @@ -13,91 +9,84 @@ 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"; - }; + 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 = 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"; - }; + 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 = buildOS { - deps = { - que-server = Que.Server; - que-website = Que.Website; + Que.Prod = build.os { + imports = [ + ./Biz/packages.nix + ./Biz/users.nix + ./Que/Server.nix + ./Que/Website.nix + ./Que/Prod.nix + ]; + networking.hostName = "prod-que"; + networking.domain = "que.run"; + services.que-server = { + enable = true; + port = 80; + package = Que.Server; }; - 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"; + services.que-website = { + enable = true; + namespace = "_"; + package = Que.Website; }; }; # 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"; + Hero.Prod = build.os { + imports = [ + ./Biz/packages.nix + ./Biz/users.nix + ./Hero/Service.nix + ./Hero/Prod.nix + ]; + networking.hostName = "prod-herocomics"; + networking.domain = "herocomcis.app"; + services.herocomics = { + enable = true; + port = 3000; + server = Hero.Server; + client = Hero.Client; }; }; # 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; + Biz.Ibb.Server = build.ghc Biz/Ibb/Server.hs; + Biz.Ibb.Client = build.ghcjs Biz/Ibb/Client.hs; + Hero.Server = build.ghc Hero/Server.hs; + Hero.Client = build.ghcjs Hero/Client.hs; + Que.Server = build.ghc ./Que/Server.hs; + Que.Website = build.ghc ./Que/Website.hs; # Development environment - repl = biz.globalGhc; + repl = build.env; # Fall through to any of our overlay packages - inherit bizpkgs; + inherit nixpkgs; } |