fixing clean up bug
This commit is contained in:
1 parent
563dd7a759
commit
d7f5dba677
2 files changed
+3
-1
No files matched your search
+1
-1
@@ -44,7 +44,7 @@ in
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network-online.target" "systemd-machined.service" ];
|
||||
wants = [ "network-online.target" ];
|
||||
path = [ pkgs.systemd pkgs.btrfs-progs ];
|
||||
path = [ pkgs.systemd pkgs.btrfs-progs pkgs.e2fsprogs ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${self.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/slackerbot -mode ${cfg.mode} -config ${cfg.configFile}";
|
||||
EnvironmentFile = lib.optional (cfg.environmentFile != null) cfg.environmentFile;
|
||||
|
||||
@@ -159,6 +159,8 @@ func (l *Local) Start(ctx context.Context, spec node.StartSpec) error {
|
||||
|
||||
// Only the home folder persists. NixOS rebuilds the rest on boot.
|
||||
root := filepath.Join(l.cfg.MachinesDir, spec.Machine)
|
||||
// NixOS marks /var/empty immutable, which blocks RemoveAll.
|
||||
_ = exec.Command("chattr", "-i", filepath.Join(root, "var/empty")).Run()
|
||||
if err := os.RemoveAll(root); err != nil {
|
||||
return fmt.Errorf("clearing old container files: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user