-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use absolute Nix paths in homemade scripts (#252)
* Use absolute Nix paths in homemade scripts * Make executable again * Suppress noisy logging since used fullpath * Hide conflicting fish provided la * Add link to referenced source
- Loading branch information
Showing
7 changed files
with
88 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ pkgs, lib, ... }: | ||
|
||
# FAQ | ||
# | ||
# A. How to make executable? .text= makes syms, that links to non executable file | ||
# Q. https://github.com/nix-community/home-manager/blob/15043a65915bcc16ad207d65b202659e4988066b/modules/xsession.nix#L195C1-L197 | ||
|
||
# - Tiny tools by me, they may be rewritten with another language. | ||
{ | ||
# - Keep *.bash in shellscript naming in this repo for maintainability, the extname should be trimmed in the symlinks | ||
xdg.dataFile."homemade/bin/add_nix_channels".source = ../home/.local/share/homemade/bin/add_nix_channels.bash; | ||
|
||
xdg.dataFile."homemade/bin/bench_shells" = { | ||
executable = true; | ||
text = '' | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
# ~ my feeling ~ | ||
# 50ms : blazing fast! | ||
# 110ms : acceptable | ||
# 150ms : slow | ||
# 200ms : 1980s? | ||
# 300ms : much slow! | ||
# zsh should be first, because it often makes much slower with the completion | ||
${lib.getExe pkgs.hyperfine} --warmup 1 '${lib.getExe pkgs.zsh} --interactive -c exit' | ||
${lib.getExe pkgs.hyperfine} --warmup 1 '${lib.getExe pkgs.bashInteractive} -i -c exit' | ||
${lib.getExe pkgs.hyperfine} --warmup 1 '${lib.getExe pkgs.fish} --interactive --command exit' | ||
''; | ||
}; | ||
|
||
xdg.dataFile."homemade/bin/updeps" = { | ||
executable = true; | ||
text = '' | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
case ''${OSTYPE} in | ||
linux*) | ||
sudo apt update --yes && sudo apt upgrade --yes | ||
;; | ||
darwin*) | ||
softwareupdate --install --recommended | ||
;; | ||
esac | ||
nix-channel --update | ||
${lib.getExe pkgs.rtx} plugins update | ||
''; | ||
}; | ||
|
||
xdg.dataFile."homemade/bin/la" = { | ||
executable = true; | ||
text = '' | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
${lib.getExe pkgs.exa} --long --all --group-directories-first "$@" | ||
''; | ||
}; | ||
|
||
xdg.dataFile."homemade/bin/zj" = { | ||
executable = true; | ||
text = '' | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
name="$(${lib.getBin pkgs.coreutils}/bin/basename "$PWD")" | ||
${lib.getExe pkgs.zellij} attach "$name" || ${lib.getExe pkgs.zellij} --session "$name" | ||
''; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.