diff options
author | tv <tv@krebsco.de> | 2015-07-11 19:44:12 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-07-11 19:44:12 +0200 |
commit | 153422f74b1ed5cae37c9424514a9e9d1f79acb4 (patch) | |
tree | 94cd29e6a98f1ce6228104055d0550e318242290 | |
parent | e21f45386d7aeb3dd3e9d828e1702115f4ef2bce (diff) |
move old stuff
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | old/Makefile (renamed from Makefile) | 0 | ||||
-rw-r--r-- | old/README.md (renamed from README.md) | 0 | ||||
-rwxr-xr-x | old/bin/copy-secrets (renamed from bin/copy-secrets) | 0 | ||||
-rwxr-xr-x | old/bin/genid (renamed from bin/genid) | 0 | ||||
-rwxr-xr-x | old/bin/netmask-to-prefix (renamed from bin/netmask-to-prefix) | 0 | ||||
-rwxr-xr-x | old/bin/nixos-query (renamed from bin/nixos-query) | 0 | ||||
-rwxr-xr-x | old/bin/urlencode (renamed from bin/urlencode) | 0 | ||||
-rwxr-xr-x | old/cac (renamed from cac) | 0 | ||||
-rw-r--r-- | old/certs/zalora-ca.crt (renamed from certs/zalora-ca.crt) | 0 | ||||
-rw-r--r-- | old/default.nix | 151 | ||||
-rwxr-xr-x | old/deploy (renamed from deploy) | 0 | ||||
-rwxr-xr-x | old/infest-cac-CentOS-7-64bit.sh (renamed from infest-cac-CentOS-7-64bit.sh) | 0 | ||||
-rw-r--r-- | old/infest.d/cac-CentOS-7-64bit/finalize.sh (renamed from infest.d/cac-CentOS-7-64bit/finalize.sh) | 0 | ||||
-rw-r--r-- | old/infest.d/cac-CentOS-7-64bit/prepare.sh (renamed from infest.d/cac-CentOS-7-64bit/prepare.sh) | 0 | ||||
-rw-r--r-- | old/infest.d/nixos-install.sh (renamed from infest.d/nixos-install.sh) | 0 | ||||
-rw-r--r-- | old/lib/default.nix (renamed from lib/default.nix) | 0 | ||||
-rw-r--r-- | old/lib/git.nix (renamed from lib/git.nix) | 0 | ||||
-rw-r--r-- | old/lib/modules.nix (renamed from lib/modules.nix) | 0 | ||||
-rw-r--r-- | old/modules/cd/default.nix (renamed from modules/cd/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/cd/networking.nix (renamed from modules/cd/networking.nix) | 0 | ||||
-rw-r--r-- | old/modules/cd/paths.nix (renamed from modules/cd/paths.nix) | 0 | ||||
-rw-r--r-- | old/modules/cd/users.nix (renamed from modules/cd/users.nix) | 0 | ||||
-rw-r--r-- | old/modules/cloudkrebs/default.nix (renamed from modules/cloudkrebs/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/cloudkrebs/networking.nix (renamed from modules/cloudkrebs/networking.nix) | 0 | ||||
-rw-r--r-- | old/modules/common/krebs-keys.nix (renamed from modules/common/krebs-keys.nix) | 0 | ||||
-rw-r--r-- | old/modules/common/krebs-repos.nix (renamed from modules/common/krebs-repos.nix) | 0 | ||||
-rw-r--r-- | old/modules/common/nixpkgs.nix (renamed from modules/common/nixpkgs.nix) | 0 | ||||
-rw-r--r-- | old/modules/common/sshkeys.nix (renamed from modules/common/sshkeys.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/base.nix (renamed from modules/lass/base.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/binary-caches.nix (renamed from modules/lass/binary-caches.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/bird.nix (renamed from modules/lass/bird.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/bitcoin.nix (renamed from modules/lass/bitcoin.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/browsers.nix (renamed from modules/lass/browsers.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/chromium-patched.nix (renamed from modules/lass/chromium-patched.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/desktop-base.nix (renamed from modules/lass/desktop-base.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/elster.nix (renamed from modules/lass/elster.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/games.nix (renamed from modules/lass/games.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/gitolite-base.nix (renamed from modules/lass/gitolite-base.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/ircd.nix (renamed from modules/lass/ircd.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/pass.nix (renamed from modules/lass/pass.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/programs.nix (renamed from modules/lass/programs.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/retiolum-cloudkrebs.nix (renamed from modules/lass/retiolum-cloudkrebs.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/retiolum-mors.nix (renamed from modules/lass/retiolum-mors.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/retiolum-uriel.nix (renamed from modules/lass/retiolum-uriel.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/sshkeys.nix (renamed from modules/lass/sshkeys.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/steam.nix (renamed from modules/lass/steam.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/texlive.nix (renamed from modules/lass/texlive.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/urxvt.nix (renamed from modules/lass/urxvt.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/urxvtd.nix (renamed from modules/lass/urxvtd.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/vim.nix (renamed from modules/lass/vim.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/virtualbox.nix (renamed from modules/lass/virtualbox.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/wine.nix (renamed from modules/lass/wine.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/xresources.nix (renamed from modules/lass/xresources.nix) | 0 | ||||
-rw-r--r-- | old/modules/lass/xserver-lass.nix (renamed from modules/lass/xserver-lass.nix) | 0 | ||||
-rw-r--r-- | old/modules/mkdir/default.nix (renamed from modules/mkdir/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/mkdir/networking.nix (renamed from modules/mkdir/networking.nix) | 0 | ||||
-rw-r--r-- | old/modules/mkdir/paths.nix (renamed from modules/mkdir/paths.nix) | 0 | ||||
-rw-r--r-- | old/modules/mkdir/users.nix (renamed from modules/mkdir/users.nix) | 0 | ||||
-rw-r--r-- | old/modules/mors/default.nix (renamed from modules/mors/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/mors/git.nix (renamed from modules/mors/git.nix) | 0 | ||||
-rw-r--r-- | old/modules/mors/repos.nix (renamed from modules/mors/repos.nix) | 0 | ||||
-rw-r--r-- | old/modules/mu/default.nix (renamed from modules/mu/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/mu/paths.nix (renamed from modules/mu/paths.nix) | 0 | ||||
-rw-r--r-- | old/modules/nomic/default.nix (renamed from modules/nomic/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/nomic/hardware-configuration.nix (renamed from modules/nomic/hardware-configuration.nix) | 0 | ||||
-rw-r--r-- | old/modules/nomic/paths.nix (renamed from modules/nomic/paths.nix) | 0 | ||||
-rw-r--r-- | old/modules/nomic/users.nix (renamed from modules/nomic/users.nix) | 0 | ||||
-rw-r--r-- | old/modules/rmdir/default.nix (renamed from modules/rmdir/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/rmdir/networking.nix (renamed from modules/rmdir/networking.nix) | 0 | ||||
-rw-r--r-- | old/modules/rmdir/paths.nix (renamed from modules/rmdir/paths.nix) | 0 | ||||
-rw-r--r-- | old/modules/rmdir/users.nix (renamed from modules/rmdir/users.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/base-cac-CentOS-7-64bit.nix (renamed from modules/tv/base-cac-CentOS-7-64bit.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/base.nix (renamed from modules/tv/base.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/config/consul-client.nix (renamed from modules/tv/config/consul-client.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/config/consul-server.nix (renamed from modules/tv/config/consul-server.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/consul/default.nix (renamed from modules/tv/consul/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/ejabberd.nix (renamed from modules/tv/ejabberd.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/environment.nix (renamed from modules/tv/environment.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/exim-retiolum.nix (renamed from modules/tv/exim-retiolum.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/exim-smarthost.nix (renamed from modules/tv/exim-smarthost.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/git/cgit.nix (renamed from modules/tv/git/cgit.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/git/config.nix (renamed from modules/tv/git/config.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/git/default.nix (renamed from modules/tv/git/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/git/options.nix (renamed from modules/tv/git/options.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/git/public.nix (renamed from modules/tv/git/public.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/identity/default.nix (renamed from modules/tv/identity/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/iptables/config.nix (renamed from modules/tv/iptables/config.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/iptables/default.nix (renamed from modules/tv/iptables/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/iptables/options.nix (renamed from modules/tv/iptables/options.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/nginx/config.nix (renamed from modules/tv/nginx/config.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/nginx/default.nix (renamed from modules/tv/nginx/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/nginx/options.nix (renamed from modules/tv/nginx/options.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/retiolum/config.nix (renamed from modules/tv/retiolum/config.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/retiolum/default.nix (renamed from modules/tv/retiolum/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/retiolum/options.nix (renamed from modules/tv/retiolum/options.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/sanitize.nix (renamed from modules/tv/sanitize.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/smartd.nix (renamed from modules/tv/smartd.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/synaptics.nix (renamed from modules/tv/synaptics.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/urlwatch/default.nix (renamed from modules/tv/urlwatch/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/urxvt.nix (renamed from modules/tv/urxvt.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/users/default.nix (renamed from modules/tv/users/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/tv/xserver.nix (renamed from modules/tv/xserver.nix) | 0 | ||||
-rw-r--r-- | old/modules/uriel/default.nix (renamed from modules/uriel/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/uriel/repos.nix (renamed from modules/uriel/repos.nix) | 0 | ||||
-rw-r--r-- | old/modules/wu/default.nix (renamed from modules/wu/default.nix) | 0 | ||||
-rw-r--r-- | old/modules/wu/hosts.nix (renamed from modules/wu/hosts.nix) | 0 | ||||
-rw-r--r-- | old/modules/wu/paths.nix (renamed from modules/wu/paths.nix) | 0 | ||||
-rw-r--r-- | old/modules/wu/users.nix (renamed from modules/wu/users.nix) | 0 | ||||
-rw-r--r-- | old/pubkeys/deploy_wu.ssh.pub (renamed from pubkeys/deploy_wu.ssh.pub) | 0 | ||||
-rw-r--r-- | old/pubkeys/lass.ssh.pub (renamed from pubkeys/lass.ssh.pub) | 0 | ||||
-rw-r--r-- | old/pubkeys/makefu.ssh.pub (renamed from pubkeys/makefu.ssh.pub) | 0 | ||||
-rw-r--r-- | old/pubkeys/mv_vod.ssh.pub (renamed from pubkeys/mv_vod.ssh.pub) | 0 | ||||
-rw-r--r-- | old/pubkeys/tv_wu.ssh.pub (renamed from pubkeys/tv_wu.ssh.pub) | 0 | ||||
-rw-r--r-- | old/pubkeys/uriel.ssh.pub (renamed from pubkeys/uriel.ssh.pub) | 0 |
115 files changed, 151 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore deleted file mode 100644 index bad1d00..0000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.graveyard -/hosts -/secrets -/tmp diff --git a/README.md b/old/README.md index 8a72d2f..8a72d2f 100644 --- a/README.md +++ b/old/README.md diff --git a/bin/copy-secrets b/old/bin/copy-secrets index f404935..f404935 100755 --- a/bin/copy-secrets +++ b/old/bin/copy-secrets diff --git a/bin/genid b/old/bin/genid index 8e22407..8e22407 100755 --- a/bin/genid +++ b/old/bin/genid diff --git a/bin/netmask-to-prefix b/old/bin/netmask-to-prefix index 1c4dbeb..1c4dbeb 100755 --- a/bin/netmask-to-prefix +++ b/old/bin/netmask-to-prefix diff --git a/bin/nixos-query b/old/bin/nixos-query index 1111aea..1111aea 100755 --- a/bin/nixos-query +++ b/old/bin/nixos-query diff --git a/bin/urlencode b/old/bin/urlencode index 02ca030..02ca030 100755 --- a/bin/urlencode +++ b/old/bin/urlencode diff --git a/certs/zalora-ca.crt b/old/certs/zalora-ca.crt index 12cdf8f..12cdf8f 100644 --- a/certs/zalora-ca.crt +++ b/old/certs/zalora-ca.crt diff --git a/old/default.nix b/old/default.nix new file mode 100644 index 0000000..8415348 --- /dev/null +++ b/old/default.nix @@ -0,0 +1,151 @@ +{ system-name +, rsync-target ? null +, deploy-target ? null +}: + +# TODO assert that only one of rsync-target or deploy-target is not null + +with builtins; +assert (typeOf system-name == "string"); +with import <nixpkgs/lib>; +let + paths-file = toPath "${dirOf __curPos.file}/modules/${system-name}/paths.nix"; + + paths = import paths-file; + + prefetch.file = '' + echo "$prefetch_in_url" + ''; + + prefetch.git = '' + ${concatMapStringsSep "\n" (attr-name: '' + case ''${prefetch_in_${escapeShellArg attr-name}-?} in \?) + printf '%s: %s: missing attribute: %s' \ + ${escapeShellArg paths-file} \ + "$prefetch_name" \ + ${escapeShellArg attr-name} \ + >&2 + return 1 + esac + '') [ "rev" "url" "cache" ]} + + git_rev=$prefetch_in_rev + git_url=$prefetch_in_url + + # cache_dir points to a (maybe non-existent) directory, where a shared cache of + # the repository should be maintained. The shared cache is used to create + # multiple working trees of the repository. + cache_dir=$prefetch_in_cache/$(echo "$git_url" | urlencode) + cache_git() { + git --git-dir="$cache_dir" "$@" + } + + # work_dir points to a (maybe non-existent) directory, where a specific + # revision of the repository is checked out. + # XXX this is probably a bad idea if git_rev is not a commit + work_dir=$cache_dir-$(cache_git rev-parse --verify "$git_rev" | urlencode) + work_git() { + git -C "$work_dir" "$@" + } + + is_up_to_date() { + test -d "$cache_dir" && + test -d "$work_dir" && + test "$(cache_git rev-parse --verify "$git_rev")" = "$git_rev" && + test "$(work_git rev-parse --verify HEAD)" = "$git_rev" + } + + # Notice how the remote name "origin" has been chosen arbitrarily, but must be + # kept in sync with the default value of nixpkgs.rev. + if ! is_up_to_date; then + if ! test -d "$cache_dir"; then + mkdir -p "$cache_dir" + cache_git init --bare + fi + if ! cache_git_url=$(cache_git config remote.origin.url); then + cache_git remote add origin "$git_url" + elif test "$cache_git_url" != "$git_url"; then + cache_git remote set-url origin "$git_url" + fi + cache_git fetch origin + if ! test -d "$work_dir"; then + git clone -n --shared "$cache_dir" "$work_dir" + fi + commit_name=$(cache_git rev-parse --verify "$git_rev") + work_git checkout "$commit_name" -- "$(readlink -f "$work_dir")" + work_git checkout -q "$commit_name" + work_git submodule init + work_git submodule update + fi + work_git clean -dxf + + echo "$work_dir" + ''; + + + f = pkg-name: pkg-spec: + let + types = attrNames pkg-spec; + type = elemAt types 0; + in + assert (length types == 1); # there can be only one source type + '' + out=$(${concatStringsSep " \\\n" (mapAttrsToList (k: v: + "prefetch_in_${escapeShel |