nix/module/NixOnDroid.nix

151 lines
3.3 KiB
Nix
Raw Normal View History

2024-04-03 06:21:29 +03:00
{ pkgs, inputs, const, config, ... }: let
homePath = "/data/data/com.termux.nix/files/home";
2024-04-02 20:34:27 +03:00
tmuxScript = pkgs.writeShellScriptBin "tmux_script" (builtins.readFile ./common/tmux/Script.sh);
2024-04-03 06:21:29 +03:00
bash = import ./common/bash/Bash.nix { config = config; };
bg = config.lib.stylix.colors.base00;
fg = config.lib.stylix.colors.base04;
2024-03-06 05:47:59 +03:00
in {
2024-03-25 01:42:34 +03:00
# NOTE: Split into modules?
environment.packages = with pkgs; [
android-tools
binwalk
coreutils
curl
diffutils
ffmpeg
file
findutils
gawk
gcc
gdu
git
gnugrep
gnumake
gnused
gnutar
gzip
hostname
imagemagick
jq
lsof
man
neofetch
nmap
openssh
parallel
pv
2024-03-26 06:31:22 +03:00
ripgrep
2024-03-25 01:42:34 +03:00
rsync
sqlite
2024-04-02 20:34:27 +03:00
tmux tmuxScript
2024-03-25 01:42:34 +03:00
tree
utillinux
wget
xz
yt-dlp
zip unzip
];
2024-03-26 06:36:00 +03:00
time.timeZone = const.timeZone;
2024-03-26 06:31:22 +03:00
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
home-manager.config = {
home.stateVersion = const.droidStateVersion;
home.file = {
2024-04-03 00:00:40 +03:00
".dotfiles".source = inputs.self;
".ssh/config".source = ./common/ssh/config;
2024-03-26 05:48:53 +03:00
".termux/_font.ttf".source = pkgs.runCommandNoCC "font" {} ''
cp ${pkgs.nerdfonts.override { fonts = [ "Terminus" ]; }}/share/fonts/truetype/NerdFonts/TerminessNerdFontMono-Regular.ttf $out
'';
2024-04-03 06:21:29 +03:00
".termux/_colors.properties".text = ''
background=#${bg}
foreground=#${fg}
'';
};
home.sessionVariables = {
2024-03-26 06:31:22 +03:00
BASH_PATH = ./common/bash;
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
NIXPKGS_ALLOW_UNFREE = "1";
NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}";
TERM = "xterm-256color";
2024-04-03 00:23:03 +03:00
};
programs.bash = {
2024-04-02 20:34:27 +03:00
enable = true;
2024-04-03 06:21:29 +03:00
bashrcExtra = bash.config + ''
2024-03-26 05:48:53 +03:00
[[ -f ~/.termux/font.ttf ]] || {
cp ~/.termux/_font.ttf ~/.termux/font.ttf
2024-04-03 00:23:03 +03:00
# cp ~/.termux/_colors.properties ~/.termux/colors.properties
_warn "Termux config installed, please restart."
2024-03-26 05:48:53 +03:00
};
'';
};
programs.tmux = {
2024-04-02 20:34:27 +03:00
enable = true;
2024-04-02 22:47:20 +03:00
extraConfig = builtins.readFile ./common/tmux/tmux.conf;
};
programs.git = {
enable = true;
extraConfig = {
credential.helper = "store";
init.defaultBranch = "main";
pull.rebase = true;
push.autoSetupRemote = true;
rebase.autoStash = true;
};
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
2024-03-25 01:10:28 +03:00
extraConfig = (import ./common/nvim/Init.nix { inputs = inputs; }).customRc;
};
2024-04-03 06:21:29 +03:00
stylix = {
image = wallpaper.path;
autoEnable = true;
polarity = "dark";
# base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
opacity = {
applications = 0.85;
terminal = 0.85;
popups = 0.85;
desktop = 0.85;
};
cursor = {
name = "phinger-cursors";
package = pkgs.phinger-cursors;
size = 24;
};
fonts = {
sizes = {
applications = 12;
terminal = 12;
popups = 12;
desktop = 12;
};
serif = {
package = (pkgs.callPackage ./applefont {});
name = "SF Pro Display";
};
sansSerif = config.stylix.fonts.serif;
monospace = {
package = (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; });
name = "Terminess Nerd Font Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
# targets = {
# foot = {
# enable = true;
# };
# };
};
};
}