fixing clean up bug

This commit is contained in:
ari committed 2026-11-01 14:10:17 -05:00
1 parent 563dd7a759
commit d7f5dba677
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" "systemd-machined.service" ]; after = [ "network-online.target" "systemd-machined.service" ];
wants = [ "network-online.target" ]; wants = [ "network-online.target" ];
path = [ pkgs.systemd pkgs.btrfs-progs ]; path = [ pkgs.systemd pkgs.btrfs-progs pkgs.e2fsprogs ];
serviceConfig = { serviceConfig = {
ExecStart = "${self.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/slackerbot -mode ${cfg.mode} -config ${cfg.configFile}"; ExecStart = "${self.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/slackerbot -mode ${cfg.mode} -config ${cfg.configFile}";
EnvironmentFile = lib.optional (cfg.environmentFile != null) cfg.environmentFile; EnvironmentFile = lib.optional (cfg.environmentFile != null) cfg.environmentFile;
+2
View File
@@ -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. // Only the home folder persists. NixOS rebuilds the rest on boot.
root := filepath.Join(l.cfg.MachinesDir, spec.Machine) 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 { if err := os.RemoveAll(root); err != nil {
return fmt.Errorf("clearing old container files: %w", err) return fmt.Errorf("clearing old container files: %w", err)
} }