Skip to content

Commit aeb3c07

Browse files
committed
autosave (pavel-am5 / Linux)
1 parent cc0c0d4 commit aeb3c07

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

modules/nixos/virt-manager.nix

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,20 @@ in
123123
# --with-key=host-only. If migrating from a TPM host, delete the old key:
124124
# rm /var/lib/libvirt/secrets/secrets-encryption-key
125125
# systemctl restart virt-secret-init-encryption
126-
systemd.services.virt-secret-init-encryption.serviceConfig.ExecStart = lib.mkForce [
127-
""
128-
"${pkgs.runtimeShell} -c 'umask 0077 && (${pkgs.coreutils}/bin/dd if=/dev/random status=none bs=32 count=1 | ${pkgs.systemd}/bin/systemd-creds encrypt --with-key=host-only --name=secrets-encryption-key - /var/lib/libvirt/secrets/secrets-encryption-key)'"
129-
];
126+
systemd.services.virt-secret-init-encryption = {
127+
description = "Initialize libvirt secrets encryption key";
128+
wantedBy = [ "multi-user.target" ];
129+
before = [ "libvirtd.service" ];
130+
unitConfig.ConditionPathExists = "!/var/lib/libvirt/secrets/secrets-encryption-key";
131+
serviceConfig = {
132+
Type = "oneshot";
133+
RemainAfterExit = true;
134+
ExecStart = [
135+
""
136+
"${pkgs.runtimeShell} -c '${pkgs.coreutils}/bin/mkdir -p /var/lib/libvirt/secrets && umask 0077 && (${pkgs.coreutils}/bin/dd if=/dev/random status=none bs=32 count=1 | ${pkgs.systemd}/bin/systemd-creds encrypt --with-key=host-only --name=secrets-encryption-key - /var/lib/libvirt/secrets/secrets-encryption-key)'"
137+
];
138+
};
139+
};
130140
}
131141

132142
(lib.mkIf cfg.iommu.enable {

users/pavel/hm/home-pavel-generic-linux.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
[ ];
99

1010
home.activation.jetbrains-keymaps = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
11-
${pkgs.findutils}/bin/find ${config.home.homeDirectory}/.config/JetBrains \
12-
-type d \
13-
-wholename '*/JetBrains/*/keymaps' '!' -path '*/settingsSync/*' \
14-
-exec cp -f "${cfg-meta.paths.users}/pavel/hm/keymap-idea-linux.xml" {}/Magen.xml \;
11+
if [ -d "${config.home.homeDirectory}/.config/JetBrains" ]; then
12+
${pkgs.findutils}/bin/find ${config.home.homeDirectory}/.config/JetBrains \
13+
-type d \
14+
-wholename '*/JetBrains/*/keymaps' '!' -path '*/settingsSync/*' \
15+
-exec cp -f "${cfg-meta.paths.users}/pavel/hm/keymap-idea-linux.xml" {}/Magen.xml \;
16+
fi
1517
'';
1618

1719

0 commit comments

Comments
 (0)