mirror of
https://github.com/kmein/niveum
synced 2026-03-22 12:51:08 +01:00
fix(seafile, dropbox): move to user service
This commit is contained in:
@@ -7,14 +7,8 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
niveum = {
|
niveum = {
|
||||||
dropbox = {
|
dropbox.enable = true;
|
||||||
enable = true;
|
seafile.enable = true;
|
||||||
user = config.users.users.me;
|
|
||||||
};
|
|
||||||
seafile = {
|
|
||||||
enable = true;
|
|
||||||
user = config.users.users.me;
|
|
||||||
};
|
|
||||||
google-drive = rec {
|
google-drive = rec {
|
||||||
enable = true;
|
enable = true;
|
||||||
directory = "${user.home}/cloud/gdrive";
|
directory = "${user.home}/cloud/gdrive";
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let cfg = config.niveum.dropbox;
|
let cfg = config.niveum.dropbox;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.niveum.dropbox = {
|
options.niveum.dropbox = {
|
||||||
enable = mkEnableOption "Dropbox";
|
enable = mkEnableOption "Dropbox";
|
||||||
user = mkOption { type = types.attrs; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services.dropbox = {
|
systemd.user.services.dropbox = {
|
||||||
description = "Dropbox synchronisation service";
|
description = "Dropbox synchronisation service";
|
||||||
after = [ "network-online.target" ];
|
after = [ "network.target" ];
|
||||||
script = "${pkgs.dropbox}/bin/dropbox";
|
wantedBy = [ "default.target" ];
|
||||||
|
path = [ pkgs.dropbox-cli ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
Type = "forking";
|
||||||
|
PIDFile = "%h/.dropbox/dropbox.pid";
|
||||||
Restart = "always";
|
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 ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,17 +4,16 @@ let cfg = config.niveum.seafile;
|
|||||||
in {
|
in {
|
||||||
options.niveum.seafile = {
|
options.niveum.seafile = {
|
||||||
enable = mkEnableOption "Seafile";
|
enable = mkEnableOption "Seafile";
|
||||||
user = mkOption { type = types.attrs; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services.seafile = {
|
systemd.user.services.seafile = {
|
||||||
description = "Seafile synchronisation service";
|
description = "Seafile synchronisation service";
|
||||||
after = [ "network-online.target" ];
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
script = "${pkgs.seafile-client}/bin/seafile-applet";
|
script = "${pkgs.seafile-client}/bin/seafile-applet";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
User = cfg.user.name;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user