Compare commits

..

6 commits

Author SHA1 Message Date
209a3f6c8d pkgs: add explicit 'meta.mainProgram'
Some checks failed
ci/woodpecker/push/check Pipeline failed
Since upstream has decided to deprecate the implied value when using
`lib.getExe` (see [1]), we should set it explicitly.

[1]: https://github.com/NixOS/nixpkgs/pull/246386
2023-08-04 09:54:23 +00:00
6123c7bc3b pkgs: re-order 'meta'
This is (mostly) alphetically sorted.
2023-08-04 09:54:10 +00:00
894b77c777 ci: use 'backend' tag
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2023-08-04 09:17:57 +00:00
d50c572952 pkgs: remove woodpecker
Now that v1.0.0 is on nixpkgs, no need for my custom packages.
2023-08-04 09:17:57 +00:00
a289966a4a modules: services: woodpecker: default packages
Now that v1.0.0 is on nixpkgs, no need for my custom packages.
2023-08-04 09:17:57 +00:00
98c429d594 flake: bump inputs 2023-08-04 09:17:57 +00:00
33 changed files with 49 additions and 3485 deletions

View file

@ -1,5 +1,5 @@
labels:
type: exec
backend: local
pipeline:
- name: nix flake check

30
flake.lock generated
View file

@ -70,11 +70,11 @@
]
},
"locked": {
"lastModified": 1688466019,
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
"lastModified": 1690933134,
"narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
"rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb",
"type": "github"
},
"original": {
@ -131,11 +131,11 @@
]
},
"locked": {
"lastModified": 1690476848,
"narHash": "sha256-PSmzyuEbMxEn2uwwLYUN2l1psoJXb7jm/kfHD12Sq0k=",
"lastModified": 1691039228,
"narHash": "sha256-iPNZJ1LvfUf1Y456ewC0DXgf99TNssG8OLObOyqxO6M=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8d243f7da13d6ee32f722a3f1afeced150b6d4da",
"rev": "86dd48d70a2e2c17e84e747ba4faa92453e68d4a",
"type": "github"
},
"original": {
@ -147,11 +147,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1690367991,
"narHash": "sha256-2VwOn1l8y6+cu7zjNE8MgeGJNNz1eat1HwHrINeogFA=",
"lastModified": 1691006197,
"narHash": "sha256-DbtxVWPt+ZP5W0Usg7jAyTomIM//c3Jtfa59Ht7AV8s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c9cf0708f00fbe553319258e48ca89ff9a413703",
"rev": "66aedfd010204949cb225cf749be08cb13ce1813",
"type": "github"
},
"original": {
@ -163,11 +163,11 @@
},
"nur": {
"locked": {
"lastModified": 1690541304,
"narHash": "sha256-EypV1o52D9SdHWyH3Wf6RLdDiDnKIqqXiUROrtN2KyQ=",
"lastModified": 1691139289,
"narHash": "sha256-cZtqvYztpGwLtAsfrzY2VeTfFdW3HBwX7m1KV2Zy2nw=",
"owner": "nix-community",
"repo": "NUR",
"rev": "03f02d6f7b5c284fe6ed12f86debb21429ca124c",
"rev": "cb20b89d5b355c53a18dd149e7104a67381c7c17",
"type": "github"
},
"original": {
@ -192,11 +192,11 @@
]
},
"locked": {
"lastModified": 1690464206,
"narHash": "sha256-38V4kmOh6ikpfGiAS+Kt2H/TA2DubSqE66veP/jmB4Q=",
"lastModified": 1691093055,
"narHash": "sha256-sjNWYpDHc6vx+/M0WbBZKltR0Avh2S43UiDbmYtfHt0=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "9289996dcac62fd45836db7c07b87d2521eb526d",
"rev": "ebb43bdacd1af8954d04869c77bc3b61fde515e4",
"type": "github"
},
"original": {

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
let
cfg = config.my.services.woodpecker;
@ -10,8 +10,6 @@ in
agents.docker = {
enable = true;
package = pkgs.ambroisie.woodpecker-agent;
environment = {
WOODPECKER_SERVER = "localhost:${toString cfg.rpcPort}";
WOODPECKER_MAX_WORKFLOWS = "10";

View file

@ -10,8 +10,6 @@ in
agents.exec = {
enable = true;
package = pkgs.ambroisie.woodpecker-agent;
environment = {
WOODPECKER_SERVER = "localhost:${toString cfg.rpcPort}";
WOODPECKER_MAX_WORKFLOWS = "10";

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, ... }:
let
cfg = config.my.services.woodpecker;
in
@ -7,8 +7,6 @@ in
services.woodpecker-server = {
enable = true;
package = pkgs.ambroisie.woodpecker-server;
environment = {
WOODPECKER_OPEN = "true";
WOODPECKER_HOST = "https://woodpecker.${config.networking.domain}";

View file

@ -36,7 +36,8 @@ stdenvNoCC.mkDerivation rec {
description = "A simple script to query a password from bitwarden";
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.linux;
mainProgram = "bw-pass";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -35,7 +35,8 @@ stdenvNoCC.mkDerivation rec {
'';
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.linux;
mainProgram = "change-audio";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -35,7 +35,8 @@ stdenvNoCC.mkDerivation rec {
'';
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.linux;
mainProgram = "change-backlight";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -30,11 +30,11 @@ stdenvNoCC.mkDerivation rec {
'';
meta = with lib; {
mainProgram = ",";
description = "A simple script inspired by Shopify's comma, for modern Nix";
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.unix;
mainProgram = ",";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;
};
}

View file

@ -37,12 +37,4 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: {
volantes-cursors = pkgs.callPackage ./volantes-cursors { };
wifi-qr = pkgs.callPackage ./wifi-qr { };
woodpecker-agent = pkgs.callPackage ./woodpecker/agent.nix { };
woodpecker-cli = pkgs.callPackage ./woodpecker/cli.nix { };
woodpecker-frontend = pkgs.callPackage ./woodpecker/frontend.nix { };
woodpecker-server = pkgs.callPackage ./woodpecker/server.nix { };
})

View file

@ -34,7 +34,8 @@ stdenvNoCC.mkDerivation rec {
description = "Nix flake helper to visualize changes in closures";
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.unix;
mainProgram = "diff-flake";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;
};
}

View file

@ -23,6 +23,7 @@ qt5.mkDerivation rec {
description = "A CLI drag-and-drop tool";
homepage = "https://git.belanyi.fr/ambroisie/dragger";
license = licenses.mit;
mainProgram = "dragger";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};

View file

@ -34,7 +34,8 @@ stdenvNoCC.mkDerivation rec {
description = "Helper script to run rsync in a CI pipeline";
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.unix;
mainProgram = "drone-rsync";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;
};
}

View file

@ -20,5 +20,6 @@ buildGoModule rec {
'';
homepage = "https://github.com/appleboy/drone-scp";
license = licenses.mit;
mainProgram = "drone-scp";
};
}

View file

@ -26,5 +26,6 @@ buildGoModule rec {
'';
homepage = "https://git.clsr.net/util/ff2mpv-go/";
license = licenses.publicDomain;
mainProgram = "ff2mpv-go";
};
}

View file

@ -35,7 +35,8 @@ stdenvNoCC.mkDerivation rec {
description = "Helper script to query i3 window criterions";
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.unix;
mainProgram = "i3-get-window-criteria";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;
};
}

View file

@ -16,7 +16,8 @@ rustPlatform.buildRustPackage rec {
description = "Git mirroring daemon";
homepage = "https://github.com/alarsyo/lohr";
license = with licenses; [ mit asl20 ];
platforms = platforms.unix;
mainProgram = "lohr";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;
};
}

View file

@ -38,7 +38,8 @@ stdenvNoCC.mkDerivation rec {
'';
homepage = "https://git.belanyi.fr/ambroisie/${pname}";
license = licenses.mit;
platforms = platforms.unix;
mainProgram = "matrix-notifier";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.unix;
};
}

View file

@ -34,7 +34,8 @@ stdenvNoCC.mkDerivation rec {
'';
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.linux;
mainProgram = "osc52";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -34,7 +34,8 @@ stdenvNoCC.mkDerivation rec {
description = "A simple script to query a password from rbw";
homepage = "https://git.belanyi.fr/ambroisie/nix-config";
license = with licenses; [ mit ];
platforms = platforms.linux;
mainProgram = "rbw-pass";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -32,7 +32,7 @@ stdenvNoCC.mkDerivation {
'';
homepage = "https://github.com/StevenBlack/hosts";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.all;
};
}

View file

@ -28,7 +28,7 @@ stdenvNoCC.mkDerivation rec {
'';
homepage = "https://github.com/StevenBlack/hosts";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.all;
};
}

View file

@ -38,7 +38,7 @@ stdenvNoCC.mkDerivation rec {
description = "An X cursor theme inspired by Materia design";
homepage = "https://github.com/vinceliuice/Vimix-cursors";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -38,7 +38,7 @@ stdenvNoCC.mkDerivation rec {
description = "Classic cursor with a flying style";
homepage = "https://github.com/varlesh/volantes-cursors";
license = licenses.gpl2Only;
platforms = platforms.linux;
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -74,7 +74,8 @@ stdenvNoCC.mkDerivation rec {
description = "WiFi password sharing via QR codes";
homepage = "https://github.com/kokoye2007/wifi-qr";
license = with licenses; [ gpl3Plus ];
platforms = platforms.linux;
mainProgram = "wifi-qr";
maintainers = with maintainers; [ ambroisie ];
platforms = platforms.linux;
};
}

View file

@ -1,25 +0,0 @@
{ buildGoModule, callPackage, fetchpatch }:
let
common = callPackage ./common.nix { };
in
buildGoModule {
pname = "woodpecker-agent";
inherit (common) version src ldflags postInstall vendorHash;
patches = [
# https://github.com/woodpecker-ci/woodpecker/pull/1686
(fetchpatch {
name = "fix-local-pipeline-home.patch";
url = "https://github.com/woodpecker-ci/woodpecker/commit/d2c9b73ebf015bfa64062b9855c33e14484ccc3e.patch";
hash = "sha256-1wYe4+oCWiV/6W4cIbdDT+mEL9ETQmcYQZhjJASvmUk=";
})
];
subPackages = "cmd/agent";
CGO_ENABLED = 0;
meta = common.meta // {
description = "Woodpecker Continuous Integration agent";
};
}

View file

@ -1,16 +0,0 @@
{ buildGoModule, callPackage }:
let
common = callPackage ./common.nix { };
in
buildGoModule {
pname = "woodpecker-cli";
inherit (common) version src ldflags postInstall vendorHash;
subPackages = "cmd/cli";
CGO_ENABLED = 0;
meta = common.meta // {
description = "Command line client for the Woodpecker Continuous Integration server";
};
}

View file

@ -1,38 +0,0 @@
{ lib, fetchFromGitHub }:
let
rev = "e7ca28026bc4576b2dd30aa2ab71c2d07dfc7197";
srcHash = "sha256-vtttb+tRi3uDFn8liFgZcAqWLENfpTY7lWsNCoTFzEM=";
vendorHash = "sha256-u7HT8+LeqS7mCNbUhrvSW0xd/uduL2Kw7A0mUUpW2w4=";
yarnHash = "sha256-h+he2VxvZlStIoLb1PPxqKSmTfFNGgJmUXptjtc5xD8=";
version = "next-${lib.substring 0 8 rev}";
in
{
inherit version yarnHash vendorHash;
src = fetchFromGitHub {
owner = "woodpecker-ci";
repo = "woodpecker";
inherit rev;
hash = srcHash;
};
postInstall = ''
cd $out/bin
for f in *; do
mv -- "$f" "woodpecker-$f"
done
cd -
'';
ldflags = [
"-s"
"-w"
"-X github.com/woodpecker-ci/woodpecker/version.Version=${version}"
];
meta = with lib; {
homepage = "https://woodpecker-ci.org/";
license = licenses.asl20;
maintainers = with maintainers; [ ambroisie techknowlogick ];
};
}

View file

@ -1,57 +0,0 @@
{ lib, buildPackages, callPackage, fetchFromGitHub, fetchYarnDeps, mkYarnPackage }:
let
common = callPackage ./common.nix { };
esbuild_0_17_12 = buildPackages.esbuild.overrideAttrs (_: rec {
version = "0.17.12";
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-75qDQWAp6cmuXtq90oIIQCj5IKUoQxNARxhFo2Sm5mk=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
});
in
mkYarnPackage {
pname = "woodpecker-frontend";
inherit (common) version;
src = "${common.src}/web";
packageJSON = ./woodpecker-package.json;
yarnLock = ./yarn.lock;
offlineCache = fetchYarnDeps {
yarnLock = ./yarn.lock;
hash = common.yarnHash;
};
ESBUILD_BINARY_PATH = lib.getExe esbuild_0_17_12;
buildPhase = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -R deps/woodpecker-ci/dist $out
echo "${common.version}" > "$out/version"
runHook postInstall
'';
# Do not attempt generating a tarball for woodpecker-frontend again.
doDist = false;
meta = common.meta // {
description = "Woodpecker Continuous Integration server frontend";
};
}

View file

@ -1,26 +0,0 @@
{ buildGoModule, callPackage, woodpecker-frontend }:
let
common = callPackage ./common.nix { };
in
buildGoModule {
pname = "woodpecker-server";
inherit (common) version src ldflags postInstall vendorHash;
postPatch = ''
cp -r ${woodpecker-frontend} web/dist
'';
subPackages = "cmd/server";
CGO_ENABLED = 1;
passthru = {
inherit woodpecker-frontend;
updateScript = ./update.sh;
};
meta = common.meta // {
description = "Woodpecker Continuous Integration server";
};
}

View file

@ -1,50 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq nix-prefetch pnpm-lock-export
# shellcheck shell=bash
if [ -n "$GITHUB_TOKEN" ]; then
TOKEN_ARGS=(--header "Authorization: token $GITHUB_TOKEN")
fi
if [[ $# -gt 1 || $1 == -* ]]; then
echo "Regenerates packaging data for the woodpecker packages."
echo "Usage: $0 [git release tag]"
exit 1
fi
set -x
cd "$(dirname "$0")"
rev="$1"
set -euo pipefail
if [ -z "$rev" ]; then
rev="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/woodpecker-ci/woodpecker/commits?per_page=1" | jq -r '.[0].sha')"
fi
# Woodpecker repository
src_hash=$(nix-prefetch-github woodpecker-ci woodpecker --rev "${rev}" | jq -r .sha256)
# Go modules
mod_hash=$(nix-prefetch '{ sha256 }: (callPackage (import ./cli.nix) { }).go-modules.overrideAttrs (_: { modHash = sha256; })')
# Front-end dependencies
woodpecker_src="https://raw.githubusercontent.com/woodpecker-ci/woodpecker/$rev"
wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/package.json" -O woodpecker-package.json
trap 'rm -rf pnpm-lock.yaml' EXIT
wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/pnpm-lock.yaml"
pnpm-lock-export --schema yarn.lock@v1
yarn_hash=$(prefetch-yarn-deps yarn.lock)
# Use friendlier hashes
src_hash=$(nix hash to-sri --type sha256 "$src_hash")
mod_hash=$(nix hash to-sri --type sha256 "$mod_hash")
yarn_hash=$(nix hash to-sri --type sha256 "$yarn_hash")
sed -i -E -e "s#rev = \".*\"#rev = \"$rev\"#" common.nix
sed -i -E -e "s#srcHash = \".*\"#srcHash = \"$src_hash\"#" common.nix
sed -i -E -e "s#modHash = \".*\"#modHash = \"$mod_hash\"#" common.nix
sed -i -E -e "s#yarnHash = \".*\"#yarnHash = \"$yarn_hash\"#" common.nix

View file

@ -1,71 +0,0 @@
{
"name": "woodpecker-ci",
"author": "Woodpecker CI",
"version": "0.0.0",
"license": "Apache-2.0",
"engines": {
"node": ">=14"
},
"scripts": {
"start": "vite",
"build": "vite build",
"serve": "vite preview",
"lint": "eslint --max-warnings 0 --ext .js,.ts,.vue,.json .",
"formatcheck": "prettier -c .",
"format:fix": "prettier --write .",
"typecheck": "vue-tsc --noEmit",
"test": "echo 'No tests configured' && exit 0"
},
"dependencies": {
"@intlify/unplugin-vue-i18n": "^0.9.2",
"@kyvg/vue3-notification": "^2.9.0",
"@vueuse/core": "^9.13.0",
"ansi_up": "^5.1.0",
"dayjs": "^1.11.7",
"floating-vue": "^2.0.0-beta.20",
"fuse.js": "^6.6.2",
"humanize-duration": "^3.28.0",
"javascript-time-ago": "^2.5.9",
"lodash": "^4.17.21",
"node-emoji": "^1.11.0",
"pinia": "^2.0.33",
"prismjs": "^1.29.0",
"vue": "^3.2.47",
"vue-i18n": "^9.2.2",
"vue-router": "^4.1.6"
},
"devDependencies": {
"@iconify/json": "^2.2.36",
"@types/humanize-duration": "^3.27.1",
"@types/javascript-time-ago": "^2.0.3",
"@types/lodash": "^4.14.191",
"@types/node": "^18.15.3",
"@types/node-emoji": "^1.8.2",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@vitejs/plugin-vue": "^4.1.0",
"@vue/compiler-sfc": "^3.2.47",
"eslint": "^8.36.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.9.0",
"eslint-plugin-vue-scoped-css": "^2.4.0",
"prettier": "^2.8.5",
"typescript": "5.0.2",
"unplugin-icons": "^0.15.3",
"unplugin-vue-components": "^0.24.1",
"vite": "^4.2.0",
"vite-plugin-prismjs": "^0.0.8",
"vite-plugin-windicss": "^1.8.10",
"vite-svg-loader": "^4.0.0",
"vue-eslint-parser": "^9.1.0",
"vue-tsc": "^1.2.0",
"windicss": "^3.5.6"
}
}

File diff suppressed because it is too large Load diff