Skip to content

Commit

Permalink
flakify
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Mar 8, 2024
1 parent fedb5b6 commit c2360cc
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 8 additions & 0 deletions .nixignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.nix
.git*
.nixignore
.pre-commit-config.yaml
Dockerfile
docker-compose.yml
CHANGELOG.md
LICENSE
1 change: 1 addition & 0 deletions docs/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DATE=$(date +%Y-%m-%d)
sed -i "/^## \[Unreleased\]/a \\\n## [v$NEW] - $DATE" 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 "/version/$OLD/$NEW/" flake.nix

git add pyproject.toml CHANGELOG.md
git commit -m "Release v$NEW"
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -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
];
};
}
);
}

0 comments on commit c2360cc

Please sign in to comment.