fix critical bug relating to log-clearing
This commit is contained in:
parent
9d41477805
commit
2bdeadfa7a
1 changed files with 5 additions and 2 deletions
|
|
@ -1,8 +1,11 @@
|
|||
{pkgs, ...}: let
|
||||
updateScript = pkgs.writeShellScriptBin "rebuild" ''
|
||||
#!/bin/sh
|
||||
nixos-rebuild switch --flake /etc/nixos#distrust
|
||||
'';
|
||||
clearLogsScript = pkgs.writeShellScriptBin "clear_logs" ''
|
||||
${pkgs.coreutils}/bin/rm -rf /var/log/*
|
||||
${pkgs.systemd}/bin/journalctl --vacuum-time=0s
|
||||
'';
|
||||
tor-hostname = import ../helpers/tor-hostname.nix {inherit pkgs;};
|
||||
in {
|
||||
environment.systemPackages = with pkgs; [vim btop git alejandra statix deadnix] ++ [updateScript tor-hostname];
|
||||
|
|
@ -41,7 +44,7 @@ in {
|
|||
description = "Clear /var/log directory";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.coreutils}/bin/rm -rf /var/log/*";
|
||||
ExecStart = "${clearLogsScript}/bin/clear_logs";
|
||||
User = "root";
|
||||
Group = "root";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue