Add bin scripts
This commit is contained in:
parent
45273bc77f
commit
6558b597db
4 changed files with 25 additions and 2 deletions
12
bins/default.nix
Normal file
12
bins/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
user-bin-directory = "${config.home.homeDirectory}/.bin";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home.file."${user-bin-directory}" = {
|
||||||
|
source = ./scripts;
|
||||||
|
recursive = true;
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
|
}
|
8
bins/scripts/calculate-nix-path
Executable file
8
bins/scripts/calculate-nix-path
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p "$HOME/.cache/fish"
|
||||||
|
|
||||||
|
nix flake metadata "$HOME/.config/nixpkgs" --json 2>/dev/null | \
|
||||||
|
jq -r '.locks.nodes.nixpkgs.locked | "\(.type):\(.owner)/\(.repo)/\(.rev)"' | \
|
||||||
|
xargs -I {} nix flake metadata {} --json | \
|
||||||
|
jq -r '. | "nixpkgs=\(.path)"' >"$HOME/.cache/fish/nix_path_value"
|
3
home.nix
3
home.nix
|
@ -16,6 +16,8 @@
|
||||||
./programs/jq.nix
|
./programs/jq.nix
|
||||||
|
|
||||||
./config/yt-dlp.nix
|
./config/yt-dlp.nix
|
||||||
|
|
||||||
|
./bins
|
||||||
];
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
|
@ -40,6 +42,7 @@
|
||||||
qemu
|
qemu
|
||||||
ripgrep
|
ripgrep
|
||||||
rtmpdump
|
rtmpdump
|
||||||
|
streamlink
|
||||||
tokei
|
tokei
|
||||||
wget
|
wget
|
||||||
xz
|
xz
|
||||||
|
|
|
@ -78,8 +78,8 @@
|
||||||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -d "$HOME/bin"
|
if test -d "$HOME/.bin"
|
||||||
set -gx PATH "$HOME/bin" $PATH
|
set -gx PATH "$HOME/.bin" $PATH
|
||||||
end
|
end
|
||||||
|
|
||||||
for app_path in \
|
for app_path in \
|
||||||
|
|
Loading…
Reference in a new issue