Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for backup and restore in proxmox-ve gui #45

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/proxmox-ve/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ in
};
users.groups.www-data = { };

environment.systemPackages = [ cfg.package ];
environment.systemPackages = [ cfg.package pkgs.proxmox-ve pkgs.pve-qemu pkgs.cifs-utils pkgs.samba];
environment.etc.issue.enable = false;

networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [
Expand Down
11 changes: 11 additions & 0 deletions modules/proxmox-ve/manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ lib.mkIf cfg.enable {
wantedBy = [ "multi-user.target" ];
wants = [
"pvestatd.service"
"qmeventd.service"
"pveproxy.service"
"spiceproxy.service"
"pve-firewall.service"
Expand All @@ -77,6 +78,7 @@ lib.mkIf cfg.enable {
after = [
"pveproxy.service"
"pvestatd.service"
"qmeventd.service"
"spiceproxy.service"
"pve-firewall.service"
"lxc.service"
Expand Down Expand Up @@ -152,6 +154,15 @@ lib.mkIf cfg.enable {
};
};

qmeventd = {
Copy link
Author

@blecher-at blecher-at Jul 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can probably be removed once #41 is merged...

description = "PVE Qemu Event Daemon";
before = [ "pve-ha-lrm.service" "pve-guests.service" ];
serviceConfig = {
ExecStart = "${pkgs.proxmox-ve}/bin/qmeventd /var/run/qmeventd.sock";
Type = "forking";
};
};

# pvenetcommit = {
# description = "Commit Proxmox VE network changes";
# wantedBy = [ "multi-user.target" ];
Expand Down
28 changes: 28 additions & 0 deletions pkgs/cstream/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ lib, stdenv, fetchurl, ... }:

stdenv.mkDerivation rec {
pname = "cstream";
version = "4.0.0";

src = fetchurl {
url = "https://www.cons.org/cracauer/download/cstream-${version}.tar.gz";
sha256 = "sha256-a8BtfEOG+5jTqRcTQ0wxXZ5tQlyRyIYoG+qiVMDgluM=";
};

buildInputs = [ stdenv.cc ];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to use nativeBuildInputs as cc will not be needed during runtime?


buildPhase = ''
make
'';

installPhase = ''
mkdir -p $out/bin
cp cstream $out/bin
'';

meta = {
description = "A general-purpose stream-handling tool like dd";
homepage = "https://www.cons.org/cracauer/cstream.html";
maintainers = with lib.maintainers; [ ];
};
}
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let
termproxy = callPackage ./termproxy { };
unifont_hex = callPackage ./unifont { };
vncterm = callPackage ./vncterm { };
cstream = callPackage ./cstream { };

proxmox-acme = callPackage ./proxmox-acme { };
proxmox-backup = callPackage ./proxmox-backup { };
Expand Down
14 changes: 13 additions & 1 deletion pkgs/pve-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
pve-docs,
pve-ha-manager,
pve-http-server,
cdrkit,
enableLinstor ? false,
ceph,
gnupg,
Expand All @@ -18,14 +19,18 @@
openvswitch,
openssh,
pve-qemu,
pve-qemu-server,
tzdata,
pve-novnc,
pve-xtermjs,
iproute2,
termproxy,
shadow,
wget,
bash,
zstd,
util-linux,
system-sendmail, rsync, busybox, cstream, lvm2
}:

let
Expand All @@ -37,6 +42,7 @@ let
proxmox-acme
(pve-ha-manager.override { inherit enableLinstor; })
pve-http-server
pve-qemu-server
];

perlEnv = perl536.withPackages (_: perlDeps);
Expand Down Expand Up @@ -110,7 +116,9 @@ perl536.pkgs.toPerlModule (
-e "s|/usr/share/zoneinfo|${tzdata}/share/zoneinfo|" \
-e "s|/usr/share/pve-xtermjs|${pve-xtermjs}/share/pve-xtermjs|" \
-Ee "s|(/usr)?/s?bin/||" \
-e "s|/usr/share/novnc-pve|${pve-novnc}/share/webapps/novnc|"
-e "s|/usr/share/novnc-pve|${pve-novnc}/share/webapps/novnc|" \
-e "s|/usr/share/perl5/.plug|${pve-qemu-server}/${perl536.libPrefix}/${perl536.version}/\$plug|"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better to patch the plugin-logic (PVE/VZDump.pm:45) instead, as this currently wont support lxc containers.



find $out/bin -type f | xargs sed -i \
-e "/ENV{'PATH'}/d"
Expand All @@ -120,6 +128,7 @@ perl536.pkgs.toPerlModule (
--prefix PATH : ${
lib.makeBinPath [
ceph
cdrkit ## cloud-init
gzip
openssh
util-linux
Expand All @@ -131,6 +140,9 @@ perl536.pkgs.toPerlModule (
(pve-ha-manager.override { inherit enableLinstor; })
shadow
wget

## dependencies of backup and restore
bash zstd system-sendmail rsync busybox cstream lvm2
]
} \
--prefix PERL5LIB : $out/${perl536.libPrefix}/${perl536.version}
Expand Down
3 changes: 3 additions & 0 deletions pkgs/pve-storage/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
file,
glusterfs,
gptfdisk,
gzip,
libiscsi,
lvm2,
nfs-utils,
Expand Down Expand Up @@ -111,6 +112,8 @@ perl536.pkgs.toPerlModule (
-e "s|/usr/bin/smbclient|${samba}/bin/smbclient|" \
-e "s|/usr/bin/ssh|${openssh}/bin/ssh|" \
-e "s|/usr/bin/targetcli|${targetcli}/bin/targetcli|" \
-e "s|/usr/bin/vma|${pve-qemu}/bin/vma|" \
-e "s|/usr/bin/zcat|${gzip}/bin/zcat|" \
-e "s|/usr/libexec/ceph|$out/libexec/ceph|" \
-re "s|/usr/s?bin/ceph|${ceph}/bin/ceph|" \
-e "s|/usr/sbin/gluster|${glusterfs}/bin/gluster|" \
Expand Down