Merge pull request 'Switch to gitea' (#1) from switch-to-gitea into main

Reviewed-on: #1
This commit is contained in:
Charlotte 🦝 Delenk 2023-04-08 13:16:22 +00:00
commit a21c0169b8
Signed by: gitea-bot
GPG key ID: C9974EDF9932B558
8 changed files with 67 additions and 202 deletions

View file

@ -1,59 +0,0 @@
---
kind: pipeline
type: docker
name: update-script
steps:
- name: Update flake
image: nixos/nix
commands:
- echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
- nix flake update
- name: Run update script
image: nixos/nix
commands:
- yes | nix-shell ./scripts/update.nix
depends_on:
- Update flake
- name: Format nix
image: nixery.dev/shell/alejandra
commands:
- alejandra .
depends_on:
- Run update script
- name: Push git
image: nixery.dev/shell/gitfull/git-lfs/shadow
commands:
- groupadd -g 0 root
- useradd -u 0 -g root -d $HOME root
- mkdir ~/.ssh
- echo "$SSH_KEY" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- echo "git.chir.rs ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICQ77jA9S5qXDFGPLZRsC++AtxiXXeF8gVbkLlglx0GQ" > ~/.ssh/known_hosts
- echo "git.chir.rs ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDY0pZzNTAqaVqqfC31gYFixFs5KySv0UqvlDEAzEXJMB/pBWkE5GAd5Ik1NxD4QiAVWc2UARdmJEBbYf8mk5JiAv6fjsodJdJVRau4Ax7FtIfbxdFyzBgFery/KUnNIr6cmAWU2Af8JhzrnpEbhe5U3LftYnkdE1lI+iVqaQRARp0qikdzoAl3uMUhbdTxp1/6rtfN6bP2XZCsUx3t3W5ZG1QTQz8l7nrbXZX1TT3pZ2vcUANcMtOxEAwO6lbL210GX63C8XEoE7+4lLxRrSiaq3SkVlG07VspozKEtrrcsqCRNLebiaapmNWVoEq9Wd9VGAEjja5efyU6/HUlRogAOo1WP73UwoQLv5LTFH+ECoHhKS14xfPeXeVG8dbYyh5+CnmiVe43dH1qZw+ceYuYel31f47cAgScbxFvNkct0spK9m9mivnoUmYcxwTc+VbFbmnJvSuZw3a+OEYn9biitP/tTkYFiLZVdPZTxDkvd1oOyuVH9d4RMXbVgNS92/lr2iKFZkyhWMJ61hFMc2tupwmkp5Us5ce42XA0zC/aVY3vYoih/c5Ib0eZF1AEJdB6Bt5dWqITVsB3mip3Jn/mqVBIPTGXT6+FnGSEuL68Dj2yKBD7kj8YO/1SWpkVMy+bfoLXY/usgcaLCxpUu8dDrdrcKExLigCVbi3rdRmg7w==" >> ~/.ssh/known_hosts
- git remote set-url origin gitea@git.chir.rs:darkkirb/nix-packages.git
- git config --global 'user.email' 'gitea-bot@chir.rs'
- git config --global 'user.name' 'Gitea Bot'
- git add .
- git commit -am "Update packages"
- git push --force origin main:update-package
environment:
SSH_KEY:
from_secret: SSH_KEY
depends_on:
- Format nix
- name: Create pull request
image: nixery.dev/shell/curl
commands:
- |
echo '{ "assignee": "DarkKirb", "base": "main", "head": "update-package", "title": "Update packages", "body": "" }' | curl -XPOST 'https://git.chir.rs/api/v1/repos/DarkKirb/nix-packages/pulls' -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $AUTHORISATION" --data-binary @-
environment:
AUTHORISATION:
from_secret: GITEA_KEY
depends_on:
- Push git
trigger:
event:
- cron
cron:
- updater

View file

@ -1,46 +0,0 @@
name: update
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: "49 4 * * *"
jobs:
flake-lock:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs= chir-rs:AnwyFacopHSkprD6aXY4/R3J9JYzTbV2rosJCBPaB28=
experimental-features = nix-command flakes ca-derivations
post-build-hook = ${{ github.workspace }}/scripts/post-build-hook
substituters = https://attic.chir.rs/chir-rs/ https://cache.nixos.org/
- name: Download attic
run: nix build github:DarkKirb/nix-packages#attic-client
- name: Set up secrets
run: nix run github:DarkKirb/nix-packages#attic-client -- login attic-server https://attic-nocdn.chir.rs/ "$ATTIC_TOKEN"
env:
ATTIC_TOKEN: ${{secrets.ATTIC_TOKEN}}
- name: Update flake.lock
run: nix flake update
- name: Run update script
run: yes '' | nix-shell ./scripts/update.nix --argstr max-workers 1
- name: Format
run: nix fmt
- name: Delete secrets
run: |
rm ~/cache.key
- name: Create PR
uses: peter-evans/create-pull-request@v4.2.0
with:
commit-message: Update nix-packages
author: Github Actions <github-actions@users.noreply.github.com>
committer: Github Actions <github-actions@users.noreply.github.com>
title: Automated updates for nix-packages
body: Automated updates
assignees: darkkirb
reviewers: darkkirb

View file

@ -1,44 +0,0 @@
{
fetchFromGitHub,
buildGoModule,
writeScript,
}: let
source = builtins.fromJSON (builtins.readFile ./source.json);
src = fetchFromGitHub {
owner = "drone-runners";
repo = "drone-runner-docker";
inherit (source) rev sha256;
};
in
buildGoModule rec {
pname = "drone-runner-docker";
version = source.date;
inherit src;
vendorSha256 = builtins.readFile ./goVendor.hash;
proxyVendor = true;
meta = {
description = "Docker executor for drone";
license = [
{
free = false;
fullName = "PolyForm Small Business License 1.0.0";
redistributable = true;
spdxId = "PolyForm-Small-Business-1.0.0";
url = "https://spdx.org/licenses/PolyForm-Small-Business-1.0.0.html";
}
{
free = false;
fullName = "PolyForm Free Trial License 1.0.0";
redistributable = true;
url = "https://polyformproject.org/licenses/free-trial/1.0.0/";
}
];
};
passthru.updateScript = writeScript "update-matrix-media-repo" ''
${../../scripts/update-git.sh} "https://github.com/drone-runners/drone-runner-docker" ci/drone-runner-docker/source.json
if [ "$(git diff -- ci/drone-runner-docker/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-go.sh} ./ci/drone-runner-docker ci/drone-runner-docker/goVendor.hash
fi
'';
}

View file

@ -1 +0,0 @@
sha256-E4VV1sM408eXtOFCewOWG275rbqbomlVFw8nZI6uN0E=

View file

@ -1,11 +0,0 @@
{
"url": "https://github.com/drone-runners/drone-runner-docker",
"rev": "7e9969423c0883c0300c974bbb7583e3d9ece875",
"date": "2023-01-31T11:26:39+00:00",
"path": "/nix/store/di6ahlqfjgpac2s2y8xcxz0a8nhghxnz-drone-runner-docker",
"sha256": "0k28w2s8ck0k37wajp0370gijzyjp88fgn6n8ywnyda9fba0q8yw",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -63,7 +63,6 @@
emoji-volpeon-vlpn = pkgs.callPackage ./art/emoji/volpeon/vlpn.nix {};
emoji-caro = pkgs.callPackage ./art/emoji/caro {};
lotte-art = pkgs.callPackage ./art/lotte {};
drone-runner-docker = pkgs.callPackage ./ci/drone-runner-docker {};
alco-sans = pkgs.callPackage ./fonts/kreative/alco-sans.nix {};
constructium = pkgs.callPackage ./fonts/kreative/constructium.nix {};
fairfax = pkgs.callPackage ./fonts/kreative/fairfax.nix {};

View file

@ -7,19 +7,17 @@
systems = ["x86_64-linux" "aarch64-linux"];
nixpkgs_version = ["master"];
mkJobsets = system: version:
(pkgs.lib.mapAttrs' (
num: info: {
name = "${system}-${version}-pr${num}";
(builtins.listToAttrs (
map (
info: {
name = "${system}-${version}-pr${toString info.number}";
value = {
enabled = 1;
hidden = false;
description = "PR ${num} (${system}-${version}): ${info.title}";
enabled = info.state == "open";
hidden = info.state != "open";
description = "PR ${toString info.number} (${system}-${version}): ${info.title}";
nixexprinput = "nix-packages";
nixexprpath = "hydra/default.nix";
checkinterval =
if info.head.repo.owner.login == "darkkirb" && info.head.repo.name == "nix-packages" # Dont need to manually check
then 0
else 300;
checkinterval = 3600;
schedulingshares = 100;
enableemail = false;
emailoverride = "";
@ -27,7 +25,7 @@
inputs = {
nix-packages = {
type = "git";
value = "https://github.com/${info.head.repo.owner.login}/${info.head.repo.name}.git ${info.head.ref}";
value = "${info.head.repo.clone_url} ${info.head.ref}";
emailresponsible = false;
};
nixpkgs = {
@ -39,11 +37,27 @@
type = "string";
value = system;
};
gitea_status_repo = {
type = "string";
value = "nix-packages";
emailresponsible = false;
};
gitea_repo_owner = {
type = "string";
value = "${info.head.repo.owner.login}";
emailresponsible = false;
};
gitea_repo_name = {
type = "string";
value = "${info.head.repo.name}";
emailresponsible = false;
};
};
};
}
)
prs)
prs
))
// {
"${system}-${version}" = {
enabled = 1;
@ -59,7 +73,7 @@
inputs = {
nix-packages = {
type = "git";
value = "https://github.com/DarkKirb/nix-packages.git main";
value = "https://git.chir.rs/darkkirb/nix-packages main";
emailresponsible = false;
};
nixpkgs = {
@ -71,33 +85,26 @@
type = "string";
value = system;
};
};
};
};
concatAttrs = pkgs.lib.foldr (a: b: a // b) {};
jobsets =
(concatAttrs (pkgs.lib.concatMap (system: map (version: mkJobsets system version) nixpkgs_version) systems))
// {
nix-packages-flake = {
enabled = 1;
hidden = false;
description = "nix-packages flake";
nixexprinput = "nix-packages";
nixexprpath = "hydra/parse-flake.nix";
checkinterval = 0;
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 1;
inputs = {
flake = {
type = "git";
value = "https://github.com/DarkKirb/nix-packages.git main";
gitea_status_repo = {
type = "string";
value = "nix-packages";
emailresponsible = false;
};
gitea_repo_owner = {
type = "string";
value = "darkkirb";
emailresponsible = false;
};
gitea_repo_name = {
type = "string";
value = "nixos-config";
emailresponsible = false;
};
};
};
};
concatAttrs = pkgs.lib.foldr (a: b: a // b) {};
jobsets =
concatAttrs (pkgs.lib.concatMap (system: map (version: mkJobsets system version) nixpkgs_version) systems);
in {jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets);}

View file

@ -12,7 +12,7 @@
"inputs": {
"nix-packages": {
"type": "git",
"value": "https://github.com/DarkKirb/nix-packages.git main",
"value": "https://git.chir.rs/darkkirb/nix-packages.git switch-to-gitea",
"emailresponsible": false
},
"nixpkgs": {
@ -21,8 +21,28 @@
"emailresponsible": false
},
"prsJSON": {
"type": "githubpulls",
"value": "DarkKirb nix-packages",
"type": "path",
"value": "https://git.chir.rs/api/v1/repos/darkkirb/nix-packages/pulls",
"emailresponsible": false
},
"gitea_status_repo": {
"type": "string",
"value": "nix-packages",
"emailresponsible": false
},
"gitea_http_url": {
"type": "string",
"value": "https://git.chir.rs/",
"emailresponsible": false
},
"gitea_repo_owner": {
"type": "string",
"value": "darkkirb",
"emailresponsible": false
},
"gitea_repo_name": {
"type": "string",
"value": "nix-packages",
"emailresponsible": false
}
}