From 64527e1077deeed6c9b206a8f396648def9c591e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Mon, 9 Sep 2019 18:33:27 -0400 Subject: home config --- home.nix | 47 --------------------------------------------- nix-home-config/dragon.nix | 13 +++++++++++++ nix-home-config/weechat.nix | 37 +++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 47 deletions(-) delete mode 100644 home.nix create mode 100644 nix-home-config/dragon.nix create mode 100644 nix-home-config/weechat.nix diff --git a/home.nix b/home.nix deleted file mode 100644 index 9bbce4d..0000000 --- a/home.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, pkgs, ... }: - -{ - programs.home-manager.enable = true; - programs.neovim.enable = true; - - home.stateVersion = "19.03"; - - home.sessionVariables = { - EDITOR = "nvim"; - }; - - 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" ]; - }; - }; - }; -} 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 -- cgit v1.2.3