refactor: Fix a variety of filepaths for repo relayouting

This fixes readTree and the various project builds, as well
as (hopefully) most documentation links inside of the projects.
This commit is contained in:
Vincent Ambo 2019-12-20 20:37:02 +00:00
parent 03bfe08e1d
commit 8de5d093d8
12 changed files with 69 additions and 55 deletions

2
.envrc
View file

@ -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"

View file

@ -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

View file

@ -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)

View file

@ -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
]

View file

@ -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
)

View file

@ -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

2
ops/infra/.skip-subtree Normal file
View file

@ -0,0 +1,2 @@
Code under //ops/infra is mostly configuration for other tools, not
Nix derivations to be built.

View file

@ -0,0 +1 @@
No Nix derivations under //ops/secrets

28
overrides/default.nix Normal file
View file

@ -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;
}