Created
August 28, 2016 17:58
-
-
Save Mic92/b7fe5e0ad4d3b834c192bd6ecd763b99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
userservice = args: { | |
name = args.name; | |
value = { | |
wantedBy = [ "default.target" ]; | |
enable = true; | |
serviceConfig = { | |
RestartSec="500ms"; | |
Restart="always"; | |
ExecStart="/run/current-system/sw/bin/sh -c '" + | |
"export GTK_DATA_PREFIX=/run/current-system/sw;" + | |
"export PATH=$PATH:/var/setuid-wrappers:%h/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/run/current-system/sw/sbin; | |
" + | |
"exec ${args.command}'"; | |
}; | |
}; | |
}; | |
in { | |
systemd.user.services = (builtins.listToAttrs (map userservice [ | |
{ name = "chromium"; command = "${pkgs.chromium}/bin/chromium"; } | |
{ name = "claws-mail"; command = "${pkgs.claws-mail}/bin/claws-mail"; } | |
{ name = "gajim"; command = "${pkgs.gajim}/bin/gajim"; } | |
{ name = "gpg-agent"; command = "${pkgs.gnupg1compat}/bin/gpg-agent"; } | |
{ name = "copyq"; command = "${pkgs.copyq}/bin/copyq"; } | |
{ name = "xautolock"; command = "${pkgs.xautolock}/bin/xautolock -time 20 -locker %h/bin/i3lock.sh"; } | |
{ name = "mpd"; command = "${pkgs.mpd}/bin/mpd"; } | |
])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment