mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
nixos/snapper: Don't create broken snapper-boot.service
This commit is contained in:
parent
b60ebf54c1
commit
52ef91d339
@ -235,7 +235,7 @@ in
|
||||
timerConfig.OnUnitActiveSec = cfg.cleanupInterval;
|
||||
};
|
||||
|
||||
systemd.services.snapper-boot = lib.optionalAttrs cfg.snapshotRootOnBoot {
|
||||
systemd.services.snapper-boot = lib.mkIf cfg.snapshotRootOnBoot {
|
||||
description = "Take snapper snapshot of root on boot";
|
||||
inherit documentation;
|
||||
serviceConfig.ExecStart = "${pkgs.snapper}/bin/snapper --config root create --cleanup-algorithm number --description boot";
|
||||
|
@ -19,7 +19,9 @@ import ./make-test-python.nix ({ ... }:
|
||||
services.snapper.filters = "/nix";
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
testScript = { nodes, ... }: let
|
||||
inherit (nodes.machine.services.snapper) snapshotRootOnBoot;
|
||||
in ''
|
||||
machine.succeed("btrfs subvolume create /home/.snapshots")
|
||||
machine.succeed("snapper -c home list")
|
||||
machine.succeed("snapper -c home create --description empty")
|
||||
@ -31,5 +33,6 @@ import ./make-test-python.nix ({ ... }:
|
||||
machine.succeed("snapper -c home delete 2")
|
||||
machine.succeed("systemctl --wait start snapper-timeline.service")
|
||||
machine.succeed("systemctl --wait start snapper-cleanup.service")
|
||||
machine.${if snapshotRootOnBoot then "succeed" else "fail"}("systemctl cat snapper-boot.service")
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user