-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
57 lines (53 loc) · 2.04 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
description = "Nixos config flake with Proxmox support";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
proxmox-nixos.url = "github:SaumonNet/proxmox-nixos";
};
outputs = { self, nixpkgs, proxmox-nixos, ... }@inputs: {
nixosConfigurations.default = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
proxmox-nixos.nixosModules.proxmox-ve
({ pkgs, lib, ... }: {
# spiceproxy seems to want this directory even though it is empty
# maybe there is a better way to fix it but this works.
systemd.tmpfiles.rules = [
"d /usr/share/fonts 0755 root root -"
"d /usr/share/fonts/truetype 0755 root root -"
"d /usr/share/fonts/truetype/glyphicons 0755 root root -"
];
services.proxmox-ve = {
enable = true;
ipAddress = "10.0.0.65"; #same as vmbr0
};
systemd.services.spiceproxy = {
description = "PVE SPICE Proxy Server";
wantedBy = [ "multi-user.target" ];
after = [ "pveproxy.service" ];
wants = [ "pveproxy.service" ];
serviceConfig = {
ExecStartPre = [
"${pkgs.coreutils}/bin/touch /var/lock/spiceproxy.lck"
"${pkgs.coreutils}/bin/chown www-data:www-data /var/lock/spiceproxy.lck"
];
ExecStart = "${pkgs.proxmox-ve}/bin/spiceproxy start";
ExecStop = [
"${pkgs.coreutils}/bin/rm -f /var/lock/spiceproxy.lck"
"${pkgs.proxmox-ve}/bin/spiceproxy stop"
];
ExecReload = "${pkgs.proxmox-ve}/bin/spiceproxy restart";
PIDFile = "/run/pveproxy/spiceproxy.pid"; # the code puts it here, not in /run/spiceproxy/
Type = "forking";
Restart = "on-failure";
};
};
nixpkgs.overlays = [
proxmox-nixos.overlays.x86_64-linux
];
})
];
};
};
}