mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-10 04:49:19 -08:00
project-wide: nixdirfmt
This commit is contained in:
parent
3ffa718152
commit
bddeba9bea
4 changed files with 119 additions and 114 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue