2018-07-12 19:29:35 +00:00
|
|
|
{pkgs, ...}:
|
2018-06-30 08:39:47 +00:00
|
|
|
{
|
2018-06-30 21:56:43 +00:00
|
|
|
imports = [
|
|
|
|
<nix/monitor.nix>
|
2018-07-01 06:56:16 +00:00
|
|
|
<nix/local.nix>
|
2018-06-30 21:56:43 +00:00
|
|
|
];
|
|
|
|
|
2018-06-30 08:39:47 +00:00
|
|
|
services.xserver = {
|
|
|
|
enable = true;
|
|
|
|
desktopManager.xterm.enable = false;
|
|
|
|
displayManager.slim = {
|
|
|
|
enable = true;
|
|
|
|
defaultUser = "user";
|
|
|
|
autoLogin = true;
|
|
|
|
};
|
|
|
|
windowManager.xmonad.enable = true;
|
|
|
|
windowManager.default = "xmonad";
|
|
|
|
};
|
|
|
|
|
2018-07-12 17:43:42 +00:00
|
|
|
services.spice-vdagentd.enable = true;
|
|
|
|
|
2018-06-30 08:39:47 +00:00
|
|
|
users.extraUsers.user = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "audio" ];
|
|
|
|
createHome = true;
|
|
|
|
};
|
2018-07-06 15:06:00 +00:00
|
|
|
|
|
|
|
environment.etc."xmonad.hs".text = ''
|
|
|
|
import XMonad
|
|
|
|
main = xmonad defaultConfig
|
|
|
|
{ workspaces = [ "" ]
|
|
|
|
, borderWidth = 0
|
2018-07-12 17:43:42 +00:00
|
|
|
, startupHook = startup
|
2018-07-06 15:06:00 +00:00
|
|
|
}
|
2018-07-12 17:43:42 +00:00
|
|
|
|
|
|
|
startup :: X ()
|
|
|
|
startup = do
|
|
|
|
spawn "spice-vdagent"
|
2018-07-06 15:06:00 +00:00
|
|
|
'';
|
|
|
|
|
2018-07-12 19:29:35 +00:00
|
|
|
environment.systemPackages = [ pkgs.bc ];
|
|
|
|
services.cron = {
|
|
|
|
enable = true;
|
|
|
|
systemCronJobs = [
|
|
|
|
"* * * * * root free -m | grep Mem | awk '{print $2 \"-\" $4}' | bc > /home/user/.memory_used"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2018-07-06 15:06:00 +00:00
|
|
|
systemd.services.home-user-build-xmonad = {
|
|
|
|
description = "Create and xmonad configuration";
|
|
|
|
serviceConfig = {
|
|
|
|
ConditionFileNotEmpty = "!/home/user/.xmonad/xmonad.hs";
|
2018-07-12 17:43:20 +00:00
|
|
|
ExecStart = "/bin/sh -c 'mkdir -p /home/user/.xmonad && ln -s /etc/xmonad.hs /home/user/.xmonad/xmonad.hs'";
|
2018-07-06 15:06:00 +00:00
|
|
|
RemainAfterExit = "yes";
|
|
|
|
Type = "oneshot";
|
|
|
|
User = "user";
|
|
|
|
};
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
2018-07-11 23:34:36 +00:00
|
|
|
|
|
|
|
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" ];
|
|
|
|
};
|
2018-06-30 08:39:47 +00:00
|
|
|
}
|