mirror of
https://github.com/bsedin/matrix-webhook.git
synced 2026-01-16 08:05:57 +00:00
flakify
This commit is contained in:
parent
fedb5b649b
commit
c2360cc128
17
.github/workflows/nix.yml
vendored
Normal file
17
.github/workflows/nix.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: "Nix CI"
|
||||||
|
|
||||||
|
on: [pull_request, push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
name: "Nix build on ${{ matrix.os }}"
|
||||||
|
runs-on: "${{ matrix.os }}-latest"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu, macos]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
|
- uses: DeterminateSystems/flake-checker-action@main
|
||||||
|
- run: nix build
|
||||||
8
.nixignore
Normal file
8
.nixignore
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
*.nix
|
||||||
|
.git*
|
||||||
|
.nixignore
|
||||||
|
.pre-commit-config.yaml
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
CHANGELOG.md
|
||||||
|
LICENSE
|
||||||
@ -14,6 +14,7 @@ DATE=$(date +%Y-%m-%d)
|
|||||||
sed -i "/^## \[Unreleased\]/a \\\n## [v$NEW] - $DATE" CHANGELOG.md
|
sed -i "/^## \[Unreleased\]/a \\\n## [v$NEW] - $DATE" CHANGELOG.md
|
||||||
sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md
|
sed -i "/^\[Unreleased\]/s/$OLD/$NEW/" CHANGELOG.md
|
||||||
sed -i "/^\[Unreleased\]/a [v$NEW]: https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md
|
sed -i "/^\[Unreleased\]/a [v$NEW]: https://github.com/nim65s/matrix-webhook/compare/v$OLD...v$NEW" CHANGELOG.md
|
||||||
|
sed -i "/version/$OLD/$NEW/" flake.nix
|
||||||
|
|
||||||
git add pyproject.toml CHANGELOG.md
|
git add pyproject.toml CHANGELOG.md
|
||||||
git commit -m "Release v$NEW"
|
git commit -m "Release v$NEW"
|
||||||
|
|||||||
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709126324,
|
||||||
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709703039,
|
||||||
|
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
47
flake.nix
Normal file
47
flake.nix
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
description = "Post a message to a matrix room with a simple HTTP POST";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
matrix-webhook =
|
||||||
|
with pkgs.python3Packages;
|
||||||
|
buildPythonApplication {
|
||||||
|
pname = "matrix-webhook";
|
||||||
|
version = "3.8.0";
|
||||||
|
src = pkgs.nix-gitignore.gitignoreSource [ ./.nixignore ] ./.;
|
||||||
|
pyproject = true;
|
||||||
|
buildInputs = [ poetry-core ];
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
markdown
|
||||||
|
matrix-nio
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.default = matrix-webhook;
|
||||||
|
apps.default = flake-utils.lib.mkApp { drv = matrix-webhook; };
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
inputsFrom = [ matrix-webhook ];
|
||||||
|
packages = with pkgs; [
|
||||||
|
poetry
|
||||||
|
python3Packages.coverage
|
||||||
|
python3Packages.httpx
|
||||||
|
python3Packages.safety
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user