diff --git a/.forgejo/workflows/update-lock.yml b/.forgejo/workflows/update-lock.yml new file mode 100644 index 0000000..57148d0 --- /dev/null +++ b/.forgejo/workflows/update-lock.yml @@ -0,0 +1,31 @@ +name: Update flake.lock + +on: + workflow_dispatch: + +jobs: + update_flake_lock: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v14 + + - name: Set git config + run: | + git config --global user.name "ukubot" + git config --global user.email "bot@uku.moe" + + - name: Update lockfile + run: | + export BRANCH="update-lock-$(date -I)" + git checkout -b "$BRANCH" + nix flake update --commit-lock-file + git push origin "$BRANCH" + + - name: Create Pull Request + run: | + echo EXPLODE diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..92687c2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1730785428, + "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f92fc37 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + flake-parts, + ... + } @ inputs: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + + perSystem = { + lib, + pkgs, + self', + ... + }: { + devShells.default = with pkgs; + mkShell { + packages = [clippy rustfmt rust-analyzer redis xh]; + RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; + }; + + formatter = pkgs.alejandra; + }; + }; +}