Skip to content

Commit

Permalink
Add termux-file-editor script
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Oct 16, 2023
1 parent 4bf362a commit eac170f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
37 changes: 37 additions & 0 deletions home/roles/mobile/bin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:

with lib;

let

inherit (config.lib.custom) genAttrs';

cfg = config.custom.roles.mobile.bin;

mkUserBinScript = name:
{
name = "bin/${name}";
value = {
source = ./scripts + "/${name}";
target = config.home.homeDirectory + "/bin/${name}";
executable = true;
};
};

in

{
options = {
custom.roles.mobile.bin = {
enable = mkEnableOption "Mobile user bin scripts";
};
};

config = mkIf cfg.enable {
xdg.configFile = genAttrs'
[
"termux-file-editor"
]
mkUserBinScript;
};
}
2 changes: 2 additions & 0 deletions home/roles/mobile/bin/scripts/termux-file-editor
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
vim $1
5 changes: 4 additions & 1 deletion home/roles/mobile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ in
identities = [ logseqSshKey logseqSshPubKey ];
};

roles.homeage.secrets = [ logseqSshKey logseqSshPubKey ];
roles = {
homeage.secrets = [ logseqSshKey logseqSshPubKey ];
mobile.bin.enable = true;
};
};
};
}

0 comments on commit eac170f

Please sign in to comment.