mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
24 lines
613 B
Nix
24 lines
613 B
Nix
{ pkgs, config, lib, ... }:
|
|
with lib;
|
|
let cfg = config.niveum.google-drive;
|
|
in {
|
|
options.niveum.google-drive = {
|
|
enable = mkEnableOption "Google Drive";
|
|
directory = mkOption { type = types.path; };
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = [ pkgs.grive2 ];
|
|
|
|
systemd.user.services.google-drive = {
|
|
description = "Google Drive synchronisation service";
|
|
after = [ "network.target" ];
|
|
wantedBy = [ "default.target" ];
|
|
script = "${pkgs.grive2}/bin/grive -p ${cfg.directory}";
|
|
startAt = "*:0/5";
|
|
serviceConfig.Type = "oneshot";
|
|
};
|
|
};
|
|
|
|
}
|