restructure
This commit is contained in:
parent
4922f8f7cb
commit
ffe40ca5e7
25 changed files with 84 additions and 66 deletions
28
home/unison.nix
Normal file
28
home/unison.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.services.unison';
|
||||
in
|
||||
{
|
||||
options.services.unison' = {
|
||||
enable = lib.mkEnableOption "Unison file synchronizer";
|
||||
pairs = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.attrsOf (lib.types.listOf lib.types.str));
|
||||
default = { };
|
||||
description = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.file = lib.mapAttrs' (name: roots: {
|
||||
name = ".unison/${name}.prf";
|
||||
value.text =
|
||||
''
|
||||
watch = true
|
||||
logfile = /dev/null
|
||||
confirmbigdeletes = true
|
||||
confirmmerge = true
|
||||
''
|
||||
+ lib.concatStringsSep "\n" (map (root: "root = ${root}") roots.roots);
|
||||
}) cfg.pairs;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue