@ -152,40 +152,20 @@ in
zfsSupport = true ;
} ;
systemd . services . " z p o o l - i m p o r t " = {
description = " I m p o r t z p o o l s " ;
after = [ " s y s t e m d - u d e v - s e t t l e . s e r v i c e " ] ;
wantedBy = [ " l o c a l - f s . t a r g e t " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
RemainAfterExit = true ;
ExecStart = " ${ zfsPkg } / s b i n / z p o o l i m p o r t - f - a " ;
} ;
restartIfChanged = false ;
} ;
systemd . services . " z f s - m o u n t " = {
description = " M o u n t Z F S V o l u m e s " ;
after = [ " z p o o l - i m p o r t . s e r v i c e " ] ;
wantedBy = [ " l o c a l - f s . t a r g e t " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
RemainAfterExit = true ;
ExecStart = " ${ zfsPkg } / s b i n / z f s m o u n t - a " ;
ExecStop = " ${ zfsPkg } / s b i n / z f s u m o u n t - a " ;
} ;
restartIfChanged = false ;
} ;
environment . etc . " z f s / z e d . d " . source = " ${ zfsPkg } / e t c / z f s / z e d . d / * " ;
system . fsPackages = [ zfsPkg ] ; # XXX: needed? zfs doesn't have (need) a fsck
environment . systemPackages = [ zfsPkg ] ;
services . udev . packages = [ zfsPkg ] ; # to hook zvol naming, etc.
systemd . packages = [ zfsPkg ] ;
systemd . targets . " z f s " . wantedBy = [ " m u l t i - u s e r . t a r g e t " ] ;
} )
( mkIf enableAutoSnapshots {
systemd . services . " z f s - s n a p s h o t - f r e q u e n t " = {
description = " Z F S a u t o - s n a p s h o t t i n g e v e r y 1 5 m i n s " ;
after = [ " z p o o l - i m p o r t . s e r v i c e " ] ;
after = [ " z f s - i m p o r t - s c a n . s e r v i c e " " z f s - i m p o r t - c a c h e . s e r v i c e " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
ExecStart = " ${ zfsAutoSnap } f r e q u e n t ${ toString cfgSnapshots . frequent } " ;
@ -196,7 +176,7 @@ in
systemd . services . " z f s - s n a p s h o t - h o u r l y " = {
description = " Z F S a u t o - s n a p s h o t t i n g e v e r y h o u r " ;
after = [ " z p o o l - i m p o r t . s e r v i c e " ] ;
after = [ " z f s - i m p o r t - s c a n . s e r v i c e " " z f s - i m p o r t - c a c h e . s e r v i c e " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
ExecStart = " ${ zfsAutoSnap } h o u r l y ${ toString cfgSnapshots . hourly } " ;
@ -207,7 +187,7 @@ in
systemd . services . " z f s - s n a p s h o t - d a i l y " = {
description = " Z F S a u t o - s n a p s h o t t i n g e v e r y d a y " ;
after = [ " z p o o l - i m p o r t . s e r v i c e " ] ;
after = [ " z f s - i m p o r t - s c a n . s e r v i c e " " z f s - i m p o r t - c a c h e . s e r v i c e " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
ExecStart = " ${ zfsAutoSnap } d a i l y ${ toString cfgSnapshots . daily } " ;
@ -218,7 +198,7 @@ in
systemd . services . " z f s - s n a p s h o t - w e e k l y " = {
description = " Z F S a u t o - s n a p s h o t t i n g e v e r y w e e k " ;
after = [ " z p o o l - i m p o r t . s e r v i c e " ] ;
after = [ " z f s - i m p o r t - s c a n . s e r v i c e " " z f s - i m p o r t - c a c h e . s e r v i c e " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
ExecStart = " ${ zfsAutoSnap } w e e k l y ${ toString cfgSnapshots . weekly } " ;
@ -229,7 +209,7 @@ in
systemd . services . " z f s - s n a p s h o t - m o n t h l y " = {
description = " Z F S a u t o - s n a p s h o t t i n g e v e r y m o n t h " ;
after = [ " z p o o l - i m p o r t . s e r v i c e " ] ;
after = [ " z f s - i m p o r t - s c a n . s e r v i c e " " z f s - i m p o r t - c a c h e . s e r v i c e " ] ;
serviceConfig = {
Type = " o n e s h o t " ;
ExecStart = " ${ zfsAutoSnap } m o n t h l y ${ toString cfgSnapshots . monthly } " ;