summaryrefslogtreecommitdiff
path: root/modules/hjem.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-07-15 06:54:33 -0500
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-07-15 06:54:33 -0500
commit8b990276c5e9abccd772694b1f7232d8b49b634c (patch)
tree23f4c3713c538f435354270de2005475c50955d0 /modules/hjem.nix
initial commit
Diffstat (limited to 'modules/hjem.nix')
-rw-r--r--modules/hjem.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/modules/hjem.nix b/modules/hjem.nix
new file mode 100644
index 0000000..019eada
--- /dev/null
+++ b/modules/hjem.nix
@@ -0,0 +1,58 @@
+{std, ...}: {
+ pkgs,
+ lib,
+ config,
+ ...
+}: let
+ cfg = config.tsunami;
+in {
+ imports = lib.filesystem.listFilesRecursive ./common;
+
+ _module.args = {
+ inherit std;
+ tsunamiLib = {
+ scriptPath = f: "~/.config/tmux/scripts/${f}.sh";
+ filePath = f: "~/.config/tmux/files/${f}";
+ };
+ };
+
+ files = lib.mkIf cfg.enable (lib.mkMerge [
+ (
+ cfg.scripts
+ |> builtins.mapAttrs (name: value: {
+ name = ".config/tmux/scripts/${name}.sh";
+ value = {
+ text = value;
+ executable = true;
+ };
+ })
+ |> lib.attrValues
+ |> builtins.listToAttrs
+ )
+ (
+ cfg.files
+ |> builtins.mapAttrs (name: value: {
+ name = ".config/tmux/files/${name}";
+ value.text = value;
+ })
+ |> lib.attrValues
+ |> builtins.listToAttrs
+ )
+ (
+ cfg.confs
+ |> builtins.mapAttrs (name: value: {
+ name = ".config/tmux/conf.d/${name}.conf";
+ value.text = value;
+ })
+ |> lib.attrValues
+ |> builtins.listToAttrs
+ )
+ {
+ ".config/tmux/tmux.conf".text = ''
+ run-shell "find ~/.config/tmux/conf.d -print0 | xargs -0 -n1 tmux source-file"
+ '';
+ }
+ ]);
+
+ packages = lib.optional cfg.enable pkgs.tmux;
+}