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": {
|
"nodes": {
|
||||||
"flake-schemas": {
|
"flake-schemas": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761577921,
|
"lastModified": 1780327564,
|
||||||
"narHash": "sha256-eK3/xbUOrxp9fFlei09XNjqcdiHXxndzrTXp7jFpOk8=",
|
"narHash": "sha256-HiRPtA0spK+Dkgbhz/1zW9glXxNVB+L4Rj2VYmdawb8=",
|
||||||
"rev": "47849c7625e223d36766968cc6dc23ba0e135922",
|
"rev": "6cc9bd98891b1fc6bb2b8cb3277df8bc72799ca6",
|
||||||
"revCount": 107,
|
"revCount": 149,
|
||||||
"type": "tarball",
|
"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": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
@@ -16,12 +16,12 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771574726,
|
"lastModified": 1788584326,
|
||||||
"narHash": "sha256-D1PA3xQv/s4W3lnR9yJFSld8UOLr0a/cBWMQMXS+1Qg=",
|
"narHash": "sha256-Fd3OB8J9JhgliQwOKcqx4M672CInxi1I5VnwsaXeSQo=",
|
||||||
"rev": "c217913993d6c6f6805c3b1a3bda5e639adfde6d",
|
"rev": "6713828a351efa628b025a1adf7f43cbf8597513",
|
||||||
"revCount": 908154,
|
"revCount": 1013464,
|
||||||
"type": "tarball",
|
"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": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
@@ -42,11 +42,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771729765,
|
"lastModified": 1788678114,
|
||||||
"narHash": "sha256-HNsDSR5bhLSrIpi9bTb2uTK1qnPo1xFSBxs6YmFyprk=",
|
"narHash": "sha256-pcqbpV4ZI79al6KAlr+WJjaEo/PYfgctRlG43D5BSJM=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "be926cb1a76e8450ab2b92121b2e88d09fa4d41c",
|
"rev": "4748ec2f5ed4a881474ed4c98aa71a5308cdac8d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"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";
|
description = "A dice roller bot";
|
||||||
|
|
||||||
@@ -11,29 +10,41 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs =
|
||||||
|
{
|
||||||
self,
|
self,
|
||||||
flake-schemas,
|
flake-schemas,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
rust-overlay,
|
rust-overlay,
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
overlays = [
|
overlays = [
|
||||||
rust-overlay.overlays.default
|
rust-overlay.overlays.default
|
||||||
(final: _: {
|
(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"];
|
supportedSystems = [
|
||||||
forEachSupportedSystem = f:
|
"x86_64-linux"
|
||||||
nixpkgs.lib.genAttrs supportedSystems (system:
|
"aarch64-darwin"
|
||||||
|
"aarch64-linux"
|
||||||
|
];
|
||||||
|
forEachSupportedSystem =
|
||||||
|
f:
|
||||||
|
nixpkgs.lib.genAttrs supportedSystems (
|
||||||
|
system:
|
||||||
f {
|
f {
|
||||||
pkgs = import nixpkgs {inherit overlays system;};
|
pkgs = import nixpkgs { inherit overlays system; };
|
||||||
});
|
}
|
||||||
in {
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
schemas = flake-schemas.schemas;
|
schemas = flake-schemas.schemas;
|
||||||
|
formatter = forEachSupportedSystem ({ pkgs }: pkgs.nixfmt-rfc-style);
|
||||||
devShells = forEachSupportedSystem ({pkgs}: {
|
devShells = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
rustToolchain
|
rustToolchain
|
||||||
@@ -47,7 +58,7 @@
|
|||||||
git
|
git
|
||||||
jq
|
jq
|
||||||
wget
|
wget
|
||||||
nixpkgs-fmt
|
nixfmt-rfc-style
|
||||||
pkg-config-unwrapped
|
pkg-config-unwrapped
|
||||||
openssl.dev
|
openssl.dev
|
||||||
];
|
];
|
||||||
@@ -58,30 +69,28 @@
|
|||||||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
packages = forEachSupportedSystem ({ pkgs }: {
|
packages = forEachSupportedSystem (
|
||||||
default = let
|
{ pkgs }:
|
||||||
|
let
|
||||||
pname = "caitsith";
|
pname = "caitsith";
|
||||||
version = "master";
|
version = "master";
|
||||||
|
|
||||||
src = pkgs.fetchFromGitea {
|
bot = pkgs.rustPlatform.buildRustPackage {
|
||||||
domain = "scm.wyattjmiller.com";
|
inherit pname version;
|
||||||
owner = "wymiller";
|
src = self;
|
||||||
repo = "caitsith";
|
cargoLock = {
|
||||||
rev = "${version}";
|
lockFile = ./Cargo.lock;
|
||||||
sha256 = "sha256-mPLM89hIzsqO/diVgw6m3I6GfBb/SAq4bO09PfyP8yw=";
|
|
||||||
};
|
};
|
||||||
in pkgs.rustPlatform.buildRustPackage {
|
|
||||||
inherit pname version src;
|
|
||||||
cargoLock = { lockFile = "${src}/Cargo.lock"; };
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
pkg-config-unwrapped
|
pkg-config-unwrapped
|
||||||
openssl.dev
|
openssl.dev
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A Discord/Matrix bot that deathrolls";
|
description = "A dice roller bot";
|
||||||
mainProgram = "caitsith";
|
mainProgram = "caitsith";
|
||||||
homepage = "https://scm.wyattjmiller.com/wymiller/caitsith";
|
homepage = "https://scm.wyattjmiller.com/wymiller/caitsith";
|
||||||
maintainers = [ "wymillerlinux" ];
|
maintainers = [ "wymillerlinux" ];
|
||||||
@@ -92,6 +101,28 @@
|
|||||||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
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