Home : Refactor.

This commit is contained in:
Dmitry Voronin 2024-04-14 23:48:14 +03:00 committed by Dmitry Voronin
parent 66882a8820
commit 56e3f9ec6c
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 98 additions and 82 deletions

View file

@ -1,10 +1,10 @@
{ pkgs, inputs, const, style, util, key, setting, ... } @args: let
{ pkgs, inputs, const, style, util, key, setting, secret, ... } @args: let
homePath = "/data/data/com.termux.nix/files/home";
tmux = import ./common/tmux/Init.nix args;
tmux = import ./common/tmux args;
tmuxScript = pkgs.writeShellScriptBin "tmux_script" tmux.script;
bash = import ./common/bash/Init.nix args;
nvim = import ./common/nvim/Init.nix args;
ssh = import ./common/ssh/Init.nix args;
bash = import ./common/bash args;
nvim = import ./common/nvim args;
ssh = import ./common/ssh args;
font = pkgs.runCommandNoCC "font" {} ''
cp ${pkgs.nerdfonts.override { fonts = [ "Terminus" ]; }}/share/fonts/truetype/NerdFonts/TerminessNerdFontMono-Regular.ttf $out
'';
@ -60,21 +60,25 @@ in {
'';
home-manager.config = {
home.stateVersion = const.droidStateVersion;
home.file = {
home = {
stateVersion = const.droidStateVersion;
file = {
".dotfiles".source = inputs.self;
".ssh/config".text = ssh.config;
".termux/_font.ttf".source = font;
".termux/_colors.properties".text = colors;
};
home.sessionVariables = {
sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
NIXPKGS_ALLOW_UNFREE = "1";
NIX_CURRENT_SYSTEM = "${pkgs.stdenv.system}";
TERM = "xterm-256color";
};
programs.bash = {
};
programs = {
bash = {
enable = true;
bashrcExtra = bash.config + ''
[[ -f ~/.termux/font.ttf ]] || {
@ -84,11 +88,13 @@ in {
};
'';
};
programs.tmux = {
tmux = {
enable = true;
extraConfig = tmux.config;
};
programs.git = {
git = {
enable = true;
extraConfig = {
credential.helper = "store";
@ -98,11 +104,18 @@ in {
rebase.autoStash = true;
};
};
programs.neovim = {
neovim = {
enable = true;
viAlias = true;
vimAlias = true;
extraConfig = nvim.config;
};
gpg = {
enable = true;
publicKeys = secret.crypto.publicKeys;
};
};
};
}

View file

@ -5,15 +5,15 @@
btop = import ./top/btop args;
htop = import ./top/htop args;
in {
home-manager.backupFileExtension = "old";
home-manager = {
backupFileExtension = "old";
home-manager.users.${username} = {
programs.home-manager.enable = true;
home.username = username;
home.homeDirectory = homeDir;
home.stateVersion = const.stateVersion;
home.file = {
users.${username} = {
home = {
username = username;
homeDirectory = homeDir;
stateVersion = const.stateVersion;
file = {
".config/btop/btop.conf".text = btop.config;
".config/htop/htoprc".text = htop.config;
".config/mako/config".text = mako.config;
@ -22,8 +22,8 @@ in {
".parallel/will-cite".text = "";
"media/template".source = ./template;
};
};
# Directories.
xdg.userDirs = {
enable = true;
createDirectories = true;
@ -40,11 +40,14 @@ in {
};
};
# GPG.
programs.gpg = {
programs = {
home-manager.enable = true;
gpg = {
enable = true;
publicKeys = secret.crypto.publicKeys;
};
};
};
};
}