-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdefault.nix
More file actions
65 lines (56 loc) · 1.28 KB
/
default.nix
File metadata and controls
65 lines (56 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
let
pkgs = import
(builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/24.05.tar.gz";
sha256 = "1lr1h35prqkd1mkmzriwlpvxcb34kmhc9dnr48gkm8hh089hifmx";
})
{ config.allowUnfree = true; };
repo_dir = "~/code/github.com/glynnforrest/dotfiles";
wrapBin = bin: pkgs.writeShellScriptBin "${bin}" ''
PATH=${repo_dir}/result/bin:/usr/local/bin:/usr/bin:/bin
${repo_dir}/bin/${bin} $@
'';
bins = builtins.readDir ./bin;
files = builtins.filter (f: bins.${f} == "regular") (builtins.attrNames bins);
wrappers = map wrapBin files;
python = (pkgs.python311.withPackages (ps: [
ps.black
ps.click
ps.flake8
ps.requests
]));
z = pkgs.stdenv.mkDerivation rec {
pname = "z";
version = "1.2";
src = pkgs.fetchurl {
url = "https://github.com/rupa/z/raw/refs/tags/v${version}/z.sh";
hash = "sha256-v7UXX0ifFMnNKmXuc3N4HdcbyYaGQYuQxVABFaqLL5k=";
postFetch = ''
mv $downloadedFile $out
'';
};
dontUnpack = true;
installPhase = ''
mkdir -p $out/lib
cp $src $out/lib/z.sh
'';
};
in
pkgs.buildEnv {
name = "dotfiles";
paths = with pkgs; [
gron
htop
jq
nmap
nodejs
php
python
ripgrep
svgcleaner
tldr
yq-go
z
zig
] ++ wrappers;
}