1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00
Files
niveum/modules/google-drive.nix

24 lines
613 B
Nix
Raw Normal View History

2019-04-19 03:11:51 +02:00
{ pkgs, config, lib, ... }:
with lib;
let cfg = config.niveum.google-drive;
2020-06-10 17:37:25 +02:00
in {
2019-04-19 03:11:51 +02:00
options.niveum.google-drive = {
enable = mkEnableOption "Google Drive";
directory = mkOption { type = types.path; };
};
config = mkIf cfg.enable {
2020-06-10 17:37:25 +02:00
environment.systemPackages = [ pkgs.grive2 ];
2019-04-19 03:11:51 +02:00
2019-12-09 08:05:14 +01:00
systemd.user.services.google-drive = {
2019-04-19 03:11:51 +02:00
description = "Google Drive synchronisation service";
2019-12-09 08:05:14 +01:00
after = [ "network.target" ];
wantedBy = [ "default.target" ];
2019-06-08 15:01:55 +02:00
script = "${pkgs.grive2}/bin/grive -p ${cfg.directory}";
2019-04-19 03:11:51 +02:00
startAt = "*:0/5";
2019-12-09 08:05:14 +01:00
serviceConfig.Type = "oneshot";
2019-04-19 03:11:51 +02:00
};
};
}