summaryrefslogtreecommitdiff
path: root/nix-home-config
diff options
context:
space:
mode:
authorKjetil Ørbekk <kj@orbekk.com>2019-09-09 18:33:27 -0400
committerKjetil Ørbekk <kj@orbekk.com>2019-09-09 18:33:34 -0400
commit64527e1077deeed6c9b206a8f396648def9c591e (patch)
tree85e91967ba1123fcdc5d443a781b5455cc43b611 /nix-home-config
parent8b97d71ae1726c95be9f3ad64b6d2eca9afd8cda (diff)
home config
Diffstat (limited to 'nix-home-config')
-rw-r--r--nix-home-config/dragon.nix13
-rw-r--r--nix-home-config/weechat.nix37
2 files changed, 50 insertions, 0 deletions
diff --git a/nix-home-config/dragon.nix b/nix-home-config/dragon.nix
new file mode 100644
index 0000000..3e8a4bb
--- /dev/null
+++ b/nix-home-config/dragon.nix
@@ -0,0 +1,13 @@
+{ config, pkgs, ... }:
+
+{
+ imports = [ ./weechat.nix ];
+ programs.home-manager.enable = true;
+ programs.neovim.enable = true;
+
+ home.stateVersion = "19.03";
+
+ home.sessionVariables = {
+ EDITOR = "nvim";
+ };
+}
diff --git a/nix-home-config/weechat.nix b/nix-home-config/weechat.nix
new file mode 100644
index 0000000..80eec93
--- /dev/null
+++ b/nix-home-config/weechat.nix
@@ -0,0 +1,37 @@
+{ config, pkgs, ... }:
+
+{
+ systemd.user.startServices = true;
+ systemd.user.services = {
+ weechat = {
+ Unit = {
+ Description = "Weechat";
+ After = [ "networking.target" ];
+ };
+
+ Service = {
+ Environment = ["TERM=${pkgs.rxvt_unicode.terminfo}" "TMUX_TMPDIR=/run/user/1000"];
+ Type = "oneshot";
+ RemainAfterExit = "yes";
+ ExecStart = "" + pkgs.writeScript "weechat-start" ''
+ #!${pkgs.stdenv.shell}
+ ${pkgs.tmux}/bin/tmux -2 new-session -d -s irc "${pkgs.weechat}/bin/weechat"
+ '';
+ ExecStop = "" + pkgs.writeScript "weechat-stop" ''
+ #!${pkgs.stdenv.shell}
+ pkill -SIGTERM -xf "${pkgs.weechat}/bin/weechat"
+ for i in {1..10}; do
+ echo "Waiting for weechat to stop... $i"
+ pgrep -xlf "${pkgs.weechat}/bin/weechat" || break
+ sleep 1
+ done
+ tmux kill-session -t irc || true
+ '';
+ };
+
+ Install = {
+ WantedBy = [ "default.target" ];
+ };
+ };
+ };
+} \ No newline at end of file