structure, unison
This commit is contained in:
parent
b61bb970a5
commit
fb70bd789e
4 changed files with 42 additions and 2 deletions
|
|
@ -1 +1,7 @@
|
||||||
{ ... }: { }
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
home = {
|
||||||
|
imports = [ ./hm ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
||||||
6
mod/hm/default.nix
Normal file
6
mod/hm/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./unison.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
28
mod/hm/unison.nix
Normal file
28
mod/hm/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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
home.services.unison = {
|
home.services.unison' = {
|
||||||
enable = true;
|
enable = true;
|
||||||
pairs = {
|
pairs = {
|
||||||
"docs".roots = [
|
"docs".roots = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue