Weechat up and running
This commit is contained in:
parent
f3524267b8
commit
08f3939bf8
8 changed files with 83 additions and 9 deletions
|
@ -113,6 +113,7 @@
|
|||
./nixos/beefcake
|
||||
] (with outputs.homeManagerModules; [
|
||||
linux
|
||||
weechat-in-tmux-service
|
||||
]);
|
||||
rascal = mkNixosSystem "x86_64-linux" [./nixos/rascal] (with outputs.homeManagerModules; [
|
||||
linux
|
||||
|
|
9
lib/internal.md
Normal file
9
lib/internal.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Internal Usage
|
||||
|
||||
## Update Server
|
||||
|
||||
```shell
|
||||
g a; set host beefcake; nix run nixpkgs#nixos-rebuild -- --flake ".#$host" \
|
||||
--target-host "root@$host" --build-host "root@$host" \
|
||||
switch --show-trace
|
||||
```
|
|
@ -27,6 +27,9 @@
|
|||
sway-laptop = import ./sway-laptop.nix;
|
||||
tmux = import ./tmux.nix;
|
||||
|
||||
tmux-master-service = import ./tmux-master-service.nix;
|
||||
weechat-in-tmux-service = import ./weechat-in-tmux-service.nix;
|
||||
|
||||
dragon = import ./dragon.nix;
|
||||
thinker = import ./thinker.nix;
|
||||
foxtrot = import ./foxtrot.nix;
|
||||
|
|
35
modules/home-manager/tmux-master-service.nix
Normal file
35
modules/home-manager/tmux-master-service.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.services.tmux-master-service;
|
||||
in {
|
||||
options.services.tmux-master-service = {
|
||||
enable = mkEnableOption "tmux master service";
|
||||
|
||||
socket = mkOption {
|
||||
type = types.path;
|
||||
default = "/run/user/%U/tmux-%U/default";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
# https://superuser.com/a/1582196
|
||||
systemd.user.services.tmux-master = {
|
||||
Unit = {
|
||||
Description = "tmux master service";
|
||||
};
|
||||
Service = {
|
||||
Type = "forking";
|
||||
RemainAfterExit = "yes";
|
||||
ExecStart = "${pkgs.tmux}/bin/tmux -S ${cfg.socket} new-session -d -s default";
|
||||
ExecStop = "${pkgs.tmux}/bin/tmux -S ${cfg.socket} kill-session -t weechat";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["default.target"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -118,4 +118,7 @@
|
|||
# set -g @continuum-save-interval '120'
|
||||
'';
|
||||
};
|
||||
home.shellAliases = {
|
||||
t = "tmux";
|
||||
};
|
||||
}
|
||||
|
|
28
modules/home-manager/weechat-in-tmux-service.nix
Normal file
28
modules/home-manager/weechat-in-tmux-service.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
pkgs,
|
||||
outputs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
socket = config.services.tmux-master-service.socket;
|
||||
in {
|
||||
imports = with outputs.homeManagerModules; [
|
||||
tmux-master-service
|
||||
];
|
||||
systemd.user.services.weechat-in-tmux = {
|
||||
Unit = {
|
||||
Description = "weechat in tmux";
|
||||
PartOf = "tmux-master.service";
|
||||
After = ["tmux-master.service"];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = "yes";
|
||||
ExecStart = "${pkgs.tmux}/bin/tmux -S ${socket} new-session -d -s weechat ${pkgs.weechat}/bin/weechat";
|
||||
ExecStop = "${pkgs.tmux}/bin/tmux -S ${socket} kill-session -t weechat";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["default.target"];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -255,15 +255,6 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
|
|||
|
||||
environment.systemPackages = [pkgs.linuxquota];
|
||||
|
||||
systemd.services.weechat-in-tmux = {
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.tmux}/bin/tmux -2 new-session -d -s weechat ${pkgs.weechat}/bin/weechat";
|
||||
ExecStop = "${pkgs.tmux}/bin/tmux kill-session -t weechat";
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: make the client declarative? right now I think it's manually git
|
||||
# clone'd to /root
|
||||
systemd.services.deno-netlify-ddns-client = {
|
||||
|
|
|
@ -121,6 +121,10 @@ nix-shell --packages git \
|
|||
--option trusted-public-keys 'cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0='"
|
||||
```
|
||||
|
||||
# Internal Usage
|
||||
|
||||
Just for me, see [[lib/internal.md]]
|
||||
|
||||
# To Do
|
||||
|
||||
## Short Term
|
||||
|
|
Loading…
Reference in a new issue