Skip to content

Commit 28e854c

Browse files
committed
git-setup riglet: default deny rules
1 parent 0159a06 commit 28e854c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

riglets/git-setup.nix

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ self:
33
config,
44
pkgs,
55
riglib,
6+
lib,
67
...
78
}:
89
{
@@ -11,6 +12,15 @@ self:
1112
config.riglets.git-setup = {
1213
tools = [ pkgs.git ];
1314

15+
# Default set of deny rules for git usage
16+
# Using mkDefault means end users of this riglet will be able to override this
17+
denyRules.git = lib.mkDefault [
18+
"reset"
19+
"pull"
20+
"push"
21+
"commit --amend"
22+
];
23+
1424
meta = {
1525
description = "Git setup with agent-identity";
1626
intent = "base";
@@ -35,15 +45,15 @@ self:
3545

3646
promptCommands = {
3747
healthcheck = {
48+
description = "Git healtcheck";
3849
template = ''
3950
Perform a git healthcheck to make sure everything is in order:
4051
- Check that remotes are fetcheable
4152
- Check that no oversized file is currently under version control (unless git-lfs is properly in place)
4253
- Check that no commit is left dangling
4354
44-
If not, reports problems and suggest solutions to the user
55+
If not, report problems and suggest solutions to the user
4556
'';
46-
description = "Git healtcheck";
4757
};
4858
};
4959
};

0 commit comments

Comments
 (0)