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 # Configure the local PATH to contain tools which are fetched ad-hoc
# from Nix. # from Nix.
export PATH="${PWD}/tools/bin:${PATH}" export PATH="${PWD}/bin:${PATH}"
export NIX_PATH="nixpkgs=${PWD}/default.nix" export NIX_PATH="nixpkgs=${PWD}/default.nix"
export REPO_ROOT="${PWD}" export REPO_ROOT="${PWD}"
export SECRETS_DIR="${PWD}/secrets" export SECRETS_DIR="${PWD}/secrets"

View file

@ -20,39 +20,43 @@ Twitter][].
## Tools ## Tools
* `tools/emacs` contains my personal Emacs configuration (packages & config) * `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 challenges, before I ran out of interest
* `tools/blog_cli` contains my tool for writing new blog posts and storing them * `tools/blog_cli` contains my tool for writing new blog posts and storing them
in the DNS zone in the DNS zone
* `tools/kms_pass.nix` is a tiny tool that emulates the user-interface of * `ops/kms_pass.nix` is a tiny tool that emulates the user-interface of `pass`,
`pass`, but actually uses Google Cloud KMS for secret decryption but actually uses Google Cloud KMS for secret decryption
## Packages / Libraries ## Packages / Libraries
* `overrides/buildGo` implements a Nix library that can build Go software in the * `nix/buildGo` implements a Nix library that can build Go software in the style
style of Bazel's `rules_go`. Go programs in this repository are built using of Bazel's `rules_go`. Go programs in this repository are built using this
this library. library.
* `tools/emacs-pkgs` contains various Emacs libraries that my Emacs setup uses * `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
Services in this repository are deployed on a Google Kubernetes Engine cluster Services in this repository are deployed on a Google Kubernetes Engine cluster
using [Nixery](). using [Nixery]().
* `services/tazblog` contains my blog software (serving at [tazj.in][]) * `web/tazblog` contains my blog software (serving at [tazj.in][])
* `services/cgit-taz` contains a slightly patched version of `cgit` that serves * `web/cgit-taz` contains a slightly patched version of `cgit` that serves my
my git web interface at [git.tazj.in][] git web interface at [git.tazj.in][]
* `services/sync-gcsr` contains a tiny service that synchronises a Google Cloud * `ops/sync-gcsr` contains a tiny service that synchronises a Google Cloud
Source Repository with a local disk path. My `cgit` setup uses this Source Repository with a local disk path. My `cgit` setup uses this
under-the-hood. 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 experiment in "household task management" - it's kept in here because I find
it interesting it interesting
# Contributing # Contributing
If you'd like to contribute to any of the tools in here, please send a patch If you'd like to contribute to any of the tools in here, please check out the
(using `git format-patch` or `git send-email`) to `reviews@tazj.in`. [contribution guidelines](/tree/docs/CONTRIBUTING.md).
[monorepo]: https://en.wikipedia.org/wiki/Monorepo [monorepo]: https://en.wikipedia.org/wiki/Monorepo
[Nix]: https://nixos.org/nix [Nix]: https://nixos.org/nix

View file

@ -23,7 +23,7 @@ case "${TARGET_TOOL}" in
attr="third_party.stern" attr="third_party.stern"
;; ;;
kms_pass) kms_pass)
attr="tools.kms_pass" attr="ops.kms_pass"
TARGET_TOOL="pass" TARGET_TOOL="pass"
;; ;;
aoc2019) aoc2019)

View file

@ -1,18 +1,18 @@
# This file is invoked by the CI build and recursively filters the # This file defines the derivations that should be built by CI.
# package set for attributes that should be built automatically.
# #
# Packages can be opted-in to being built by CI by setting # The plan is still to implement recursive tree traversal
# `meta.enableCI = true`. # automatically and detect all derivations that have `meta.enableCI =
# # true`, but this is currently more effort than it would save me.
# TODO(tazjin): Actually implement the above.
let let
pkgs = import ./default.nix {}; pkgs = import ./default.nix {};
in with pkgs; [ in with pkgs; [
services.nixcon-demo ops.journaldriver
services.tazblog ops.kms_pass
ops.sync-gcsr
tools.blog_cli tools.blog_cli
tools.emacs 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; readTree' = import ./read-tree.nix;
localPkgs = readTree: { localPkgs = readTree: {
services = readTree ./services; fun = readTree ./ops;
tools = readTree ./tools; nix = readTree ./nix;
ops = readTree ./ops;
third_party = readTree ./third_party; third_party = readTree ./third_party;
tools = readTree ./tools;
web = readTree ./web;
}; };
in fix(self: { in fix(self: {
config = config 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 # This can be used to move things from third_party into the top-level, too (such
# as `lib`). # as `lib`).
// (readTree' self.config) ./overrides // (readTree' { pkgs = self; }) ./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;
}
) )

View file

@ -16,7 +16,8 @@ Contribution Guidelines
This is a loose set of "guidelines" for contributing to my depot. Please note 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. 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 ## 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;
}