about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-20T20·37+0000
committerVincent Ambo <tazjin@google.com>2019-12-20T20·37+0000
commit8de5d093d8e35b2492c81015dcfcb052d2718614 (patch)
treef4bb5763a39c7059537fc7877e3c0ac15a4d8f69
parent03bfe08e1dd9faf48b06cb146bfa446575cde88a (diff)
refactor: Fix a variety of filepaths for repo relayouting r/238
This fixes readTree and the various project builds, as well
as (hopefully) most documentation links inside of the projects.
-rw-r--r--.envrc2
-rw-r--r--README.md32
-rwxr-xr-xbin/__dispatch.sh2
-rw-r--r--ci-builds.nix20
-rw-r--r--default.nix34
-rw-r--r--docs/CONTRIBUTING.md3
-rw-r--r--ops/infra/.skip-subtree2
-rw-r--r--ops/secrets/.skip-subtree1
-rw-r--r--overrides/default.nix28
-rw-r--r--overrides/elmPackages/default.nix (renamed from overrides/elmPackages.nix)0
-rw-r--r--overrides/kontemplate/default.nix (renamed from overrides/kontemplate.nix)0
-rw-r--r--overrides/writeElispBin/default.nix (renamed from overrides/writeElispBin.nix)0
12 files changed, 69 insertions, 55 deletions
diff --git a/.envrc b/.envrc
index 6b3ce7ebbb..b943eb62a6 100644
--- a/.envrc
+++ b/.envrc
@@ -1,7 +1,7 @@
 # Configure the local PATH to contain tools which are fetched ad-hoc
 # from Nix.
 
-export PATH="${PWD}/tools/bin:${PATH}"
+export PATH="${PWD}/bin:${PATH}"
 export NIX_PATH="nixpkgs=${PWD}/default.nix"
 export REPO_ROOT="${PWD}"
 export SECRETS_DIR="${PWD}/secrets"
diff --git a/README.md b/README.md
index d3537bfff7..1b02a99f9a 100644
--- a/README.md
+++ b/README.md
@@ -20,39 +20,43 @@ Twitter][].
 ## Tools
 
 * `tools/emacs` contains my personal Emacs configuration (packages & config)
-* `tools/aoc2019` contains solutions for a handful of Advent of Code 2019
+* `fun/aoc2019` contains solutions for a handful of Advent of Code 2019
   challenges, before I ran out of interest
 * `tools/blog_cli` contains my tool for writing new blog posts and storing them
   in the DNS zone
-* `tools/kms_pass.nix` is a tiny tool that emulates the user-interface of
-  `pass`, but actually uses Google Cloud KMS for secret decryption
+* `ops/kms_pass.nix` is a tiny tool that emulates the user-interface of `pass`,
+  but actually uses Google Cloud KMS for secret decryption
 
 ## Packages / Libraries
 
-* `overrides/buildGo` implements a Nix library that can build Go software in the
-  style of Bazel's `rules_go`. Go programs in this repository are built using
-  this library.
-* `tools/emacs-pkgs` contains various Emacs libraries that my Emacs setup uses
+* `nix/buildGo` implements a Nix library that can build Go software in the style
+  of Bazel's `rules_go`. Go programs in this repository are built using this
+  library.
+* `tools/emacs-pkgs` contains various Emacs libraries that my Emacs setup uses,
+  for example:
+  * `dottime.el` provides [dottime][https://dotti.me] in the Emacs modeline
+  * `nix-util.el` provides editing utilities for Nix files
+  * `term-switcher.el` is an ivy-function for switching between vterm buffers
 
 ## Services
 
 Services in this repository are deployed on a Google Kubernetes Engine cluster
 using [Nixery]().
 
-* `services/tazblog` contains my blog software (serving at [tazj.in][])
-* `services/cgit-taz` contains a slightly patched version of `cgit` that serves
-  my git web interface at [git.tazj.in][]
-* `services/sync-gcsr` contains a tiny service that synchronises a Google Cloud
+* `web/tazblog` contains my blog software (serving at [tazj.in][])
+* `web/cgit-taz` contains a slightly patched version of `cgit` that serves my
+  git web interface at [git.tazj.in][]
+* `ops/sync-gcsr` contains a tiny service that synchronises a Google Cloud
   Source Repository with a local disk path. My `cgit` setup uses this
   under-the-hood.
-* `services/gemma` contains a no-longer-maintained service that served as an
+* `fun/gemma` contains a no-longer-maintained service that served as an
   experiment in "household task management" - it's kept in here because I find
   it interesting
 
 # Contributing
 
-If you'd like to contribute to any of the tools in here, please send a patch
-(using `git format-patch` or `git send-email`) to `reviews@tazj.in`.
+If you'd like to contribute to any of the tools in here, please check out the
+[contribution guidelines](/tree/docs/CONTRIBUTING.md).
 
 [monorepo]: https://en.wikipedia.org/wiki/Monorepo
 [Nix]: https://nixos.org/nix
diff --git a/bin/__dispatch.sh b/bin/__dispatch.sh
index f12d6ed368..d502a9dfaf 100755
--- a/bin/__dispatch.sh
+++ b/bin/__dispatch.sh
@@ -23,7 +23,7 @@ case "${TARGET_TOOL}" in
     attr="third_party.stern"
     ;;
   kms_pass)
-    attr="tools.kms_pass"
+    attr="ops.kms_pass"
     TARGET_TOOL="pass"
     ;;
   aoc2019)
diff --git a/ci-builds.nix b/ci-builds.nix
index 5ffc14e318..46480c41a1 100644
--- a/ci-builds.nix
+++ b/ci-builds.nix
@@ -1,18 +1,18 @@
-# This file is invoked by the CI build and recursively filters the
-# package set for attributes that should be built automatically.
+# This file defines the derivations that should be built by CI.
 #
-# Packages can be opted-in to being built by CI by setting
-# `meta.enableCI = true`.
-#
-# TODO(tazjin): Actually implement the above.
+# The plan is still to implement recursive tree traversal
+# automatically and detect all derivations that have `meta.enableCI =
+# true`, but this is currently more effort than it would save me.
 
 let
   pkgs = import ./default.nix {};
 in with pkgs; [
-  services.nixcon-demo
-  services.tazblog
+  ops.journaldriver
+  ops.kms_pass
+  ops.sync-gcsr
   tools.blog_cli
   tools.emacs
-  tools.kms_pass
-]
+  web.cgit-taz
 
+  # web.tazblog #  TODO(tazjin): Happstack build failure in nixos-unstable
+]
diff --git a/default.nix b/default.nix
index 38de1be0de..34fd8dea2e 100644
--- a/default.nix
+++ b/default.nix
@@ -29,9 +29,12 @@ let
   readTree' = import ./read-tree.nix;
 
   localPkgs = readTree: {
-    services    = readTree ./services;
-    tools       = readTree ./tools;
+    fun         = readTree ./ops;
+    nix         = readTree ./nix;
+    ops         = readTree ./ops;
     third_party = readTree ./third_party;
+    tools       = readTree ./tools;
+    web         = readTree ./web;
   };
 in fix(self: {
   config = config self;
@@ -53,30 +56,5 @@ in fix(self: {
 #
 # This can be used to move things from third_party into the top-level, too (such
 # as `lib`).
-// (readTree' self.config) ./overrides
-
-# These packages must be exposed at the top-level for compatibility
-# with Nixery.
-// {
-  inherit (self.third_party)
-    bashInteractive
-    cacert
-    coreutils
-    iana-etc
-    jq
-    moreutils
-    nano
-    openssl
-    runCommand
-    symlinkJoin
-    writeText;
-}
-
-# These packages must be exposed for compatibility with buildGo.
-#
-# Despite buildGo being tracked in this tree, I want it to be possible
-# for external users to import it with the default nixpkgs layout.
-// {
-  inherit (self.third_party) go ripgrep;
-}
+// (readTree' { pkgs = self; }) ./overrides
 )
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
index 8037e1bf7f..207b91f0cb 100644
--- a/docs/CONTRIBUTING.md
+++ b/docs/CONTRIBUTING.md
@@ -16,7 +16,8 @@ Contribution Guidelines
 This is a loose set of "guidelines" for contributing to my depot. Please note
 that I will not accept any patches that don't follow these guidelines.
 
-Also consider the [code of conduct](CODE_OF_CONDUCT.md). No really, you should.
+Also consider the [code of conduct](/tree/docs/CODE_OF_CONDUCT.md). No really,
+you should.
 
 ## Before making a change
 
diff --git a/ops/infra/.skip-subtree b/ops/infra/.skip-subtree
new file mode 100644
index 0000000000..cee24b7579
--- /dev/null
+++ b/ops/infra/.skip-subtree
@@ -0,0 +1,2 @@
+Code under //ops/infra is mostly configuration for other tools, not
+Nix derivations to be built.
diff --git a/ops/secrets/.skip-subtree b/ops/secrets/.skip-subtree
new file mode 100644
index 0000000000..25dba2a344
--- /dev/null
+++ b/ops/secrets/.skip-subtree
@@ -0,0 +1 @@
+No Nix derivations under //ops/secrets
diff --git a/overrides/default.nix b/overrides/default.nix
new file mode 100644
index 0000000000..2159d45bd0
--- /dev/null
+++ b/overrides/default.nix
@@ -0,0 +1,28 @@
+# This file is used to move things from nested attribute sets to the
+# top-level.
+{ pkgs, ... }:
+
+{
+  buildGo = pkgs.nix.buildGo;
+
+  # These packages must be exposed at the top-level for compatibility
+  # with Nixery.
+  inherit (pkgs.third_party)
+    bashInteractive
+    cacert
+    coreutils
+    iana-etc
+    jq
+    moreutils
+    nano
+    openssl
+    runCommand
+    symlinkJoin
+    writeText;
+
+  # These packages must be exposed for compatibility with buildGo.
+  #
+  # Despite buildGo being tracked in this tree, I want it to be possible
+  # for external users to import it with the default nixpkgs layout.
+  inherit (pkgs.third_party) go ripgrep;
+}
diff --git a/overrides/elmPackages.nix b/overrides/elmPackages/default.nix
index 20026d9180..20026d9180 100644
--- a/overrides/elmPackages.nix
+++ b/overrides/elmPackages/default.nix
diff --git a/overrides/kontemplate.nix b/overrides/kontemplate/default.nix
index 40f6b68b29..40f6b68b29 100644
--- a/overrides/kontemplate.nix
+++ b/overrides/kontemplate/default.nix
diff --git a/overrides/writeElispBin.nix b/overrides/writeElispBin/default.nix
index a1616fb9d4..a1616fb9d4 100644
--- a/overrides/writeElispBin.nix
+++ b/overrides/writeElispBin/default.nix