mirror of
https://github.com/derfenix/photocatalog.git
synced 2026-03-11 11:52:57 +03:00
Update nix flake
This commit is contained in:
36
flake.nix
36
flake.nix
@@ -41,7 +41,6 @@
|
||||
|
||||
};
|
||||
type = types.attrsOf (types.submodule ({ name, ... }: {
|
||||
# freeformType = settingsFormat.type;
|
||||
options = {
|
||||
source = mkOption {
|
||||
type = types.str;
|
||||
@@ -84,25 +83,22 @@
|
||||
|
||||
config = lib.mkIf config.photocatalog.enable {
|
||||
environment.systemPackages = [ self.packages.${pkgs.system}.photocatalog ];
|
||||
systemd.services = lib.mapAttrs' (name: sync: nameValuePair ("photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}")
|
||||
{
|
||||
# name = "photocatalog${lib.replaceStrings ["/"] ["-"] sync.source}";
|
||||
after = [ "local-fs.target" ];
|
||||
path = [
|
||||
packages.photocatalog
|
||||
];
|
||||
preStart = if !sync.skipFullSync then ''
|
||||
mkdir -p ${sync.target}
|
||||
photocatalog -source ${sync.source} -target ${sync.target}
|
||||
'' else null;
|
||||
script = "photocatalog";
|
||||
scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch";
|
||||
serviceConfig = {
|
||||
Type="simple";
|
||||
Restart="no";
|
||||
};
|
||||
}
|
||||
) config.photocatalog.syncs;
|
||||
systemd.services = lib.mapAttrs' (name: sync: {
|
||||
after = [ "local-fs.target" ];
|
||||
path = [
|
||||
pkgs.photocatalog
|
||||
];
|
||||
preStart = if !sync.skipFullSync then ''
|
||||
mkdir -p ${sync.target}
|
||||
photocatalog -source ${sync.source} -target ${sync.target}
|
||||
'' else null;
|
||||
script = "photocatalog";
|
||||
scriptArgs = "-source ${sync.source} -target ${sync.target} -skip-full-sync -watch";
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "no";
|
||||
};
|
||||
}) config.photocatalog.syncs;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user