Skip to content

Commit

Permalink
Add checkReadme and mention data.nix file
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Feb 22, 2024
1 parent f0f3bfa commit 2a6276d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
8 changes: 8 additions & 0 deletions data.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
Anybody can propose changes with PRs, or open issues to have discussions.
The `README.md` file is automatically generated from the [`data.nix`](./data.nix) file,
so open PRs against that instead.
You can test your changes locally using
```
nix run .#checkReadme
```
The person merging PRs will ensure that the change is implemented, either automatically or manually.
'';

Expand Down
40 changes: 24 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,32 @@
];
};
});
packages = eachSystem (pkgs: {
updateReadme =
let
eval = nixpkgs.lib.evalModules {
modules = [
./schema.nix
./data.nix
];
specialArgs.pkgs = pkgs;
};
in
pkgs.writeShellApplication {
name = "update-readme";
packages = eachSystem (pkgs:
let
eval = nixpkgs.lib.evalModules {
modules = [
./schema.nix
./data.nix
];
specialArgs.pkgs = pkgs;
};
readmeFile = eval.config.readme;
in
{
checkReadme = pkgs.writeShellApplication {
name = "check-readme";
text = ''
gitRoot=$(git rev-parse --show-toplevel)
cp ${eval.config.readme} "$gitRoot/README.md"
cat ${readmeFile}
'';
};
});
updateReadme =
pkgs.writeShellApplication {
name = "update-readme";
text = ''
gitRoot=$(git rev-parse --show-toplevel)
cp ${readmeFile} "$gitRoot/README.md"
'';
};
});
};
}

0 comments on commit 2a6276d

Please sign in to comment.