1
0
mirror of https://github.com/kmein/niveum synced 2026-03-20 20:01:08 +01:00

modularize

This commit is contained in:
Kierán Meinhardt
2019-04-19 03:11:51 +02:00
parent a90799f39b
commit a763c63de4
58 changed files with 1317 additions and 1172 deletions

31
modules/google-drive.nix Normal file
View File

@@ -0,0 +1,31 @@
{ 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; };
user = mkOption { type = types.attrs; };
};
config = mkIf cfg.enable {
environment.systemPackages = [
pkgs.grive2
];
systemd.services.google-drive = {
description = "Google Drive synchronisation service";
wants = [ "network-online.target" ];
script = ''
${pkgs.grive2}/bin/grive -p ${cfg.directory}
'';
startAt = "*:0/5";
serviceConfig = {
Type = "oneshot";
User = cfg.user.name;
};
};
};
}