diff --git a/.envrc b/.envrc index 6b3ce7ebb..b943eb62a 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 d3537bfff..1b02a99f9 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 f12d6ed36..d502a9dfa 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 5ffc14e31..46480c41a 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 38de1be0d..34fd8dea2 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 8037e1bf7..207b91f0c 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 000000000..cee24b757 --- /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 000000000..25dba2a34 --- /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 000000000..2159d45bd --- /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 similarity index 100% rename from overrides/elmPackages.nix rename to overrides/elmPackages/default.nix diff --git a/overrides/kontemplate.nix b/overrides/kontemplate/default.nix similarity index 100% rename from overrides/kontemplate.nix rename to overrides/kontemplate/default.nix diff --git a/overrides/writeElispBin.nix b/overrides/writeElispBin/default.nix similarity index 100% rename from overrides/writeElispBin.nix rename to overrides/writeElispBin/default.nix