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 TPM support #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 15 additions & 1 deletion modules/proxmox-ve/manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lib.mkIf cfg.enable {
"corosync.service"
"pve-cluster.service"
];
path = with pkgs; [ btrfs-progs zfs bashInteractive cdrkit ];
path = with pkgs; [ btrfs-progs zfs bashInteractive cdrkit swtpm ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/pvedaemon start";
ExecStop = "${cfg.package}/bin/pvedaemon stop";
Expand Down Expand Up @@ -172,6 +172,20 @@ lib.mkIf cfg.enable {
# spiceproxy = { };
};

environment.etc."swtpm_setup.conf".text = ''
# Program invoked for creating certificates
create_certs_tool= ${pkgs.swtpm}/share/swtpm/swtpm-localca
create_certs_tool_config = ${pkgs.writeText "swtpm-localca.conf" ''
statedir = /var/lib/swtpm-localca
signingkey = /var/lib/swtpm-localca/signkey.pem
issuercert = /var/lib/swtpm-localca/issuercert.pem
certserial = /var/lib/swtpm-localca/certserial
''}
create_certs_tool_options = ${pkgs.swtpm}/etc/swtpm-localca.options
# Comma-separated list (no spaces) of PCR banks to activate by default
active_pcr_banks = sha256
'';

systemd.tmpfiles.rules = [ "d /var/log/pveproxy 0755 www-data www-data -" ];

systemd.targets = {
Expand Down