diff options
author | Ben Sima <ben@bsima.me> | 2019-02-23 19:46:09 -0800 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-02-23 19:54:41 -0800 |
commit | f75eaf7fff963b88e412d315d0fdef8151943c20 (patch) | |
tree | 4e10e624ab6b93b640f2a93f648207a41cc90a25 | |
parent | 81313e15c70bf1c2fe2cd4720f19ae7a2e952fc7 (diff) |
Reorganize directory
-rw-r--r-- | .ghci | 3 | ||||
-rw-r--r-- | LICENSE (renamed from ibb/LICENSE) | 0 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 28 | ||||
-rw-r--r-- | apex/Influencers.hs (renamed from ibb/Influencers.hs) | 0 | ||||
-rw-r--r-- | apex/Main.hs (renamed from ibb/Main.hs) | 0 | ||||
-rw-r--r-- | biz.cabal (renamed from ibb/ibb.cabal) | 2 | ||||
-rw-r--r-- | depo/nutin-madaj/configuration.nix (renamed from configuration.nix) | 2 | ||||
-rw-r--r-- | depo/nutin-madaj/default.nix (renamed from nixos.nix) | 8 | ||||
-rw-r--r-- | depo/nutin-madaj/hardware-configuration.nix (renamed from hardware-configuration.nix) | 0 | ||||
-rw-r--r-- | depo/nutin-madaj/networking.nix (renamed from networking.nix) | 0 | ||||
-rw-r--r-- | mode/fathom.nix (renamed from modules/fathom.nix) | 0 | ||||
-rw-r--r-- | mode/ibb.nix (renamed from modules/ibb.nix) | 0 | ||||
-rw-r--r-- | pack/default.nix | 2 | ||||
-rw-r--r-- | pack/ibb.nix (renamed from ibb/default.nix) | 4 |
15 files changed, 40 insertions, 11 deletions
@@ -0,0 +1,3 @@ +:set -iapex +:set prompt "λ " +:set prompt-cont "| " @@ -3,7 +3,7 @@ USER = root OUT = $(shell readlink -n ./result) result: - nix-build --attr system ./nixos.nix + nix-build --attr system ./depo/nutin-madaj copy: result nix copy --to "ssh://$(USER)@$(HOST)" ./result @@ -1,5 +1,33 @@ [![biz build status](https://builds.sr.ht/~ben/biz.svg)](https://builds.sr.ht/~ben/biz?) +# Source layout + + aero browser apps, compiled with ghcjs + apex server-side api stuff + chip executable scripts in python, bash + depo for deployment, machine-specific nix code, like networking.nix + lore shared code, libraries, general code + mode nixos modules; services and modular config + pack nix packages, like ibb/default.nix, & external packages that we import + soar s3/spaces assets, like images, via git-annex + Makefile instructions for building the artifacts + default.nix contains all the build stuff, combines everything, builds the entire system + +This isn't totally in place yet, but it's something to work toward. + +# Development + +To get a development shell, for example to work on ibb, you can do: + + $ nix-shell pack/ibb.nix + $ ghci + GHCi, version 8.4.3: http://www.haskell.org/ghc/ :? for help + Loaded GHCi configuration from /home/ben/src/biz/.ghci + λ :load apex/Main.hs + [1 of 2] Compiling Influencers ( apex/Influencers.hs, interpreted ) + [2 of 2] Compiling Main ( apex/Main.hs, interpreted ) + Ok, two modules loaded. + # Deployment To build the production server config locally: diff --git a/ibb/Influencers.hs b/apex/Influencers.hs index 7a7031f..7a7031f 100644 --- a/ibb/Influencers.hs +++ b/apex/Influencers.hs diff --git a/ibb/Main.hs b/apex/Main.hs index 27506d8..27506d8 100644 --- a/ibb/Main.hs +++ b/apex/Main.hs diff --git a/ibb/ibb.cabal b/biz.cabal index 4d8ebc7..75aaf91 100644 --- a/ibb/ibb.cabal +++ b/biz.cabal @@ -12,7 +12,7 @@ cabal-version: >= 1.10 executable ibb main-is: Main.hs - hs-source-dirs: . + hs-source-dirs: apex default-extensions: OverloadedStrings ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N other-modules: diff --git a/configuration.nix b/depo/nutin-madaj/configuration.nix index 83c449b..a6d303d 100644 --- a/configuration.nix +++ b/depo/nutin-madaj/configuration.nix @@ -8,7 +8,7 @@ in { nixpkgs.config.allowUnfree = true; nixpkgs.overlays = [ - (import ./pack/default.nix) + (import ../../pack/default.nix) ]; networking.firewall.allowedTCPPorts = [ 22 80 443 ]; diff --git a/nixos.nix b/depo/nutin-madaj/default.nix index ea1605a..a97a4a7 100644 --- a/nixos.nix +++ b/depo/nutin-madaj/default.nix @@ -1,7 +1,5 @@ -# Nix config for the main biz machine. - let - nixpkgs = builtins.fetchTarball (import ./pack/nixpkgs.nix); + nixpkgs = builtins.fetchTarball (import ../../pack/nixpkgs.nix); in import "${nixpkgs}/nixos" { system = "x86_64-linux"; @@ -14,8 +12,8 @@ import "${nixpkgs}/nixos" { ./configuration.nix # our modules - ./modules/ibb.nix - ./modules/fathom.nix + ../../mode/ibb.nix + ../../mode/fathom.nix # third party (builtins.fetchTarball { diff --git a/hardware-configuration.nix b/depo/nutin-madaj/hardware-configuration.nix index 8c88cb7..8c88cb7 100644 --- a/hardware-configuration.nix +++ b/depo/nutin-madaj/hardware-configuration.nix diff --git a/networking.nix b/depo/nutin-madaj/networking.nix index 6c55005..6c55005 100644 --- a/networking.nix +++ b/depo/nutin-madaj/networking.nix diff --git a/modules/fathom.nix b/mode/fathom.nix index dee34b9..dee34b9 100644 --- a/modules/fathom.nix +++ b/mode/fathom.nix diff --git a/modules/ibb.nix b/mode/ibb.nix index e2d4dd0..e2d4dd0 100644 --- a/modules/ibb.nix +++ b/mode/ibb.nix diff --git a/pack/default.nix b/pack/default.nix index 6c218bb..255db4c 100644 --- a/pack/default.nix +++ b/pack/default.nix @@ -2,5 +2,5 @@ self: super: { fathom = import ./fathom.nix { nixpkgs = super; }; - ibb = import ../ibb/default.nix { }; + ibb = import ./ibb.nix { }; } diff --git a/ibb/default.nix b/pack/ibb.nix index 8525d99..ba4cae7 100644 --- a/ibb/default.nix +++ b/pack/ibb.nix @@ -3,13 +3,13 @@ , doBenchmark ? false , doCheck ? true , withHoogle ? false -, nixpkgs ? builtins.fetchTarball (import ../pack/nixpkgs.nix) +, nixpkgs ? builtins.fetchTarball (import ./nixpkgs.nix) }: with import "${nixpkgs}" {}; haskell.packages.${compiler}.developPackage { - root = ./.; + root = ../.; overrides = with haskell.lib; self: super: { ghc = if withHoogle |