1
0
mirror of https://github.com/kmein/niveum synced 2026-03-17 02:31:09 +01:00

fix(seafile, dropbox): move to user service

This commit is contained in:
Kierán Meinhardt
2019-12-08 22:37:16 +01:00
parent d64c349fe3
commit 5664786ab4
3 changed files with 15 additions and 22 deletions

View File

@@ -7,14 +7,8 @@
];
niveum = {
dropbox = {
enable = true;
user = config.users.users.me;
};
seafile = {
enable = true;
user = config.users.users.me;
};
dropbox.enable = true;
seafile.enable = true;
google-drive = rec {
enable = true;
directory = "${user.home}/cloud/gdrive";

View File

@@ -1,24 +1,24 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.niveum.dropbox;
in
{
in {
options.niveum.dropbox = {
enable = mkEnableOption "Dropbox";
user = mkOption { type = types.attrs; };
};
config = mkIf cfg.enable {
systemd.services.dropbox = {
systemd.user.services.dropbox = {
description = "Dropbox synchronisation service";
after = [ "network-online.target" ];
script = "${pkgs.dropbox}/bin/dropbox";
after = [ "network.target" ];
wantedBy = [ "default.target" ];
path = [ pkgs.dropbox-cli ];
serviceConfig = {
Type = "forking";
PIDFile = "%h/.dropbox/dropbox.pid";
Restart = "always";
User = cfg.user.name;
ExecStart = "${pkgs.dropbox-cli}/bin/dropbox start";
ExecStop = "${pkgs.dropbox-cli}/bin/dropbox stop";
};
};
environment.systemPackages = [ pkgs.dropbox-cli ];
};
}

View File

@@ -4,17 +4,16 @@ let cfg = config.niveum.seafile;
in {
options.niveum.seafile = {
enable = mkEnableOption "Seafile";
user = mkOption { type = types.attrs; };
};
config = lib.mkIf cfg.enable {
systemd.services.seafile = {
config = mkIf cfg.enable {
systemd.user.services.seafile = {
description = "Seafile synchronisation service";
after = [ "network-online.target" ];
after = [ "network.target" ];
wantedBy = [ "default.target" ];
script = "${pkgs.seafile-client}/bin/seafile-applet";
serviceConfig = {
Restart = "always";
User = cfg.user.name;
};
};