Compare commits
5
Commits
3bc6b7aa0e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6a3ec44bc | ||
|
|
427757654f
|
||
|
|
707867341a
|
||
|
|
4afabd4956
|
||
|
|
51bc0cc922
|
@@ -0,0 +1,29 @@
|
||||
name: Build (nix)
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Update flake lock
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: ${{ gitea.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# The update workflow may have pushed a newer flake.lock commit.
|
||||
ref: ${{ gitea.event.workflow_run.head_branch }}
|
||||
|
||||
- name: Install upstream Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
|
||||
- name: Build flake
|
||||
run: nix build
|
||||
@@ -0,0 +1,40 @@
|
||||
name: Update flake lock
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Gitea cron schedules use UTC. 07:00 UTC is 03:00 EDT.
|
||||
- cron: "0 7 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update-flake-lock:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install upstream Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
|
||||
- name: Update flake lock
|
||||
run: nix flake update
|
||||
|
||||
- name: Commit and push changes
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
if git diff --quiet -- flake.lock; then
|
||||
echo "flake.lock is already up to date"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git config user.name "gitea-actions[bot]"
|
||||
git config user.email "gitea-actions[bot]@noreply.localhost"
|
||||
git add flake.lock
|
||||
git commit -m "chore: update flake lock"
|
||||
git push
|
||||
Generated
+13
-13
@@ -2,12 +2,12 @@
|
||||
"nodes": {
|
||||
"flake-schemas": {
|
||||
"locked": {
|
||||
"lastModified": 1761577921,
|
||||
"narHash": "sha256-eK3/xbUOrxp9fFlei09XNjqcdiHXxndzrTXp7jFpOk8=",
|
||||
"rev": "47849c7625e223d36766968cc6dc23ba0e135922",
|
||||
"revCount": 107,
|
||||
"lastModified": 1780327564,
|
||||
"narHash": "sha256-HiRPtA0spK+Dkgbhz/1zW9glXxNVB+L4Rj2VYmdawb8=",
|
||||
"rev": "6cc9bd98891b1fc6bb2b8cb3277df8bc72799ca6",
|
||||
"revCount": 149,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.2.0/019a4a84-544d-7c59-b26d-e334e320c932/source.tar.gz"
|
||||
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.5.0/019e83cf-9af3-78b1-ac5b-70e68ad1efe1/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -16,12 +16,12 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1771574726,
|
||||
"narHash": "sha256-D1PA3xQv/s4W3lnR9yJFSld8UOLr0a/cBWMQMXS+1Qg=",
|
||||
"rev": "c217913993d6c6f6805c3b1a3bda5e639adfde6d",
|
||||
"revCount": 908154,
|
||||
"lastModified": 1788584326,
|
||||
"narHash": "sha256-Fd3OB8J9JhgliQwOKcqx4M672CInxi1I5VnwsaXeSQo=",
|
||||
"rev": "6713828a351efa628b025a1adf7f43cbf8597513",
|
||||
"revCount": 1013464,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2511.908154%2Brev-c217913993d6c6f6805c3b1a3bda5e639adfde6d/019c7ebe-d61d-7168-89bc-a2b6e142b1cd/source.tar.gz"
|
||||
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1013464%2Brev-6713828a351efa628b025a1adf7f43cbf8597513/01a07539-88a8-7940-bbe9-bd2b0da40c98/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -42,11 +42,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1771729765,
|
||||
"narHash": "sha256-HNsDSR5bhLSrIpi9bTb2uTK1qnPo1xFSBxs6YmFyprk=",
|
||||
"lastModified": 1788678114,
|
||||
"narHash": "sha256-pcqbpV4ZI79al6KAlr+WJjaEo/PYfgctRlG43D5BSJM=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "be926cb1a76e8450ab2b92121b2e88d09fa4d41c",
|
||||
"rev": "4748ec2f5ed4a881474ed4c98aa71a5308cdac8d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.18)
|
||||
{
|
||||
description = "A dice roller bot";
|
||||
|
||||
@@ -11,29 +10,41 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
flake-schemas,
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
overlays = [
|
||||
rust-overlay.overlays.default
|
||||
(final: _: {
|
||||
rustToolchain = final.rust-bin.stable.latest.default.override {extensions = ["rust-src"];};
|
||||
rustToolchain = final.rust-bin.stable.latest.default.override { extensions = [ "rust-src" ]; };
|
||||
})
|
||||
];
|
||||
|
||||
supportedSystems = ["x86_64-linux" "aarch64-darwin" "aarch64-linux"];
|
||||
forEachSupportedSystem = f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (system:
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"aarch64-linux"
|
||||
];
|
||||
forEachSupportedSystem =
|
||||
f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (
|
||||
system:
|
||||
f {
|
||||
pkgs = import nixpkgs {inherit overlays system;};
|
||||
});
|
||||
in {
|
||||
pkgs = import nixpkgs { inherit overlays system; };
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
schemas = flake-schemas.schemas;
|
||||
|
||||
devShells = forEachSupportedSystem ({pkgs}: {
|
||||
formatter = forEachSupportedSystem ({ pkgs }: pkgs.nixfmt-rfc-style);
|
||||
devShells = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
rustToolchain
|
||||
@@ -47,7 +58,7 @@
|
||||
git
|
||||
jq
|
||||
wget
|
||||
nixpkgs-fmt
|
||||
nixfmt-rfc-style
|
||||
pkg-config-unwrapped
|
||||
openssl.dev
|
||||
];
|
||||
@@ -58,30 +69,28 @@
|
||||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
packages = forEachSupportedSystem ({ pkgs }: {
|
||||
default = let
|
||||
packages = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
let
|
||||
pname = "caitsith";
|
||||
version = "master";
|
||||
|
||||
src = pkgs.fetchFromGitea {
|
||||
domain = "scm.wyattjmiller.com";
|
||||
owner = "wymiller";
|
||||
repo = "caitsith";
|
||||
rev = "${version}";
|
||||
sha256 = "sha256-mPLM89hIzsqO/diVgw6m3I6GfBb/SAq4bO09PfyP8yw=";
|
||||
bot = pkgs.rustPlatform.buildRustPackage {
|
||||
inherit pname version;
|
||||
src = self;
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
in pkgs.rustPlatform.buildRustPackage {
|
||||
inherit pname version src;
|
||||
cargoLock = { lockFile = "${src}/Cargo.lock"; };
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config-unwrapped
|
||||
openssl.dev
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "A Discord/Matrix bot that deathrolls";
|
||||
description = "A dice roller bot";
|
||||
mainProgram = "caitsith";
|
||||
homepage = "https://scm.wyattjmiller.com/wymiller/caitsith";
|
||||
maintainers = [ "wymillerlinux" ];
|
||||
@@ -92,6 +101,28 @@
|
||||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||
};
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
default = bot;
|
||||
docker = pkgs.dockerTools.buildLayeredImage {
|
||||
name = pname;
|
||||
tag = "latest";
|
||||
contents = [
|
||||
bot
|
||||
pkgs.cacert
|
||||
];
|
||||
|
||||
config = {
|
||||
Entrypoint = [ "${bot}/bin/${pname}" ];
|
||||
Env = [ "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ];
|
||||
Labels = {
|
||||
"org.opencontainers.image.title" = pname;
|
||||
"org.opencontainers.image.description" = "A dice roller bot";
|
||||
"org.opencontainers.image.source" = "https://scm.wyattjmiller.com/wymiller/caitsith";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user