mirror of
https://code.dumpstack.io/tools/appvm.git
synced 2024-11-14 20:33:20 +00:00
65 lines
1.5 KiB
Nix
65 lines
1.5 KiB
Nix
{
|
|
imports = [
|
|
<nix/monitor.nix>
|
|
<nix/local.nix>
|
|
];
|
|
|
|
system.nixos.stateVersion = "18.03";
|
|
|
|
services.xserver = {
|
|
enable = true;
|
|
desktopManager.xterm.enable = false;
|
|
displayManager.slim = {
|
|
enable = true;
|
|
defaultUser = "user";
|
|
autoLogin = true;
|
|
};
|
|
windowManager.xmonad.enable = true;
|
|
windowManager.default = "xmonad";
|
|
};
|
|
|
|
services.spice-vdagentd.enable = true;
|
|
|
|
users.extraUsers.user = {
|
|
isNormalUser = true;
|
|
extraGroups = [ "audio" ];
|
|
createHome = true;
|
|
};
|
|
|
|
environment.etc."xmonad.hs".text = ''
|
|
import XMonad
|
|
main = xmonad defaultConfig
|
|
{ workspaces = [ "" ]
|
|
, borderWidth = 0
|
|
, startupHook = startup
|
|
}
|
|
|
|
startup :: X ()
|
|
startup = do
|
|
spawn "spice-vdagent"
|
|
'';
|
|
|
|
systemd.services.home-user-build-xmonad = {
|
|
description = "Create and xmonad configuration";
|
|
serviceConfig = {
|
|
ConditionFileNotEmpty = "!/home/user/.xmonad/xmonad.hs";
|
|
ExecStart = "/bin/sh -c 'mkdir -p /home/user/.xmonad && ln -s /etc/xmonad.hs /home/user/.xmonad/xmonad.hs'";
|
|
RemainAfterExit = "yes";
|
|
Type = "oneshot";
|
|
User = "user";
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
|
|
systemd.services.mount-home-user = {
|
|
description = "Mount /home/user (crutch)";
|
|
serviceConfig = {
|
|
ExecStart = "/bin/sh -c '/run/current-system/sw/bin/mount -t 9p -o trans=virtio,version=9p2000.L,uid=1000 home /home/user'";
|
|
RemainAfterExit = "yes";
|
|
Type = "oneshot";
|
|
User = "root";
|
|
};
|
|
wantedBy = [ "sysinit.target" ];
|
|
};
|
|
}
|