remake dir structure for home-manager
This commit is contained in:
parent
9415d40508
commit
3151b79560
26 changed files with 9 additions and 9 deletions
17
home/features/cli/default.nix
Normal file
17
home/features/cli/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Configures programs that primarily run via the command line
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./fish.nix # fish shell configuration
|
||||
./neovim.nix # neovim configuration, my "escape" editor
|
||||
./lazygit.nix # my preferred git porcellain
|
||||
./direnv.nix # smart cding
|
||||
./mise.nix # version management for tools
|
||||
];
|
||||
|
||||
# stuff that doesn't fit into any other files
|
||||
home.packages = with pkgs; [
|
||||
comma # nix-shell a package by prefixing it with `,`
|
||||
ripgrep # well, it's grep
|
||||
];
|
||||
}
|
7
home/features/cli/direnv.nix
Normal file
7
home/features/cli/direnv.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
144
home/features/cli/fish.nix
Normal file
144
home/features/cli/fish.nix
Normal file
|
@ -0,0 +1,144 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
functions = {
|
||||
setpath = "test -e $argv[1]; and fish_add_path $argv[1]";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
if test -z "$XDG_RUNTIME_DIR"
|
||||
set -x XDG_RUNTIME_DIR "/tmp/$USER-runtime-dir"
|
||||
if test ! -e "$XDG_RUNTIME_DIR"
|
||||
mkdir "$XDG_RUNTIME_DIR"
|
||||
chmod 0700 "$XDG_RUNTIME_DIR"
|
||||
end
|
||||
end
|
||||
|
||||
setpath /opt/local/bin
|
||||
setpath /opt/homebrew/bin
|
||||
setpath ~/.cargo/bin
|
||||
setpath ~/.ghcup/bin
|
||||
setpath ~/.cabal/bin
|
||||
setpath ~/.local/bin
|
||||
setpath ~/.bun/bin
|
||||
setpath ~/Projects/Checkouts/arcanist/bin
|
||||
|
||||
set -x EDITOR nvim
|
||||
set -x USER lu
|
||||
set -x SHELL (which fish)
|
||||
set -x TERM xterm-256color
|
||||
set -x LANG en_US.UTF-8
|
||||
set -x LC_ALL en_US.UTF-8
|
||||
set -x LC_CTYPE en_US.UTF-8
|
||||
set -x LANGUAGE en_US.UTF-8
|
||||
'';
|
||||
|
||||
shellAbbrs = {
|
||||
# General aliases
|
||||
c = "clear";
|
||||
ll = "ls -lahF --color=always";
|
||||
e = "$EDITOR";
|
||||
se = "sudoedit";
|
||||
"cd.." = "cd ../";
|
||||
rmrf = "rm -rf";
|
||||
|
||||
# overrides of defaults
|
||||
mkdir = "mkdir -p";
|
||||
cp = "cp -r";
|
||||
scp = "scp -r";
|
||||
apt = "sudo apt";
|
||||
doc = "sudo docker";
|
||||
docker = "sudo docker";
|
||||
sctl = "sudo systemctl";
|
||||
usctl = "systemctl --user";
|
||||
doco = "sudo docker-compose";
|
||||
|
||||
# z is a weird key to hit frequently, j is much better
|
||||
j = "z";
|
||||
|
||||
# cargoes and rust-s
|
||||
cg = "cargo";
|
||||
cr = "cargo run";
|
||||
cb = "cargo build";
|
||||
ct = "cargo test";
|
||||
cwr = "cargo watch -x run";
|
||||
|
||||
# rubies
|
||||
be = "bundle exec";
|
||||
|
||||
# cd into a temp directory, very useful!
|
||||
mkt = "cd (mktemp -d)";
|
||||
|
||||
# tmux aliases
|
||||
tx = "tmux";
|
||||
txls = "tmux list-sessions";
|
||||
txa = "tmux attach";
|
||||
|
||||
# git aliases
|
||||
lg = "lazygit";
|
||||
g = "git";
|
||||
ga = "git add";
|
||||
gs = "git status --short";
|
||||
gl = "git log --color --graph --abbrev-commit --oneline";
|
||||
gqp = "git add --all; and git commit; and git push";
|
||||
gqc = "git add --all; and git commit";
|
||||
gpl = "git pull";
|
||||
gps = "git push";
|
||||
gc = "git commit";
|
||||
gb = "git branch";
|
||||
gaa = "git add --all";
|
||||
gco = "git checkout";
|
||||
editorigin = "git remote set-url origin";
|
||||
|
||||
# nix aliases
|
||||
n = "nix";
|
||||
nd = "nix develop";
|
||||
ns = "nix shell";
|
||||
np = "nix profile";
|
||||
ngc = "nix-collect-garbage";
|
||||
hm = "home-manager";
|
||||
hmreload = "cd ~/nix-config && home-manager switch --flake .#(whoami)@(hostname) && cd -";
|
||||
hminplace = "home-manager switch --flake .#(whoami)@(hostname)";
|
||||
nmreload = "cd ~/nix-config && sudo nixos-rebuild switch --flake .";
|
||||
nminplace = "sudo nixos-rebuild switch --flake .";
|
||||
};
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "done";
|
||||
src = pkgs.fishPlugins.done.src;
|
||||
}
|
||||
{
|
||||
name = "pisces";
|
||||
src = pkgs.fishPlugins.pisces.src;
|
||||
}
|
||||
{
|
||||
name = "plugin-foreign-env";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-foreign-env";
|
||||
rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7";
|
||||
sha256 = "0d16mdgjdwln41zk44qa5vcilmlia4w15r8z2rc3p49i5ankksg3";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
settings = {
|
||||
character = {
|
||||
success_symbol = "[~](green)";
|
||||
error_symbol = "[~](red)";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
}
|
4
home/features/cli/lazygit.nix
Normal file
4
home/features/cli/lazygit.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.lazygit.enable = true;
|
||||
}
|
16
home/features/cli/mise.nix
Normal file
16
home/features/cli/mise.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
python3 # needed for installing node.js
|
||||
];
|
||||
programs.mise = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
|
||||
globalConfig = {
|
||||
tools = {
|
||||
node = "lts";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
25
home/features/cli/neovim.nix
Normal file
25
home/features/cli/neovim.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
# LazyVim
|
||||
lua-language-server
|
||||
stylua
|
||||
# Telescope
|
||||
ripgrep
|
||||
];
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
lazy-nvim
|
||||
];
|
||||
};
|
||||
|
||||
home.sessionVariables.EDITOR = "nvim";
|
||||
|
||||
xdg.configFile."nvim/init.lua".source = ../../../dotfiles/nvim/init.lua;
|
||||
xdg.configFile."nvim/stylua.toml".source = ../../../dotfiles/nvim/stylua.toml;
|
||||
xdg.configFile."nvim/.neoconf.json".source = ../../../dotfiles/nvim/.neoconf.json;
|
||||
xdg.configFile."nvim/lua".source = ../../../dotfiles/nvim/lua;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue