use ci channels

This commit is contained in:
arcnmx 2021-05-19 08:13:45 -07:00
parent 0c14e6c847
commit 34a41a64ba
2 changed files with 20 additions and 11 deletions

View file

@ -23,26 +23,36 @@ with lib; {
};
};
channels = {
nixfiles.path = ../.;
nixpkgs.path = "${channels.nixfiles.sources.nixpkgs}";
};
environment.test = {
inherit (channels.cipkgs) cachix;
inherit (channels.nixpkgs) niv;
};
jobs.niv-update = {
tasks.niv-build.inputs = with channels.cipkgs;
ci.command {
name = "niv-update-build";
displayName = "niv update build";
nativeBuildInputs = [ nix cachix ];
environment = [ "OPENSSH_PRIVATE_KEY" "CACHIX_SIGNING_KEY" ];
command = let sources = (import ../.).sources; in
''
command = ''
mkdir ~/.ssh
echo "$OPENSSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
for source in ${toString (attrNames sources)}; do
nix run -f . pkgs.niv -c niv update $source || true
for source in ${toString (attrNames channels.nixfiles.sources)}; do
niv update $source || true
done
if git status --porcelain | grep -qF nix/sources.json; then
if nix build -Lf . hosts.{athame,yule,samhain}.config.system.build.toplevel; then
nix build -f ../. sourceCache
${cachix}/bin/cachix push kittywitch $(nix eval '(toString (import ../.).sourceCache)')
nix-build $(echo "-A hosts."{athame,yule,samhain}.config.system.build.toplevel) | ${cachix}/bin/cachix push kittywitch
cachix push kittywitch $(nix eval '(toString (import ../.).sourceCache)')
nix-build $(echo "-A hosts."{athame,yule,samhain}.config.system.build.toplevel) | cachix push kittywitch
git add nix/sources.json
export GIT_{COMMITTER,AUTHOR}_EMAIL=kat@kittywit.ch
export GIT_{COMMITTER,AUTHOR}_NAME=kat witch