common: move sudo-lecture out of etc

This commit is contained in:
Oystein Kristoffer Tveit 2024-06-02 16:29:48 +02:00
parent 347a731839
commit c902040ade
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 4 additions and 8 deletions

View File

@ -131,12 +131,6 @@ in {
];
etc = {
# TODO: move this out of etc, and reference it directly in sudo config.
sudoLecture = {
target = "sudo.lecture";
text = extendedLib.termColors.front.red "Be careful or something, idk...\n";
};
currentSystemPackages = {
target = "current-system-packages";
text = let
@ -377,9 +371,11 @@ in {
hardware.pulseaudio.enable = !config.machineVars.headless;
security.sudo.extraConfig = ''
security.sudo.extraConfig = let
sudoLecture = pkgs.writeText "sudo-lecture.txt" (extendedLib.termColors.front.red "Be careful or something, idk...\n");
in ''
Defaults lecture = always
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
Defaults lecture_file = ${sudoLecture}
'';
system.stateVersion = "22.05";