project-wide: nixdirfmt

This commit is contained in:
kat witch 2021-04-23 17:25:12 +01:00
parent 3ffa718152
commit bddeba9bea
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
4 changed files with 119 additions and 114 deletions

View file

@ -1,15 +1,14 @@
{ config, pkgs, lib, sources, witch, ... }:
{
/*
# libvirtd is used for our virtual machine
virtualisation.libvirtd = {
enable = true;
qemuOvmf = true;
qemuRunAsRoot = false;
onBoot = "ignore";
onShutdown = "shutdown";
};
/* # libvirtd is used for our virtual machine
virtualisation.libvirtd = {
enable = true;
qemuOvmf = true;
qemuRunAsRoot = false;
onBoot = "ignore";
onShutdown = "shutdown";
};
*/
# required for guest reboots with the 580
@ -65,48 +64,45 @@
pkgs.kat-vm
];
security.pam.loginLimits = [
{
domain = "@users";
type = "-";
item = "memlock";
value = "unlimited";
}
];
security.pam.loginLimits = [{
domain = "@users";
type = "-";
item = "memlock";
value = "unlimited";
}];
systemd.extraConfig = "DefaultLimitMEMLOCK=infinity";
/*
systemd.services.libvirtd-guest-win10 = {
enable = true;
after = [ "libvirtd.service" ];
requires = [ "libvirtd.service" ];
serviceConfig = {
type = "oneshot";
RemainAfterExit = "yes";
};
script = let
xml =
pkgs.writeText "libvirt-guest-win10.xml" (import ./win10.xml.nix { });
in ''
uuid="$(${pkgs.libvirt}/bin/virsh domuuid 'win10' || true)"
${pkgs.libvirt}/bin/virsh define <(sed "s/UUID/$uuid/" '${xml}')
${pkgs.libvirt}/bin/virsh start 'win10';
'';
preStop = ''
${pkgs.libvirt}/bin/virsh shutdown 'win10'
let "timeout = $(date +%s) + 120"
while [ "$(${pkgs.libvirt}/bin/virsh list --name | grep --count '^win10$')" -gt 0 ]; do
if [ "$(date +%s)" -ge "$timeout" ]; then
# meh, we warned it...
${pkgs.libvirt}/bin/virsh destroy 'win10'
else
# the machine is still running, let's give it some time to shut down
sleep 0.5
fi
done
'';
};
/* systemd.services.libvirtd-guest-win10 = {
enable = true;
after = [ "libvirtd.service" ];
requires = [ "libvirtd.service" ];
serviceConfig = {
type = "oneshot";
RemainAfterExit = "yes";
};
script = let
xml =
pkgs.writeText "libvirt-guest-win10.xml" (import ./win10.xml.nix { });
in ''
uuid="$(${pkgs.libvirt}/bin/virsh domuuid 'win10' || true)"
${pkgs.libvirt}/bin/virsh define <(sed "s/UUID/$uuid/" '${xml}')
${pkgs.libvirt}/bin/virsh start 'win10';
'';
preStop = ''
${pkgs.libvirt}/bin/virsh shutdown 'win10'
let "timeout = $(date +%s) + 120"
while [ "$(${pkgs.libvirt}/bin/virsh list --name | grep --count '^win10$')" -gt 0 ]; do
if [ "$(date +%s)" -ge "$timeout" ]; then
# meh, we warned it...
${pkgs.libvirt}/bin/virsh destroy 'win10'
else
# the machine is still running, let's give it some time to shut down
sleep 0.5
fi
done
'';
};
*/
home-manager.users.kat = {