Init repo

This commit is contained in:
kagura 2024-09-04 12:24:46 +08:00
commit ac14550ab7
2 changed files with 166 additions and 0 deletions

111
home.nix Normal file
View file

@ -0,0 +1,111 @@
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "nix-on-droid";
home.homeDirectory = "/data/data/com.termux.nix/files/home";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
zsh
zsh-powerlevel10k
oh-my-zsh
thefuck
fzf
zsh-fzf-tab
git
eza
hyfetch
helix
curl
nil
openssh
perl
gawk
gnused
clang_16
lldb_16
llvm_16
cmake
openjdk
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
};
home.sessionVariables = {
EDITOR = "hx";
};
programs.home-manager.enable = true;
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.zsh = {
enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = {
ls = "eza";
ll = "eza --icons -l";
la = "eza --icons -al";
vi = "hx";
vim = "hx";
update = "nix-on-droid switch";
home-edit = "hx ~/.config/nixpkgs";
};
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
};
zplug = {
enable = true;
plugins = [{ name = "zsh-users/zsh-autosuggestions"; }];
};
plugins = [{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}];
oh-my-zsh = {
enable = true;
plugins = [ "git" "thefuck" ];
theme = "agnoster";
};
initExtra = ''
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
[[ ! -f ~/.scripts/github.sh ]] || source ~/.scripts/github.sh
'';
};
}

55
nix-on-droid.nix Normal file
View file

@ -0,0 +1,55 @@
{ config, lib, pkgs, ... }:
{
# Simply install just the packages
environment.packages = with pkgs; [
vim # or some other editor, e.g. nano or neovim
procps
killall
diffutils
findutils
utillinux
tzdata
hostname
man
gnugrep
gnupg
gnused
gnutar
bzip2
gzip
xz
zip
unzip
zsh
ncurses5
];
# Backup etc files instead of failing to activate generation if a file already exists in /etc
environment.etcBackupExtension = ".bak";
# Read the changelog before changing this value
system.stateVersion = "24.05";
user.shell = "${pkgs.zsh}/bin/zsh";
# Set up nix for flakes
#nix.extraOptions = ''
# experimental-features = nix-command flakes
#'';
# Set your time zone
time.timeZone = "Asia/Shanghai";
# After installing home-manager channel like
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager
# nix-channel --update
# you can configure home-manager in here like
home-manager = {
useGlobalPkgs = true;
config = ./home.nix;
};
}
# vim: ft=nix