File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 257
257
_ _ @ltab _ @ltab _ _ _ _ _
258
258
)
259
259
'' ;
260
+ baseBorg = {
261
+ repo = "/mnt/backup/borg" ;
262
+ user = config . services . functora . userName ;
263
+ doInit = true ;
264
+ startAt = "daily" ;
265
+ compression = "auto,lzma" ;
266
+ encryption . mode = "none" ;
267
+ prune . keep = {
268
+ daily = 7 ;
269
+ weekly = 4 ;
270
+ monthly = 3 ;
271
+ } ;
272
+ } ;
273
+ mkLocalBorg = cfg : {
274
+ "local-${ cfg . name } " =
275
+ baseBorg
276
+ // {
277
+ paths = cfg . paths ;
278
+ } ;
279
+ } ;
260
280
in {
261
281
imports =
262
282
[
@@ -281,6 +301,17 @@ in {
281
301
type = types . bool ;
282
302
default = true ;
283
303
} ;
304
+ localBorg = mkOption {
305
+ type = types . listOf ( types . submodule {
306
+ options . name = mkOption {
307
+ type = types . str ;
308
+ } ;
309
+ options . paths = mkOption {
310
+ type = types . listOf types . str ;
311
+ } ;
312
+ } ) ;
313
+ default = [ ] ;
314
+ } ;
284
315
} ;
285
316
286
317
config = rec {
@@ -915,5 +946,11 @@ in {
915
946
displayManager . defaultSession = "sway" ;
916
947
displayManager . sessionPackages = [ pkgs . sway ] ;
917
948
} ;
949
+ #
950
+ # Borg
951
+ #
952
+ services . borgbackup . jobs =
953
+ lib . mkMerge
954
+ ( map mkLocalBorg config . services . functora . localBorg ) ;
918
955
} ;
919
956
}
Submodule prv updated from d19a813 to c43eaef
You can’t perform that action at this time.
0 commit comments