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
|
||||
|
||||
./config/yt-dlp.nix
|
||||
|
||||
./bins
|
||||
];
|
||||
|
||||
home = {
|
||||
|
@ -40,6 +42,7 @@
|
|||
qemu
|
||||
ripgrep
|
||||
rtmpdump
|
||||
streamlink
|
||||
tokei
|
||||
wget
|
||||
xz
|
||||
|
|
|
@ -78,8 +78,8 @@
|
|||
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
end
|
||||
|
||||
if test -d "$HOME/bin"
|
||||
set -gx PATH "$HOME/bin" $PATH
|
||||
if test -d "$HOME/.bin"
|
||||
set -gx PATH "$HOME/.bin" $PATH
|
||||
end
|
||||
|
||||
for app_path in \
|
||||
|
|
Loading…
Reference in a new issue