Skip to content

Instantly share code, notes, and snippets.

@luisadha
Last active May 10, 2025 17:19
Show Gist options
  • Save luisadha/c783b692c1e70e5df8e758c48876cb2f to your computer and use it in GitHub Desktop.
Save luisadha/c783b692c1e70e5df8e758c48876cb2f to your computer and use it in GitHub Desktop.
cat ~/.config/nix-on-droid/nix-on-droid.nix #cnn #aliases #abbrs
{ config, lib, pkgs, ... }:
{
# termux integration
android-integration = {
am.enable = true; # termux-am
termux-open.enable = true;
termux-open-url.enable = true;
termux-reload-settings.enable = true;
termux-setup-storage.enable = true;
termux-wake-lock.enable = true;
termux-wake-unlock.enable = true;
# unsuported.enable = true;
xdg-open.enable = true;
};
environment.motd = ''
Welcome to Nix-on-D@@roid! If anything goes wrong, report it on GitHub.
'';
environment.extraOutputsToInstall = [ "doc" "info" ];
# environment.usrBinEnv = "which env";
# custom variable
environment.sessionVariables = {
PATH = "$PATH:/system/bin";
TEST = "kuy";
EDITOR = "vim";
};
# default shell
user.shell = lib.getExe pkgs.fish; # change pkgs.fish with your favorite shell
# Add Fish-specific commands
environment.etc."bashrc".text = ''
alrc_plugin='
al_include_bash_preexec
al_include_blesh
# al_include_brandomusicv
# al_include_drawercli
# al_include_musiktap
'
`# This variable will initialize the environment variable so that it can be read by alrc-termux, don\'t forget to insert the source "$ALRC"/alrc-termux.sh also at the end.`
alrc_config='
# Path to your alrc-termux installation
export ALRC="/data/data/com.termux.nix/files/home/.local/share/alrc-termux"
export ALRC_USE_STARSHIP="bracketed-segments"
export ALRC_USE_ALFETCH="true"
export ALRC_MOTD_USE_BOXES="tjc"
# Set name of the addtional border theme by boxes to load. Optionally, if you set this to "random"
# it will load a random design boxes each time that alrc-termuxis loaded.
# # Uncomment the following line if you dont use brandomusicv plugins
source "$ALRC"/alrc-termux.sh 2>&-
'
_bp_imported="defined"
# Define some function to use preexec
preexec_hello_world() { echo "You just entered $1"; }
# Add it to the array of functions to be invoked each time.
preexec_functions+=(preexec_hello_world)
# precmd_functions+=(precmd_1);
# precmd_functions+=(precmd_2);
#
eval ''${alrc_config[@]}
eval ''${alrc_plugin[@]}
'';
environment.etc."fish/config.fish".text = ''
# Kustomisasi tema pure
set PURE_PROMPT_PATH ~/.nix-profile/share/fish/functions
for file in $PURE_PROMPT_PATH/*.fish
source $file
end
# Configure Pure Prompt options
set --universal pure_show_system_time true
set --universal pure_color_system_time pure_color_mute
# Kustomisi pengguna
if not type -q curl
echo "Program yang diminta tidak tersedia."
else
set ip (curl -s ifconfig.me)
if test -z "$ip"
echo "Koneksi hilang!."
echo y | ~/.brandomusic
else
echo "==> Terhubung ke jaringan!"
echo "IP Publik Anda: $ip"
echo y | ~/.brandomusic | trans -b :en
end
end
#curl https://raw.githubusercontent.com/luisadha/Bash-Scripts/refs/heads/master/src/progress_bar.sh | bash
#bass 'source ~/termcreed/termcreed.sh'
set -U fish_user_paths $HOME/.local/bin $fish_user_paths
fish_add_path ~/.local/bin/
'';
# Simply install just the packages
environment.packages = with pkgs; [
# User-facing stuff that you really really want to have
# vim # or some other editor, e.g. nano or neovim
neovim
nano
# Some common stuff that people expect to have
procps
killall
diffutils
#findutils
fd # findutils alternative
utillinux
#tzdata
hostname
man
#gnugrep
#gnupg
# gnused
gnutar
#bzip2
#gzip
#xz
#nerdfonts
openvscode-server
zip
unzip
];
home-manager.useUserPackages = true;
# Read the changelog before changing this value
system.stateVersion = "24.05";
# Set up nix for flakes
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# Set your time zone
time.timeZone = "Asia/Jakarta";
# Set Extra Host
networking.extraHosts = "192.168.0.1 lanhost";
# Set your localhost
networking.hosts = {
"127.0.0.1" = [ "localhost" ];
};
# TODO set terminal font
terminal.font = "${pkgs.terminus_font_ttf}/share/fonts/truetype/TerminusTTF.ttf";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment