github: Re-generate the files on updates

This commit is contained in:
traxys 2024-07-04 19:34:35 +02:00
parent 954876bef7
commit 668894b6d3
2 changed files with 24 additions and 0 deletions

View file

@ -2,6 +2,21 @@
perSystem =
{ pkgs, ... }:
{
apps.generate-files.program = pkgs.writeShellApplication {
name = "generate-files";
text = ''
repo_root=$(git rev-parse --show-toplevel)
generated_dir=$repo_root/generated
# Rust-Analyzer
nix build .#rust-analyzer-options
cat ./result >"$generated_dir"/rust-analyzer.nix
nix fmt
'';
};
packages = {
rust-analyzer-options = pkgs.callPackage ./rust-analyzer.nix { };
};