feat(mottarone): add urbackup
This commit is contained in:
parent
6069ebb09d
commit
fd57aa3657
4 changed files with 77 additions and 0 deletions
|
@ -1,6 +1,16 @@
|
|||
inputs: final: prev: {
|
||||
idea-ultimate-fixed = prev.callPackage ./idea-fixed.nix { };
|
||||
|
||||
urbackup-client = prev.urbackup-client.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ prev.autoreconfHook ];
|
||||
|
||||
patches = old.patches or [ ] ++ [ ./urbackup-client-install.patch ];
|
||||
|
||||
configureFlags = old.configureFlags or [ ] ++ [
|
||||
"--localstatedir=/var/lib"
|
||||
];
|
||||
});
|
||||
|
||||
vencord = prev.vencord.overrideAttrs (old: rec {
|
||||
version = "${old.version}+git.${inputs.vencord.shortRev}";
|
||||
src = inputs.vencord;
|
||||
|
|
31
exprs/urbackup-client-install.patch
Normal file
31
exprs/urbackup-client-install.patch
Normal file
|
@ -0,0 +1,31 @@
|
|||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 7e661f60..73fb2827 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -161,7 +161,7 @@ if !WITH_ASSERTIONS
|
||||
blockalign_CXXFLAGS +=-DNDEBUG
|
||||
endif
|
||||
|
||||
-install-exec-local: defaults_client init.d_client init.d_client_rh
|
||||
+disable-install-exec-local: defaults_client init.d_client init.d_client_rh
|
||||
if INSTALL_DEBIAN_INITD
|
||||
$(INSTALL) -D "$(srcdir)/init.d_client" "$(sysconfdir)/init.d/urbackupclientbackend"
|
||||
if ! test -e "$(sysconfdir)/default/urbackupclientbackend"; then $(INSTALL) -D "$(srcdir)/defaults_client" "$(sysconfdir)/default/urbackupclientbackend"; fi
|
||||
@@ -205,7 +205,7 @@ install-data-local: urbackupclient/backup_scripts/list urbackupclient/backup_scr
|
||||
client/version.txt client/data/urbackup_ecdsa409k1.pub client/data/updates_h.dat
|
||||
endif
|
||||
|
||||
- $(MKDIR_P) "$(DESTDIR)$(localstatedir)/urbackup/"
|
||||
+ echo WARNING: disabled running command "(MKDIR_P) \"$(DESTDIR)$(localstatedir)/urbackup/\""
|
||||
$(MKDIR_P) "$(DESTDIR)$(datadir)/urbackup/scripts"
|
||||
$(MKDIR_P) "$(DESTDIR)$(sysconfdir)/urbackup"
|
||||
|
||||
@@ -231,7 +231,7 @@ endif
|
||||
for script in "$(DESTDIR)$(datadir)/urbackup/scripts/"*; do sed "s|SYSCONFDIR|$(sysconfdir)/urbackup|g" "$$script" > "$$script.r"; mv "$$script.r" "$$script"; done
|
||||
chmod 700 "$(DESTDIR)$(datadir)/urbackup/scripts/"*
|
||||
chmod 700 "$(DESTDIR)$(sysconfdir)/urbackup/"*
|
||||
- $(INSTALL_DATA) "$(srcdir)/client/version.txt" "$(DESTDIR)$(localstatedir)/urbackup/version.txt"
|
||||
+ echo WARNING: disabled running command "$(INSTALL_DATA) \"$(srcdir)/client/version.txt\" \"$(DESTDIR)$(localstatedir)/urbackup/version.txt\""
|
||||
$(INSTALL_DATA) "$(srcdir)/client/data/urbackup_ecdsa409k1.pub" "$(DESTDIR)$(datadir)/urbackup/"
|
||||
$(INSTALL_DATA) "$(srcdir)/client/data/updates_h.dat" "$(DESTDIR)$(datadir)/urbackup/"
|
||||
|
|
@ -8,6 +8,10 @@ let
|
|||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./urbackup.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gtkterm
|
||||
remmina
|
||||
|
|
32
systems/mottarone/urbackup.nix
Normal file
32
systems/mottarone/urbackup.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ lib, pkgs, ... }:
|
||||
{
|
||||
# requires overlay, see exprs/overlay.nix
|
||||
environment.systemPackages = [ pkgs.urbackup-client ];
|
||||
|
||||
systemd.services."urbackup-client" = {
|
||||
after = [
|
||||
"syslog.target"
|
||||
"network.target"
|
||||
];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${lib.getExe' pkgs.urbackup-client "urbackupclientbackend"} --config /etc/default/urbackupclient --no-consoletime";
|
||||
# these paths are hardcoded in the binary, see overlay
|
||||
StateDirectory = "urbackup urbackup/data";
|
||||
WorkingDirectory = "/var/lib/urbackup";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
# "Sending files during file backups (file server)"
|
||||
35621
|
||||
# "Commands and image backups"
|
||||
35623
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
# "UDP broadcasts for discovery"
|
||||
35622
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue