diff options
Diffstat (limited to 'krebs/2configs')
-rw-r--r-- | krebs/2configs/buildbot-stockholm.nix | 35 | ||||
-rw-r--r-- | krebs/2configs/repo-sync.nix | 172 | ||||
-rw-r--r-- | krebs/2configs/shack/mobile.mpd.nix | 32 |
3 files changed, 194 insertions, 45 deletions
diff --git a/krebs/2configs/buildbot-stockholm.nix b/krebs/2configs/buildbot-stockholm.nix index 62a5f9ab5..8537ce40c 100644 --- a/krebs/2configs/buildbot-stockholm.nix +++ b/krebs/2configs/buildbot-stockholm.nix @@ -4,6 +4,22 @@ let hostname = config.networking.hostName; + sourceRepos = [ + "http://cgit.enklave.r/stockholm" + "http://cgit.gum.r/stockholm" + "http://cgit.hotdog.r/stockholm" + "http://cgit.ni.r/stockholm" + "http://cgit.prism.r/stockholm" + ]; + + build = pkgs.writeDash "build" '' + set -eu + export USER="$1" + export SYSTEM="$2" + $(nix-build $USER/krops.nix --no-out-link --argstr name "$SYSTEM" --argstr target "$HOME/stockholm-build" -A ci) + ''; + + in { networking.firewall.allowedTCPPorts = [ 80 ]; @@ -23,17 +39,16 @@ in slaves = { testslave = "lasspass"; }; - change_source.stockholm = '' - stockholm_repo = 'http://cgit.prism.r/stockholm' + change_source.stockholm = concatMapStrings (repo: '' cs.append( changes.GitPoller( - stockholm_repo, - workdir='stockholm-poller', branches=True, + "${repo}", + workdir='stockholm${elemAt(splitString "." repo) 1}', branches=True, project='stockholm', pollinterval=10 ) ) - ''; + '') sourceRepos; scheduler = { auto-scheduler = '' sched.append( @@ -61,7 +76,7 @@ in builder_pre = '' # prepare grab_repo step for stockholm grab_repo = steps.Git( - repourl=stockholm_repo, + repourl=util.Property('repository', 'http://cgit.hotdog.r/stockholm'), mode='full', submodules=True, ) @@ -95,15 +110,9 @@ in env={ "NIX_PATH": "secrets=/var/src/stockholm/null:stockholm=./:/var/src", "NIX_REMOTE": "daemon", - "dummy_secrets": "true", }, command=[ - "nix-shell", "-I", "stockholm=.", "--run", " ".join(["test", - "--user={}".format(user), - "--system={}".format(host), - "--force-populate", - "--target=$LOGNAME@${config.krebs.build.host.name}$HOME/{}".format(user), - ]) + "${build}", user, host ], timeout=90001, workdir='build', # TODO figure out why we need this? diff --git a/krebs/2configs/repo-sync.nix b/krebs/2configs/repo-sync.nix index 48da88a8d..3ca94fc1b 100644 --- a/krebs/2configs/repo-sync.nix +++ b/krebs/2configs/repo-sync.nix @@ -3,78 +3,186 @@ with import <stockholm/lib>; let + konsens-user = { + name = "konsens"; + pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKKozGNGBAzHnyj6xUlsjGxxknyChXvuyrddkWVVnz7"; + }; mirror = "git@${config.networking.hostName}:"; - defineRepo = name: announce: let + defineRepo = { + name, desc, section + }: + let repo = { public = true; name = mkDefault "${name}"; - cgit.desc = mkDefault "mirror for ${name}"; - cgit.section = mkDefault "mirror"; - hooks = mkIf announce (mkDefault { + cgit.desc = desc; + cgit.section = section; + hooks = mkDefault { post-receive = pkgs.git-hooks.irc-announce { - nick = config.networking.hostName; - verbose = false; channel = "#xxx"; + refs = [ + "refs/heads/master" + "refs/heads/newest" + "refs/tags/*" + ]; + nick = config.networking.hostName; server = "irc.r"; - branches = [ "master" ]; + verbose = false; }; - }); + }; }; in { - rules = with git; singleton { - user = with config.krebs.users; [ - config.krebs.users."${config.networking.hostName}-repo-sync" - ]; - repo = [ repo ]; - perm = push ''refs/*'' [ non-fast-forward create delete merge ]; - }; + rules = with git; [ + { + user = with config.krebs.users; [ + config.krebs.users."${config.networking.hostName}-repo-sync" + jeschli + lass + makefu + tv + ]; + repo = [ repo ]; + perm = push ''refs/*'' [ non-fast-forward create delete merge ]; + } + { + user = [ + konsens-user + ]; + repo = [ repo ]; + perm = push ''refs/heads/master'' [ create merge ]; + } + { + user = attrValues config.krebs.users; + repo = [ repo ]; + perm = fetch; + } + ]; repos."${name}" = repo; }; - sync-retiolum = name: + sync-retiolum = { + name, + desc ? "mirror for ${name}", + section ? "mirror" + }: { krebs.repo-sync.repos.${name} = { branches = { - makefu = { - origin.url = "http://cgit.gum/${name}"; + lassulus = { + origin.url = "http://cgit.lassul.us/${name}"; mirror.url = "${mirror}${name}"; }; - tv = { - origin.url = "http://cgit.ni.r/${name}"; + makefu = { + origin.url = "http://cgit.gum/${name}"; mirror.url = "${mirror}${name}"; }; nin = { origin.url = "http://cgit.onondaga.r/${name}"; mirror.url = "${mirror}${name}"; }; - lassulus = { - origin.url = "http://cgit.lassul.us/${name}"; + tv = { + origin.url = "http://cgit.ni.r/${name}"; mirror.url = "${mirror}${name}"; }; }; latest = { url = "${mirror}${name}"; - ref = "heads/master"; + ref = "heads/newest"; }; }; - krebs.git = defineRepo name false; + krebs.git = defineRepo { inherit name desc section; }; + }; + + sync-remote = { + name, + url, + desc ? "mirror for ${name}", + section ? "mirror" + }: + { + krebs.repo-sync.repos.${name} = { + branches = { + remote = { + origin.url = url; + mirror.url = "${mirror}${name}"; + }; + }; + }; + krebs.git = defineRepo { inherit name desc section; }; }; in { + krebs.git = { + enable = true; + cgit.settings = { + root-title = "krebs repos"; + root-desc = "keep calm and engage"; + }; + }; krebs.repo-sync = { enable = true; }; - krebs.git = { - enable = mkDefault true; - cgit = { - settings = { - root-title = "Shared Repos"; - root-desc = "keep on krebsing"; - }; + krebs.konsens = { + enable = true; + repos = { + krops = { branchesToCheck = [ "lassulus" "tv" ]; }; + stockholm = {}; }; }; + krebs.secret.files.konsens = { + path = "/var/lib/konsens/.ssh/id_ed25519"; + owner = konsens-user; + source-path = "${<secrets/konsens.id_ed25519>}"; + }; + imports = [ - (sync-retiolum "stockholm") + (sync-retiolum { name = "the_playlist"; desc = "Good Music collection + tools"; section = "art"; }) + + (sync-retiolum { name = "stockholm"; desc = "take all computers hostage, they love it"; section = "configuration"; }) + + (sync-retiolum { name = "cholerab"; desc = "krebs thesauron & enterprise-patterns"; section = "documentation"; }) + + (sync-retiolum { name = "disko"; desc = "take a description of your disk layout and produce a format script"; section = "software"; }) + (sync-retiolum { name = "news"; desc = "take a rss feed and a timeout and print it to stdout"; section = "software"; }) + (sync-retiolum { name = "krops"; desc = "krebs ops"; section = "software"; }) + (sync-retiolum { name = "go"; desc = "url shortener"; section = "software"; }) + (sync-retiolum { name = "much"; desc = "curses email client"; section = "software"; }) + (sync-retiolum { name = "newsbot-js"; desc = "irc rss/atom bot"; section = "software"; }) + (sync-retiolum { name = "nix-writers"; desc = "high level writers for nix"; section = "software"; }) + + (sync-retiolum { name = "cac-api"; desc = "CloudAtCost API command line interface"; section = "miscellaneous"; }) + (sync-retiolum { name = "dic"; desc = "dict.leo.org command line interface"; section = "miscellaneous"; }) + (sync-retiolum { name = "get"; section = "miscellaneous"; }) + (sync-retiolum { name = "hstool"; desc = "Haskell Development Environment ^_^"; section = "miscellaneous"; }) + (sync-retiolum { name = "htgen"; desc = "toy HTTP server"; section = "miscellaneous"; }) + (sync-retiolum { name = "kirk"; desc = "IRC tools"; section = "miscellaneous"; }) + (sync-retiolum { name = "load-env"; section = "miscellaneous"; }) + (sync-retiolum { name = "loldns"; desc = "toy DNS server"; section = "miscellaneous"; }) + (sync-retiolum { name = "netcup"; desc = "netcup command line interface"; section = "miscellaneous"; }) + (sync-retiolum { name = "populate"; desc = "source code installer"; section = "miscellaneous"; }) + (sync-retiolum { name = "q"; section = "miscellaneous"; }) + (sync-retiolum { name = "regfish"; section = "miscellaneous"; }) + (sync-retiolum { name = "soundcloud"; desc = "SoundCloud command line interface"; section = "miscellaneous"; }) + + (sync-retiolum { name = "blessings"; section = "Haskell libraries"; }) + (sync-retiolum { name = "mime"; section = "Haskell libraries"; }) + (sync-retiolum { name = "quipper"; section = "Haskell libraries"; }) + (sync-retiolum { name = "scanner"; section = "Haskell libraries"; }) + (sync-retiolum { name = "wai-middleware-time"; section = "Haskell libraries"; }) + (sync-retiolum { name = "web-routes-wai-custom"; section = "Haskell libraries"; }) + (sync-retiolum { name = "xintmap"; section = "Haskell libraries"; }) + (sync-retiolum { name = "xmonad-stockholm"; desc = "krebs xmonad modules"; section = "Haskell libraries"; }) + + (sync-remote { name = "array"; url = "https://github.com/makefu/array"; }) + (sync-remote { name = "email-header"; url = "https://github.com/4z3/email-header"; }) + (sync-remote { name = "mycube-flask"; url = "https://github.com/makefu/mycube-flask"; }) + (sync-remote { name = "reaktor-titlebot"; url = "https://github.com/makefu/reaktor-titlebot"; }) + (sync-remote { name = "repo-sync"; url = "https://github.com/makefu/repo-sync"; }) + (sync-remote { name = "skytraq-datalogger"; url = "https://github.com/makefu/skytraq-datalogger"; }) + (sync-remote { name = "realwallpaper"; url = "https://github.com/lassulus/realwallpaper"; }) + (sync-remote { name = "painload"; url = "https://github.com/krebs/painload"; }) + (sync-remote { name = "Reaktor"; url = "https://github.com/krebs/Reaktor"; }) + (sync-remote { name = "nixos-wiki"; url = "https://github.com/Mic92/nixos-wiki.wiki.git"; }) ]; } diff --git a/krebs/2configs/shack/mobile.mpd.nix b/krebs/2configs/shack/mobile.mpd.nix new file mode 100644 index 000000000..2dc466edb --- /dev/null +++ b/krebs/2configs/shack/mobile.mpd.nix @@ -0,0 +1,32 @@ +{lib,pkgs, ... }: +let + mpdHost = "mpd.shack"; + ympd = name: port: let + webPort = 10000 + port; + in { + systemd.services."ympd-${name}" = { + description = "mpd for ${name}"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.ExecStart = "${pkgs.ympd}/bin/ympd --host ${mpdHost} --port ${toString port} --webport ${toString webPort} --user nobody"; + }; + services.nginx.virtualHosts."mobile.${name}.mpd.shack" = { + serverAliases = [ + "${name}.mpd.wolf.r" + "${name}.mpd.wolf.shack" + ]; + locations."/".proxyPass = "http://localhost:${toString webPort}"; + }; + }; +in lib.mkMerge [{ + services.nginx.enable = true; +} + (ympd "lounge" 6600) + (ympd "seminarraum" 6601) + (ympd "elab" 6602) + (ympd "kueche" 6603) + (ympd "crafting" 6604) + (ympd "fablab" 6605) + (ympd "workshop" 6606) + (ympd "klo" 6607) + +] |