Skip to content

Commit

Permalink
feature: nh, fish, zoxide
Browse files Browse the repository at this point in the history
  • Loading branch information
erictossell committed Apr 27, 2024
1 parent 5f175e2 commit ef180d1
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 23 deletions.
3 changes: 2 additions & 1 deletion modules/core/nix/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
home-manager,
pkgs,
username,
...
}:
{
imports = [ ./nh ];

# https://github.com/lovesegfault/nix-config/blob/e412cd01cda084c7e3f5c1fbcf7d99665999949e/core/nixos.nix#L39
system = {
extraSystemBuilderCmds = ''
Expand Down
10 changes: 10 additions & 0 deletions modules/core/nix/nh/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ username, ... }:
{
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3";
flake = "/home/${username}/repos/nix/nixflakes";

};
}
9 changes: 1 addition & 8 deletions modules/core/terminal/bash/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
pkgs,
home-manager,
username,
...
}:
{
# Shell Aliases inspired by:
# https://github.com/donovanglover/nix-config
Expand All @@ -16,6 +10,7 @@
cp = "cp -ia";
ls = "ls -la";
mv = "mv -i";
z = "zoxide";

b = "btop";
c = "clear";
Expand Down Expand Up @@ -97,8 +92,6 @@
crmd = "cargo remove --dev";
cc = "cargo clippy";
cf = "cargo fmt";

py = "${pkgs.python312}/bin/python3";
};
};
}
2 changes: 0 additions & 2 deletions modules/core/terminal/cava/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
pkgs,
home-manager,
username,
...
}:
{
Expand Down
2 changes: 1 addition & 1 deletion modules/core/terminal/cava/dots/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ home-manager, username, ... }:
{ username, ... }:
{
home-manager.users.${username} = _: {
home.file = {
Expand Down
6 changes: 2 additions & 4 deletions modules/core/terminal/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
pkgs,
home-manager,
username,
...
}:
{
imports = [
./bash
./cava
./fish
./fonts
./foot
./nvim
Expand All @@ -18,7 +17,6 @@
# ---- Home Configuration ----
home-manager.users.${username} = {
programs.git.enable = true;
programs.vim.enable = true;
};

# ---- System Configuration ----
Expand All @@ -38,6 +36,6 @@
ripgrep
todoist
unzip
wget
zoxide
];
}
97 changes: 97 additions & 0 deletions modules/core/terminal/fish/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{ pkgs, ... }:
{
# Shell Aliases inspired by:
# https://github.com/donovanglover/nix-config
# ---- System Configuration ----
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting
nitch
${pkgs.zoxide}/bin/zoxide init fish | source
'';
shellAliases = {

b = "btop";
c = "clear";
e = "exit";

g = "git";
ga = "git add";
gaa = "git add --all";
gap = "git add --patch";
gapp = "git apply";
gb = "git branch --verbose";
gbr = "git branch --verbose --remotes";
gbd = "git branch --delete";
gbD = "git branch --delete --force";
gc = "git commit -m";
gca = "git commit --amend";
gcl = "git clone";
gco = "git checkout";
gcot = "git checkout --theirs";
gcp = "git cherry-pick --strategy-option theirs";
gcpx = "git cherry-pick --strategy-option theirs -x";
gd = "git diff";
gds = "git diff --staged";
gf = "git fetch";
gi = "git init";
gl = "git log --oneline --decorate --graph -n 10";
gm = "git merge";
gp = "git push";
gpu = "git pull";
gr = "git reset HEAD~";
gR = "git restore";
gRs = "git restore --staged";
gra = "git remote add";
gre = "git remote --verbose";
grh = "git reset HEAD";
grr = "git reset --hard HEAD~";
grb = "git rebase --interactive";
grbc = "git rebase --continue";
gs = "git status";
gsma = "git submodule add";
gsmu = "git submodule update --init --remote --recursive";
gst = "git stash";
gstp = "git stash pop";
gsw = "git switch";
gt = "git tag";
gts = "git tag -s";

gor = "go run .";
gob = "go build .";

n = "nvim";
t = "tmux";
r = "ranger";

nf = "nix flake";
nfu = "nix flake update";
nfc = "nix flake check";
nd = "nix develop";
nb = "nix build";
ns = "nix shell";
nr = "nix run";
ncg = "sudo nix-collect-garbage -d";
sw = "sudo nixos-rebuild switch --flake .";
vm = "nixos-rebuild build-vm --flake . && ./result/bin/run-nixos-vm && trash put result nixos.qcow2";

ci = "cargo init";
cin = "cargo info";
cu = "cargo update";
ca = "cargo add";
cab = "cargo add --build";
cad = "cargo add --dev";
cb = "cargo build";
cr = "cargo run";
cs = "cargo search";
ct = "cargo tree --depth 1";
cn = "cargo new";
crm = "cargo remove";
crmb = "cargo remove --build";
crmd = "cargo remove --dev";
cc = "cargo clippy";
cf = "cargo fmt";
};
};
}
6 changes: 0 additions & 6 deletions modules/core/terminal/starship/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
pkgs,
home-manager,
username,
...
}:
{
programs.starship = {
enable = true;
Expand Down
2 changes: 1 addition & 1 deletion users/eriim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.${username} = {
shell = pkgs.bash;
shell = pkgs.fish;
isNormalUser = true;
initialPassword = "temp123";
extraGroups = [
Expand Down

0 comments on commit ef180d1

Please sign in to comment.