diff --git a/.direnv/bin/nix-direnv-reload b/.direnv/bin/nix-direnv-reload new file mode 100755 index 0000000..ee4770f --- /dev/null +++ b/.direnv/bin/nix-direnv-reload @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e +if [[ ! -d "/home/tim/.dotfiles" ]]; then + echo "Cannot find source directory; Did you move it?" + echo "(Looking for "/home/tim/.dotfiles")" + echo 'Cannot force reload with this script - use "direnv reload" manually and then try again' + exit 1 +fi + +# rebuild the cache forcefully +_nix_direnv_force_reload=1 direnv exec "/home/tim/.dotfiles" true + +# Update the mtime for .envrc. +# This will cause direnv to reload again - but without re-building. +touch "/home/tim/.dotfiles/.envrc" + +# Also update the timestamp of whatever profile_rc we have. +# This makes sure that we know we are up to date. +touch -r "/home/tim/.dotfiles/.envrc" "/home/tim/.dotfiles/.direnv"/*.rc diff --git a/.direnv/flake-inputs/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source b/.direnv/flake-inputs/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source new file mode 120000 index 0000000..f7fce9f --- /dev/null +++ b/.direnv/flake-inputs/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source @@ -0,0 +1 @@ +/nix/store/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source \ No newline at end of file diff --git a/.direnv/flake-inputs/025da0v2wdyfk9vbgrwhmvbqzl022vad-source b/.direnv/flake-inputs/025da0v2wdyfk9vbgrwhmvbqzl022vad-source new file mode 120000 index 0000000..b3d355e --- /dev/null +++ b/.direnv/flake-inputs/025da0v2wdyfk9vbgrwhmvbqzl022vad-source @@ -0,0 +1 @@ +/nix/store/025da0v2wdyfk9vbgrwhmvbqzl022vad-source \ No newline at end of file diff --git a/.direnv/flake-inputs/1wnxdqr2n1pj80lirh9pzsymslx8zd9l-source b/.direnv/flake-inputs/1wnxdqr2n1pj80lirh9pzsymslx8zd9l-source new file mode 120000 index 0000000..cbef3fe --- /dev/null +++ b/.direnv/flake-inputs/1wnxdqr2n1pj80lirh9pzsymslx8zd9l-source @@ -0,0 +1 @@ +/nix/store/1wnxdqr2n1pj80lirh9pzsymslx8zd9l-source \ No newline at end of file diff --git a/.direnv/flake-inputs/1yyzg5ylalfv4xzbly9fzzxicm4yhpkl-source b/.direnv/flake-inputs/1yyzg5ylalfv4xzbly9fzzxicm4yhpkl-source new file mode 120000 index 0000000..40cb115 --- /dev/null +++ b/.direnv/flake-inputs/1yyzg5ylalfv4xzbly9fzzxicm4yhpkl-source @@ -0,0 +1 @@ +/nix/store/1yyzg5ylalfv4xzbly9fzzxicm4yhpkl-source \ No newline at end of file diff --git a/.direnv/flake-inputs/3ghqsn3rjdq23nb9hn9flsmgipj0q72r-source b/.direnv/flake-inputs/3ghqsn3rjdq23nb9hn9flsmgipj0q72r-source new file mode 120000 index 0000000..9e533e9 --- /dev/null +++ b/.direnv/flake-inputs/3ghqsn3rjdq23nb9hn9flsmgipj0q72r-source @@ -0,0 +1 @@ +/nix/store/3ghqsn3rjdq23nb9hn9flsmgipj0q72r-source \ No newline at end of file diff --git a/.direnv/flake-inputs/41v50c27snarkdqx6bbf8dg51j422faa-source b/.direnv/flake-inputs/41v50c27snarkdqx6bbf8dg51j422faa-source new file mode 120000 index 0000000..0163941 --- /dev/null +++ b/.direnv/flake-inputs/41v50c27snarkdqx6bbf8dg51j422faa-source @@ -0,0 +1 @@ +/nix/store/41v50c27snarkdqx6bbf8dg51j422faa-source \ No newline at end of file diff --git a/.direnv/flake-inputs/4g7wzh5nfzvms5zx8hscb6xkh3m6bidn-source b/.direnv/flake-inputs/4g7wzh5nfzvms5zx8hscb6xkh3m6bidn-source new file mode 120000 index 0000000..37b8bee --- /dev/null +++ b/.direnv/flake-inputs/4g7wzh5nfzvms5zx8hscb6xkh3m6bidn-source @@ -0,0 +1 @@ +/nix/store/4g7wzh5nfzvms5zx8hscb6xkh3m6bidn-source \ No newline at end of file diff --git a/.direnv/flake-inputs/56grza1ymqf012b1c34w5rw2hakimhi3-source b/.direnv/flake-inputs/56grza1ymqf012b1c34w5rw2hakimhi3-source new file mode 120000 index 0000000..b99efa0 --- /dev/null +++ b/.direnv/flake-inputs/56grza1ymqf012b1c34w5rw2hakimhi3-source @@ -0,0 +1 @@ +/nix/store/56grza1ymqf012b1c34w5rw2hakimhi3-source \ No newline at end of file diff --git a/.direnv/flake-inputs/5c108l3npg1bllinhs1pd9rdxmzff2c3-source b/.direnv/flake-inputs/5c108l3npg1bllinhs1pd9rdxmzff2c3-source new file mode 120000 index 0000000..67af112 --- /dev/null +++ b/.direnv/flake-inputs/5c108l3npg1bllinhs1pd9rdxmzff2c3-source @@ -0,0 +1 @@ +/nix/store/5c108l3npg1bllinhs1pd9rdxmzff2c3-source \ No newline at end of file diff --git a/.direnv/flake-inputs/5gm805h91im063x5wbs200chgghdcrkk-source b/.direnv/flake-inputs/5gm805h91im063x5wbs200chgghdcrkk-source new file mode 120000 index 0000000..ab1f46b --- /dev/null +++ b/.direnv/flake-inputs/5gm805h91im063x5wbs200chgghdcrkk-source @@ -0,0 +1 @@ +/nix/store/5gm805h91im063x5wbs200chgghdcrkk-source \ No newline at end of file diff --git a/.direnv/flake-inputs/5vdba5pn48dsc9i1hwrfzkv1hrz8i9qf-source b/.direnv/flake-inputs/5vdba5pn48dsc9i1hwrfzkv1hrz8i9qf-source new file mode 120000 index 0000000..d5e384c --- /dev/null +++ b/.direnv/flake-inputs/5vdba5pn48dsc9i1hwrfzkv1hrz8i9qf-source @@ -0,0 +1 @@ +/nix/store/5vdba5pn48dsc9i1hwrfzkv1hrz8i9qf-source \ No newline at end of file diff --git a/.direnv/flake-inputs/8s0yr4cx4f8hyb4hj1z4078ix2672nsg-source b/.direnv/flake-inputs/8s0yr4cx4f8hyb4hj1z4078ix2672nsg-source new file mode 120000 index 0000000..3fc5f50 --- /dev/null +++ b/.direnv/flake-inputs/8s0yr4cx4f8hyb4hj1z4078ix2672nsg-source @@ -0,0 +1 @@ +/nix/store/8s0yr4cx4f8hyb4hj1z4078ix2672nsg-source \ No newline at end of file diff --git a/.direnv/flake-inputs/9rksa0yx25gg28hkx31fhbng6fmalijd-source b/.direnv/flake-inputs/9rksa0yx25gg28hkx31fhbng6fmalijd-source new file mode 120000 index 0000000..af65f66 --- /dev/null +++ b/.direnv/flake-inputs/9rksa0yx25gg28hkx31fhbng6fmalijd-source @@ -0,0 +1 @@ +/nix/store/9rksa0yx25gg28hkx31fhbng6fmalijd-source \ No newline at end of file diff --git a/.direnv/flake-inputs/annhr7vnqxnph0bvkhii0wz55kriddai-source b/.direnv/flake-inputs/annhr7vnqxnph0bvkhii0wz55kriddai-source new file mode 120000 index 0000000..783f728 --- /dev/null +++ b/.direnv/flake-inputs/annhr7vnqxnph0bvkhii0wz55kriddai-source @@ -0,0 +1 @@ +/nix/store/annhr7vnqxnph0bvkhii0wz55kriddai-source \ No newline at end of file diff --git a/.direnv/flake-inputs/b0my5vy8pzfzjqrr3g58j0w6md9jf3ch-source b/.direnv/flake-inputs/b0my5vy8pzfzjqrr3g58j0w6md9jf3ch-source new file mode 120000 index 0000000..6e52b23 --- /dev/null +++ b/.direnv/flake-inputs/b0my5vy8pzfzjqrr3g58j0w6md9jf3ch-source @@ -0,0 +1 @@ +/nix/store/b0my5vy8pzfzjqrr3g58j0w6md9jf3ch-source \ No newline at end of file diff --git a/.direnv/flake-inputs/b9vv0nv4m65f1a4ncakqpfh7qlkf9jz7-source b/.direnv/flake-inputs/b9vv0nv4m65f1a4ncakqpfh7qlkf9jz7-source new file mode 120000 index 0000000..f8459b9 --- /dev/null +++ b/.direnv/flake-inputs/b9vv0nv4m65f1a4ncakqpfh7qlkf9jz7-source @@ -0,0 +1 @@ +/nix/store/b9vv0nv4m65f1a4ncakqpfh7qlkf9jz7-source \ No newline at end of file diff --git a/.direnv/flake-inputs/bl723qgsd7jqh3crigpvsq0mzrjj7vj2-source b/.direnv/flake-inputs/bl723qgsd7jqh3crigpvsq0mzrjj7vj2-source new file mode 120000 index 0000000..47c523c --- /dev/null +++ b/.direnv/flake-inputs/bl723qgsd7jqh3crigpvsq0mzrjj7vj2-source @@ -0,0 +1 @@ +/nix/store/bl723qgsd7jqh3crigpvsq0mzrjj7vj2-source \ No newline at end of file diff --git a/.direnv/flake-inputs/clnc7s9650iy97r85ci84m4cdq8gpqbr-source b/.direnv/flake-inputs/clnc7s9650iy97r85ci84m4cdq8gpqbr-source new file mode 120000 index 0000000..3f73540 --- /dev/null +++ b/.direnv/flake-inputs/clnc7s9650iy97r85ci84m4cdq8gpqbr-source @@ -0,0 +1 @@ +/nix/store/clnc7s9650iy97r85ci84m4cdq8gpqbr-source \ No newline at end of file diff --git a/.direnv/flake-inputs/ddkd82p67kqrizn84sr3xcpljl94rbay-source b/.direnv/flake-inputs/ddkd82p67kqrizn84sr3xcpljl94rbay-source new file mode 120000 index 0000000..f8948d3 --- /dev/null +++ b/.direnv/flake-inputs/ddkd82p67kqrizn84sr3xcpljl94rbay-source @@ -0,0 +1 @@ +/nix/store/ddkd82p67kqrizn84sr3xcpljl94rbay-source \ No newline at end of file diff --git a/.direnv/flake-inputs/f1zqan24k1x874c5z38zs44z4f1kvhd2-source b/.direnv/flake-inputs/f1zqan24k1x874c5z38zs44z4f1kvhd2-source new file mode 120000 index 0000000..a638d52 --- /dev/null +++ b/.direnv/flake-inputs/f1zqan24k1x874c5z38zs44z4f1kvhd2-source @@ -0,0 +1 @@ +/nix/store/f1zqan24k1x874c5z38zs44z4f1kvhd2-source \ No newline at end of file diff --git a/.direnv/flake-inputs/g5v3sgqy6a0fsmas7mnapc196flrplix-source b/.direnv/flake-inputs/g5v3sgqy6a0fsmas7mnapc196flrplix-source new file mode 120000 index 0000000..c425a39 --- /dev/null +++ b/.direnv/flake-inputs/g5v3sgqy6a0fsmas7mnapc196flrplix-source @@ -0,0 +1 @@ +/nix/store/g5v3sgqy6a0fsmas7mnapc196flrplix-source \ No newline at end of file diff --git a/.direnv/flake-inputs/gs1d4570bffhpg2704yb26p49fzgg343-source b/.direnv/flake-inputs/gs1d4570bffhpg2704yb26p49fzgg343-source new file mode 120000 index 0000000..97bbcd0 --- /dev/null +++ b/.direnv/flake-inputs/gs1d4570bffhpg2704yb26p49fzgg343-source @@ -0,0 +1 @@ +/nix/store/gs1d4570bffhpg2704yb26p49fzgg343-source \ No newline at end of file diff --git a/.direnv/flake-inputs/i4vvs3jynf1q8gbjn9znmfclr0z5d1gz-source b/.direnv/flake-inputs/i4vvs3jynf1q8gbjn9znmfclr0z5d1gz-source new file mode 120000 index 0000000..4893767 --- /dev/null +++ b/.direnv/flake-inputs/i4vvs3jynf1q8gbjn9znmfclr0z5d1gz-source @@ -0,0 +1 @@ +/nix/store/i4vvs3jynf1q8gbjn9znmfclr0z5d1gz-source \ No newline at end of file diff --git a/.direnv/flake-inputs/idq4fdi37mfvm54nlvfgrd3gjxf22lwr-source b/.direnv/flake-inputs/idq4fdi37mfvm54nlvfgrd3gjxf22lwr-source new file mode 120000 index 0000000..e359a77 --- /dev/null +++ b/.direnv/flake-inputs/idq4fdi37mfvm54nlvfgrd3gjxf22lwr-source @@ -0,0 +1 @@ +/nix/store/idq4fdi37mfvm54nlvfgrd3gjxf22lwr-source \ No newline at end of file diff --git a/.direnv/flake-inputs/iiiq8zn29mz0yd8lllpnimn1dpm3ydn5-source b/.direnv/flake-inputs/iiiq8zn29mz0yd8lllpnimn1dpm3ydn5-source new file mode 120000 index 0000000..73bd815 --- /dev/null +++ b/.direnv/flake-inputs/iiiq8zn29mz0yd8lllpnimn1dpm3ydn5-source @@ -0,0 +1 @@ +/nix/store/iiiq8zn29mz0yd8lllpnimn1dpm3ydn5-source \ No newline at end of file diff --git a/.direnv/flake-inputs/jqhdk959y3z5xx7crw6s8n030s1q0pk5-source b/.direnv/flake-inputs/jqhdk959y3z5xx7crw6s8n030s1q0pk5-source new file mode 120000 index 0000000..0306080 --- /dev/null +++ b/.direnv/flake-inputs/jqhdk959y3z5xx7crw6s8n030s1q0pk5-source @@ -0,0 +1 @@ +/nix/store/jqhdk959y3z5xx7crw6s8n030s1q0pk5-source \ No newline at end of file diff --git a/.direnv/flake-inputs/ka839ivm6bhhwwfq7sf1d9abwc462dqq-source b/.direnv/flake-inputs/ka839ivm6bhhwwfq7sf1d9abwc462dqq-source new file mode 120000 index 0000000..5317da2 --- /dev/null +++ b/.direnv/flake-inputs/ka839ivm6bhhwwfq7sf1d9abwc462dqq-source @@ -0,0 +1 @@ +/nix/store/ka839ivm6bhhwwfq7sf1d9abwc462dqq-source \ No newline at end of file diff --git a/.direnv/flake-inputs/kbjvsxnz3w9j29m2lmxv6psbcgn4mkdr-source b/.direnv/flake-inputs/kbjvsxnz3w9j29m2lmxv6psbcgn4mkdr-source new file mode 120000 index 0000000..44484b7 --- /dev/null +++ b/.direnv/flake-inputs/kbjvsxnz3w9j29m2lmxv6psbcgn4mkdr-source @@ -0,0 +1 @@ +/nix/store/kbjvsxnz3w9j29m2lmxv6psbcgn4mkdr-source \ No newline at end of file diff --git a/.direnv/flake-inputs/m3ry7cqnzjydldmi7whmifi2v0bc8i6x-source b/.direnv/flake-inputs/m3ry7cqnzjydldmi7whmifi2v0bc8i6x-source new file mode 120000 index 0000000..9534917 --- /dev/null +++ b/.direnv/flake-inputs/m3ry7cqnzjydldmi7whmifi2v0bc8i6x-source @@ -0,0 +1 @@ +/nix/store/m3ry7cqnzjydldmi7whmifi2v0bc8i6x-source \ No newline at end of file diff --git a/.direnv/flake-inputs/m9i30p1h6j40z25bwin59f9c2lhgsgj3-source b/.direnv/flake-inputs/m9i30p1h6j40z25bwin59f9c2lhgsgj3-source new file mode 120000 index 0000000..6e29d1d --- /dev/null +++ b/.direnv/flake-inputs/m9i30p1h6j40z25bwin59f9c2lhgsgj3-source @@ -0,0 +1 @@ +/nix/store/m9i30p1h6j40z25bwin59f9c2lhgsgj3-source \ No newline at end of file diff --git a/.direnv/flake-inputs/mgy7alvhlcvdlgsq28k3r1qd9b5vcj6w-source b/.direnv/flake-inputs/mgy7alvhlcvdlgsq28k3r1qd9b5vcj6w-source new file mode 120000 index 0000000..061480e --- /dev/null +++ b/.direnv/flake-inputs/mgy7alvhlcvdlgsq28k3r1qd9b5vcj6w-source @@ -0,0 +1 @@ +/nix/store/mgy7alvhlcvdlgsq28k3r1qd9b5vcj6w-source \ No newline at end of file diff --git a/.direnv/flake-inputs/q9az5f308q9ffvpli022pi8n5642z36n-source b/.direnv/flake-inputs/q9az5f308q9ffvpli022pi8n5642z36n-source new file mode 120000 index 0000000..2beac1d --- /dev/null +++ b/.direnv/flake-inputs/q9az5f308q9ffvpli022pi8n5642z36n-source @@ -0,0 +1 @@ +/nix/store/q9az5f308q9ffvpli022pi8n5642z36n-source \ No newline at end of file diff --git a/.direnv/flake-inputs/s6agnzjr3kg5sayjy0b0ms52bkvifqrv-source b/.direnv/flake-inputs/s6agnzjr3kg5sayjy0b0ms52bkvifqrv-source new file mode 120000 index 0000000..86c0772 --- /dev/null +++ b/.direnv/flake-inputs/s6agnzjr3kg5sayjy0b0ms52bkvifqrv-source @@ -0,0 +1 @@ +/nix/store/s6agnzjr3kg5sayjy0b0ms52bkvifqrv-source \ No newline at end of file diff --git a/.direnv/flake-inputs/syx87xxvlmvvzjshyipbwbv05d5z6as2-source b/.direnv/flake-inputs/syx87xxvlmvvzjshyipbwbv05d5z6as2-source new file mode 120000 index 0000000..034d1ed --- /dev/null +++ b/.direnv/flake-inputs/syx87xxvlmvvzjshyipbwbv05d5z6as2-source @@ -0,0 +1 @@ +/nix/store/syx87xxvlmvvzjshyipbwbv05d5z6as2-source \ No newline at end of file diff --git a/.direnv/flake-inputs/vg5sns11cjm6gsrp61pa5bgxkzrm5846-source b/.direnv/flake-inputs/vg5sns11cjm6gsrp61pa5bgxkzrm5846-source new file mode 120000 index 0000000..ba44c7c --- /dev/null +++ b/.direnv/flake-inputs/vg5sns11cjm6gsrp61pa5bgxkzrm5846-source @@ -0,0 +1 @@ +/nix/store/vg5sns11cjm6gsrp61pa5bgxkzrm5846-source \ No newline at end of file diff --git a/.direnv/flake-inputs/vwpc14rqwrzrnr3rn733cc0f6i0rhyxk-source b/.direnv/flake-inputs/vwpc14rqwrzrnr3rn733cc0f6i0rhyxk-source new file mode 120000 index 0000000..7d76149 --- /dev/null +++ b/.direnv/flake-inputs/vwpc14rqwrzrnr3rn733cc0f6i0rhyxk-source @@ -0,0 +1 @@ +/nix/store/vwpc14rqwrzrnr3rn733cc0f6i0rhyxk-source \ No newline at end of file diff --git a/.direnv/flake-inputs/vwwbg9chin0hq0snddfn0swzdi7frgia-source b/.direnv/flake-inputs/vwwbg9chin0hq0snddfn0swzdi7frgia-source new file mode 120000 index 0000000..dcc6093 --- /dev/null +++ b/.direnv/flake-inputs/vwwbg9chin0hq0snddfn0swzdi7frgia-source @@ -0,0 +1 @@ +/nix/store/vwwbg9chin0hq0snddfn0swzdi7frgia-source \ No newline at end of file diff --git a/.direnv/flake-inputs/wm8s3y2q44fgcxlxf3mjb08szyh7rxlc-source b/.direnv/flake-inputs/wm8s3y2q44fgcxlxf3mjb08szyh7rxlc-source new file mode 120000 index 0000000..3fb20dc --- /dev/null +++ b/.direnv/flake-inputs/wm8s3y2q44fgcxlxf3mjb08szyh7rxlc-source @@ -0,0 +1 @@ +/nix/store/wm8s3y2q44fgcxlxf3mjb08szyh7rxlc-source \ No newline at end of file diff --git a/.direnv/flake-inputs/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source b/.direnv/flake-inputs/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source new file mode 120000 index 0000000..f17959f --- /dev/null +++ b/.direnv/flake-inputs/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source @@ -0,0 +1 @@ +/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source \ No newline at end of file diff --git a/.direnv/flake-inputs/z62nvcz35lawxgpsz06wxfyzw019ikzs-source b/.direnv/flake-inputs/z62nvcz35lawxgpsz06wxfyzw019ikzs-source new file mode 120000 index 0000000..0abb879 --- /dev/null +++ b/.direnv/flake-inputs/z62nvcz35lawxgpsz06wxfyzw019ikzs-source @@ -0,0 +1 @@ +/nix/store/z62nvcz35lawxgpsz06wxfyzw019ikzs-source \ No newline at end of file diff --git a/.direnv/flake-inputs/z7nd5r2dsny2jslmpc77a76zsh9zlckb-source b/.direnv/flake-inputs/z7nd5r2dsny2jslmpc77a76zsh9zlckb-source new file mode 120000 index 0000000..be6b9fd --- /dev/null +++ b/.direnv/flake-inputs/z7nd5r2dsny2jslmpc77a76zsh9zlckb-source @@ -0,0 +1 @@ +/nix/store/z7nd5r2dsny2jslmpc77a76zsh9zlckb-source \ No newline at end of file diff --git a/.direnv/flake-inputs/zakpbz2ymns1xpzfdiap9j6s4hyd4h38-source b/.direnv/flake-inputs/zakpbz2ymns1xpzfdiap9j6s4hyd4h38-source new file mode 120000 index 0000000..2278f95 --- /dev/null +++ b/.direnv/flake-inputs/zakpbz2ymns1xpzfdiap9j6s4hyd4h38-source @@ -0,0 +1 @@ +/nix/store/zakpbz2ymns1xpzfdiap9j6s4hyd4h38-source \ No newline at end of file diff --git a/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa b/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa new file mode 120000 index 0000000..219942b --- /dev/null +++ b/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa @@ -0,0 +1 @@ +/nix/store/2mnb6wk7ycsqjxsgx4iqni1w1gml253d-nix-shell-env \ No newline at end of file diff --git a/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc b/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc new file mode 100644 index 0000000..fbbe14b --- /dev/null +++ b/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc @@ -0,0 +1,2124 @@ +unset shellHook +PATH=${PATH:-} +nix_saved_PATH="$PATH" +XDG_DATA_DIRS=${XDG_DATA_DIRS:-} +nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" +AR='ar' +export AR +AS='as' +export AS +BASH='/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin/bash' +CC='gcc' +export CC +CONFIG_SHELL='/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin/bash' +export CONFIG_SHELL +CXX='g++' +export CXX +HOSTTYPE='x86_64' +HOST_PATH='/nix/store/60440kg5c51rrlpinkk2rkg020q5q6kv-git-2.51.0/bin:/nix/store/w5fdhasggwfnfvwg9a6qc2wfczm4bn4j-nixfmt-1.1.0/bin:/nix/store/xs8scz9w9jp4hpqycx3n3bah5y07ymgj-coreutils-9.8/bin:/nix/store/qqvfnxa9jg71wp4hfg1l63r4m78iwvl9-findutils-4.10.0/bin:/nix/store/7ql4x9i7w7ihxw23vkanvcvrvqhay23c-diffutils-3.12/bin:/nix/store/zppkx0lkizglyqa9h26wf495qkllrjgy-gnused-4.9/bin:/nix/store/22r4s6lqhl43jkazn51f3c18qwk894g4-gnugrep-3.12/bin:/nix/store/8c4l9cqqj7pixqlmljx5d495pfpw8pys-gawk-5.3.2/bin:/nix/store/3m0zcl1by8ifylmgdcaa317cnhqn8q95-gnutar-1.35/bin:/nix/store/vjj9x3dzszbzjpkzwx63z4gpypiqphzf-gzip-1.14/bin:/nix/store/vzj5iy2png2rs6q2kb3svzp0cnd878f1-bzip2-1.0.8-bin/bin:/nix/store/43lv2nr7pj7wy09qyicjq57bl209ccis-gnumake-4.4.1/bin:/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin:/nix/store/miap8jjp87z0gibkrzh68lw2w8kzy4yx-patch-2.8/bin:/nix/store/vwx988887gsrdvg9lbg5f03sy91wrjjv-xz-5.8.1-bin/bin:/nix/store/n686xm9c2ak4x02pj9izvkm0zx7ilwir-file-5.45/bin' +export HOST_PATH +IFS=' +' +IN_NIX_SHELL='impure' +export IN_NIX_SHELL +LD='ld' +export LD +LINENO='76' +MACHTYPE='x86_64-pc-linux-gnu' +NIX_BINTOOLS='/nix/store/918ldr9axgh5kdmpp5fnj2n37pyghwbx-binutils-wrapper-2.44' +export NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES='4' +export NIX_BUILD_CORES +NIX_CC='/nix/store/x8mydcgbry214s802nzvy7fdljx404ym-gcc-wrapper-14.3.0' +export NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE=' -frandom-seed=2mnb6wk7yc' +export NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE='1' +export NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE='bindnow format fortify fortify3 pic relro stackclashprotection stackprotector strictoverflow zerocallusedregs' +export NIX_HARDENING_ENABLE +NIX_LDFLAGS='-rpath /home/tim/.dotfiles/outputs/out/lib ' +export NIX_LDFLAGS +NIX_NO_SELF_RPATH='1' +NIX_STORE='/nix/store' +export NIX_STORE +NM='nm' +export NM +OBJCOPY='objcopy' +export OBJCOPY +OBJDUMP='objdump' +export OBJDUMP +OLDPWD='' +export OLDPWD +OPTERR='1' +OSTYPE='linux-gnu' +PATH='/nix/store/85n78yrssyfc65f32yxpqqcpzkgbjv8c-patchelf-0.15.2/bin:/nix/store/x8mydcgbry214s802nzvy7fdljx404ym-gcc-wrapper-14.3.0/bin:/nix/store/ffrg0560kj0066s4k9pznjand907nlnz-gcc-14.3.0/bin:/nix/store/76zn66xib0r80s5y7p0m1ba3y036sxwh-glibc-2.40-66-bin/bin:/nix/store/xs8scz9w9jp4hpqycx3n3bah5y07ymgj-coreutils-9.8/bin:/nix/store/918ldr9axgh5kdmpp5fnj2n37pyghwbx-binutils-wrapper-2.44/bin:/nix/store/416ykpc2bksb90sd1ia8cybxb3p83mrd-binutils-2.44/bin:/nix/store/60440kg5c51rrlpinkk2rkg020q5q6kv-git-2.51.0/bin:/nix/store/w5fdhasggwfnfvwg9a6qc2wfczm4bn4j-nixfmt-1.1.0/bin:/nix/store/xs8scz9w9jp4hpqycx3n3bah5y07ymgj-coreutils-9.8/bin:/nix/store/qqvfnxa9jg71wp4hfg1l63r4m78iwvl9-findutils-4.10.0/bin:/nix/store/7ql4x9i7w7ihxw23vkanvcvrvqhay23c-diffutils-3.12/bin:/nix/store/zppkx0lkizglyqa9h26wf495qkllrjgy-gnused-4.9/bin:/nix/store/22r4s6lqhl43jkazn51f3c18qwk894g4-gnugrep-3.12/bin:/nix/store/8c4l9cqqj7pixqlmljx5d495pfpw8pys-gawk-5.3.2/bin:/nix/store/3m0zcl1by8ifylmgdcaa317cnhqn8q95-gnutar-1.35/bin:/nix/store/vjj9x3dzszbzjpkzwx63z4gpypiqphzf-gzip-1.14/bin:/nix/store/vzj5iy2png2rs6q2kb3svzp0cnd878f1-bzip2-1.0.8-bin/bin:/nix/store/43lv2nr7pj7wy09qyicjq57bl209ccis-gnumake-4.4.1/bin:/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin:/nix/store/miap8jjp87z0gibkrzh68lw2w8kzy4yx-patch-2.8/bin:/nix/store/vwx988887gsrdvg9lbg5f03sy91wrjjv-xz-5.8.1-bin/bin:/nix/store/n686xm9c2ak4x02pj9izvkm0zx7ilwir-file-5.45/bin' +export PATH +PS4='+ ' +RANLIB='ranlib' +export RANLIB +READELF='readelf' +export READELF +SHELL='/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin/bash' +export SHELL +SIZE='size' +export SIZE +SOURCE_DATE_EPOCH='315532800' +export SOURCE_DATE_EPOCH +STRINGS='strings' +export STRINGS +STRIP='strip' +export STRIP +XDG_DATA_DIRS='/nix/store/85n78yrssyfc65f32yxpqqcpzkgbjv8c-patchelf-0.15.2/share' +export XDG_DATA_DIRS +__structuredAttrs='' +export __structuredAttrs +_substituteStream_has_warned_replace_deprecation='false' +buildInputs='/nix/store/60440kg5c51rrlpinkk2rkg020q5q6kv-git-2.51.0 /nix/store/w5fdhasggwfnfvwg9a6qc2wfczm4bn4j-nixfmt-1.1.0' +export buildInputs +buildPhase='{ echo "------------------------------------------------------------"; + echo " WARNING: the existence of this path is not guaranteed."; + echo " It is an internal implementation detail for pkgs.mkShell."; + echo "------------------------------------------------------------"; + echo; + # Record all build inputs as runtime dependencies + export; +} >> "$out" +' +export buildPhase +builder='/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin/bash' +export builder +cmakeFlags='' +export cmakeFlags +configureFlags='' +export configureFlags +defaultBuildInputs='' +defaultNativeBuildInputs='/nix/store/85n78yrssyfc65f32yxpqqcpzkgbjv8c-patchelf-0.15.2 /nix/store/lbfg38p9kgm2dadwjqa7fgv0sjjh3ban-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/x8mydcgbry214s802nzvy7fdljx404ym-gcc-wrapper-14.3.0' +depsBuildBuild='' +export depsBuildBuild +depsBuildBuildPropagated='' +export depsBuildBuildPropagated +depsBuildTarget='' +export depsBuildTarget +depsBuildTargetPropagated='' +export depsBuildTargetPropagated +depsHostHost='' +export depsHostHost +depsHostHostPropagated='' +export depsHostHostPropagated +depsTargetTarget='' +export depsTargetTarget +depsTargetTargetPropagated='' +export depsTargetTargetPropagated +doCheck='' +export doCheck +doInstallCheck='' +export doInstallCheck +dontAddDisableDepTrack='1' +export dontAddDisableDepTrack +declare -a envBuildBuildHooks=() +declare -a envBuildHostHooks=() +declare -a envBuildTargetHooks=() +declare -a envHostHostHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +declare -a envHostTargetHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +declare -a envTargetTargetHooks=() +declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) +initialPath='/nix/store/xs8scz9w9jp4hpqycx3n3bah5y07ymgj-coreutils-9.8 /nix/store/qqvfnxa9jg71wp4hfg1l63r4m78iwvl9-findutils-4.10.0 /nix/store/7ql4x9i7w7ihxw23vkanvcvrvqhay23c-diffutils-3.12 /nix/store/zppkx0lkizglyqa9h26wf495qkllrjgy-gnused-4.9 /nix/store/22r4s6lqhl43jkazn51f3c18qwk894g4-gnugrep-3.12 /nix/store/8c4l9cqqj7pixqlmljx5d495pfpw8pys-gawk-5.3.2 /nix/store/3m0zcl1by8ifylmgdcaa317cnhqn8q95-gnutar-1.35 /nix/store/vjj9x3dzszbzjpkzwx63z4gpypiqphzf-gzip-1.14 /nix/store/vzj5iy2png2rs6q2kb3svzp0cnd878f1-bzip2-1.0.8-bin /nix/store/43lv2nr7pj7wy09qyicjq57bl209ccis-gnumake-4.4.1 /nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3 /nix/store/miap8jjp87z0gibkrzh68lw2w8kzy4yx-patch-2.8 /nix/store/vwx988887gsrdvg9lbg5f03sy91wrjjv-xz-5.8.1-bin /nix/store/n686xm9c2ak4x02pj9izvkm0zx7ilwir-file-5.45' +mesonFlags='' +export mesonFlags +name='nix-shell-env' +export name +nativeBuildInputs='' +export nativeBuildInputs +out='/home/tim/.dotfiles/outputs/out' +export out +outputBin='out' +outputDev='out' +outputDevdoc='REMOVE' +outputDevman='out' +outputDoc='out' +outputInclude='out' +outputInfo='out' +outputLib='out' +outputMan='out' +outputs='out' +export outputs +patches='' +export patches +phases='buildPhase' +export phases +pkg='/nix/store/x8mydcgbry214s802nzvy7fdljx404ym-gcc-wrapper-14.3.0' +declare -a pkgsBuildBuild=() +declare -a pkgsBuildHost=('/nix/store/85n78yrssyfc65f32yxpqqcpzkgbjv8c-patchelf-0.15.2' '/nix/store/lbfg38p9kgm2dadwjqa7fgv0sjjh3ban-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/x8mydcgbry214s802nzvy7fdljx404ym-gcc-wrapper-14.3.0' '/nix/store/918ldr9axgh5kdmpp5fnj2n37pyghwbx-binutils-wrapper-2.44' ) +declare -a pkgsBuildTarget=() +declare -a pkgsHostHost=() +declare -a pkgsHostTarget=('/nix/store/60440kg5c51rrlpinkk2rkg020q5q6kv-git-2.51.0' '/nix/store/w5fdhasggwfnfvwg9a6qc2wfczm4bn4j-nixfmt-1.1.0' ) +declare -a pkgsTargetTarget=() +declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelativeInAllOutputs' '_multioutPropagateDev' ) +declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) +declare -a preConfigureHooks=('_multioutConfig' ) +preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' +declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) +preferLocalBuild='1' +export preferLocalBuild +prefix='/home/tim/.dotfiles/outputs/out' +declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) +propagatedBuildInputs='' +export propagatedBuildInputs +declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) +propagatedNativeBuildInputs='' +export propagatedNativeBuildInputs +declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) +shell='/nix/store/ciarnmsx8lvsrmdbjddpmx0pqjrm8imb-bash-5.3p3/bin/bash' +export shell +shellHook='' +export shellHook +stdenv='/nix/store/jsj1sql9id9c10sxmg7rvq3pj0f1l19b-stdenv-linux' +export stdenv +strictDeps='' +export strictDeps +system='x86_64-linux' +export system +declare -a unpackCmdHooks=('_defaultUnpack' ) +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +_makeSymlinksRelative () +{ + + local symlinkTarget; + if [ "${dontRewriteSymlinks-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + while IFS= read -r -d '' f; do + symlinkTarget=$(readlink "$f"); + if [[ "$symlinkTarget"/ != "$prefix"/* ]]; then + continue; + fi; + if [ ! -e "$symlinkTarget" ]; then + echo "the symlink $f is broken, it points to $symlinkTarget (which is missing)"; + fi; + echo "rewriting symlink $f to be relative to $prefix"; + ln -snrf "$symlinkTarget" "$f"; + done < <(find $prefix -type l -print0) +} +_makeSymlinksRelativeInAllOutputs () +{ + + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" _makeSymlinksRelative; + done +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local tmpdir elf_fifo script_fifo; + tmpdir="$(mktemp -d)"; + elf_fifo="$tmpdir/elf"; + script_fifo="$tmpdir/script"; + mkfifo "$elf_fifo" "$script_fifo"; + ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do + if isELF "$file"; then + printf '%s\0' "$file" 1>&3; + else + if isScript "$file"; then + filename=${file##*/}; + dir=${file%/*}; + if [ -e "$dir/.$filename-wrapped" ]; then + printf '%s\0' "$file" 1>&4; + fi; + fi; + fi; + done; + exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$elf_fifo" ) & local pid_elf=$!; + local pid_script; + ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if grep -q -F "$TMPDIR/" "$1"; then + echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$script_fifo" ) & local pid_script=$!; + wait "$pid_elf" || { + echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + wait "$pid_script" || { + echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + rm -r "$tmpdir" +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + local found=; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + found=1; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + found=1; + fi; + if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then + local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; + export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; + fi +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + prependToVar configureFlags "${prefixKey:---prefix=}$prefix"; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +dumpVars () +{ + + if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then + local old_umask; + old_umask=$(umask); + umask 0077; + export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; + umask "$old_umask"; + fi +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +genericBuild () +{ + + export GZIP_NO_TIMESTAMPS=1; + if [ -f "${buildCommandPath:-}" ]; then + source "$buildCommandPath"; + return; + fi; + if [ -n "${buildCommand:-}" ]; then + eval "$buildCommand"; + return; + fi; + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi; + for curPhase in ${phases[*]}; + do + runPhase "$curPhase"; + done +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +getHostRole () +{ + + getRole "$hostOffset" +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +getTargetRole () +{ + + getRole "$targetOffset" +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +moveToOutput () +{ + + local patt="$1"; + local dstOut="$2"; + local output; + for output in $(getAllOutputNames); + do + if [ "${!output}" = "$dstOut" ]; then + continue; + fi; + local srcPath; + for srcPath in "${!output}"/$patt; + do + if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then + continue; + fi; + if [ "$dstOut" = REMOVE ]; then + echo "Removing $srcPath"; + rm -r "$srcPath"; + else + local dstPath="$dstOut${srcPath#${!output}}"; + echo "Moving $srcPath to $dstPath"; + if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then + rmdir "$srcPath" --ignore-fail-on-non-empty; + if [ -d "$srcPath" ]; then + mv -t "$dstPath" "$srcPath"/*; + rmdir "$srcPath"; + fi; + else + mkdir -p "$(readlink -m "$dstPath/..")"; + mv "$srcPath" "$dstPath"; + fi; + fi; + local srcParent="$(readlink -m "$srcPath/..")"; + if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget = "$TMPDIR"/* ]]; then + nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; + numDanglingSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); + sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; + local restoreReadOnly; + if [[ ! -w "$f" ]]; then + chmod +w "$f"; + restoreReadOnly=true; + fi; + cat "$tmpFile" > "$f"; + rm "$tmpFile"; + if [[ -n "${restoreReadOnly:-}" ]]; then + chmod -w "$f"; + fi; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/ambacmwlhkwlx6ngxccsa9z1wdszgwjx-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" +export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)" +export TMP="$NIX_BUILD_TOP" +export TMPDIR="$NIX_BUILD_TOP" +export TEMP="$NIX_BUILD_TOP" +export TEMPDIR="$NIX_BUILD_TOP" +eval "${shellHook:-}" diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/;q b/;q deleted file mode 100644 index f48b4b8..0000000 --- a/;q +++ /dev/null @@ -1,45 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ - ./git.nix - ]; - - # Development tools - home.packages = with pkgs; [ - # Version control - gh - lazygit - - # Development environments - devenv - direnv - - # Languages - (python3.withPackages (ps: with ps; [ tkinter ])) - nodejs - - # Tools - postman - lazydocker - - # AI tools - github-copilot-cli - ollama - gollama - jan - - # Terminals - warp-terminal - - # Database - dolt - ]; - - # Enable direnv - programs.direnv = { - enable = true; - enableZshIntegration = true; - nix-direnv.enable = true; - }; -} diff --git a/Makefile b/Makefile index 75ef116..2c2d63b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help setup check check-fast build-system build-home switch-system switch-home update clean +.PHONY: help setup check check-fast check-updates build-system build-home switch-system switch-home update update-system clean # Default target help: @@ -6,11 +6,13 @@ help: @echo " setup - Initial setup (check syntax, validate flake)" @echo " check - Comprehensive configuration validity check" @echo " check-fast - Quick syntax check only" + @echo " check-updates - Check for available updates without installing" @echo " build-system - Build NixOS system (dry run)" @echo " build-home - Build Home Manager (dry run)" @echo " switch-system - Switch to new NixOS configuration" @echo " switch-home - Switch to new Home Manager configuration" - @echo " update - Update flake inputs" + @echo " update - Update flake inputs only" + @echo " update-system - Complete system update with progress feedback" @echo " clean - Clean old generations" # Initial setup @@ -46,6 +48,21 @@ check-fast: exit 1; \ fi +# Check for available updates +check-updates: + @echo "๐Ÿ” Checking for updates..." + @echo "" + @echo "๐Ÿ“ฆ Current flake inputs:" + @nix flake metadata --json | jq -r '.locks.nodes | to_entries[] | select(.value.locked.type != null) | "\(.key): \(.value.locked.rev // .value.locked.narHash | .[0:12])"' 2>/dev/null || nix flake metadata + @echo "" + @echo "๐Ÿ”ข Checking potential system updates..." + @sudo nixos-rebuild dry-build --flake .#nixos 2>&1 | grep "will be built\|will be fetched" | head -3 || echo " โ„น๏ธ No major system updates detected" + @echo "" + @echo "๐Ÿ  Checking potential Home Manager updates..." + @home-manager build --flake .#tim@nixos --dry-run 2>&1 | grep "will be built\|will be fetched" | head -3 || echo " โ„น๏ธ No major home updates detected" + @echo "" + @echo "โœ… Check complete. Run 'make update-system' to apply updates." + # Build configurations (dry run) build-system: @echo "Building NixOS system configuration..." @@ -69,8 +86,23 @@ update: @echo "Updating flake inputs..." @nix flake update +# Full system update with better feedback +update-system: + @./scripts/update-system.sh + # Clean old generations clean: @echo "Cleaning old generations..." @sudo nix-collect-garbage -d - @home-manager expire-generations "-7 days" \ No newline at end of file + @home-manager expire-generations "-7 days" + +# System health check +health: + @./scripts/system-monitor.sh + +# rollback commands +rollback-system: + @./scripts/rollback.sh system --list + +rollback-home: + @./scripts/rollback home --list diff --git a/backup/configuration.nix b/backup/configuration.nix deleted file mode 100644 index 67e13a6..0000000 --- a/backup/configuration.nix +++ /dev/null @@ -1,126 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running โ€˜nixos-helpโ€™). - -{ config, pkgs, ... }: - -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "nixos"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "Africa/Nairobi"; - system.stateVersion = "25.05"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - nix.settings.trusted-users = [ "root" "tim" ]; - - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; - users.users.root.shell = pkgs.zsh; - # Define a user account. Don't forget to set a password with โ€˜passwdโ€™. - users.users.tim = { - isNormalUser = true; - description = "tim"; - extraGroups = [ "networkmanager" "wheel" "audio" "video" "storage" "podman" "adbusers" ]; - packages = with pkgs; []; - ignoreShellProgramCheck = true; - }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - # nixpkgs.config.experimental-features = [ "nix-command" "flakes"]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget -kitty -waybar -firefoxpwa -kdePackages.dolphin -wofi -brightnessctl -playerctl -neovim -home-manager -wget -git -polkit -polkit_gnome -libsecret -gnome-keyring -seahorse -# docker-compose -podman-compose -podman-desktop -podman-tui -kubectl -kind -dive # Explore container layers - skopeo # Work with container images - buildah - libsForQt5.qt5.qtgraphicaleffects - (catppuccin-sddm.override { - flavor = "mocha"; - font = "JetbrainsMono Nerd Font"; - fontSize = "10"; - loginBackground = true; - }) - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - programs.hyprland = { - enable = true; - portalPackage = pkgs.xdg-desktop-portal-hyprland; - xwayland.enable = true; - }; - programs.dconf.enable = true; - services.displayManager.sddm = { - enable = true; - package = pkgs.kdePackages.sddm; - wayland.enable = true; - theme = "catppuccin-mocha"; - }; - services.gvfs.enable = true; - services.udisks2.enable = true; - security.polkit.enable = true; -services.postgresql = { - enable = true; - package = pkgs.postgresql_16; - enableTCPIP = true; - authentication = pkgs.lib.mkOverride 10 '' - local all all trust - host all all 127.0.0.1/32 trust - ''; -}; -} diff --git a/backup/home.nix b/backup/home.nix deleted file mode 100644 index efbfe72..0000000 --- a/backup/home.nix +++ /dev/null @@ -1,232 +0,0 @@ -{ config, pkgs, ... }: - -{ - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "tim"; - home.homeDirectory = "/home/tim"; - nixpkgs.config.allowUnfree = true; - - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "24.11"; # Please read the comment before changing. - - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = with pkgs; [ - hello - nerd-fonts.jetbrains-mono - tradingview - vscode - zsh - gh - devenv - direnv - emacs - spotify - ripgrep - fd - tldr - zoxide - pyprland - wl-clipboard - fastfetch - clang - xh - choose - bottom - cava - mailspring - rofi - aerc - thunderbird - qbittorrent - python3 - mpv - google-chrome - vlc - hyprsunset - pyprland - hyprlock - hypridle - hyprpaper - pavucontrol - pwvucontrol - wlogout - cliphist - hyprpicker - grimblast - zellij - starship - zoxide - fzf - bat - eza - atuin - zfs - helix - notion-app-enhanced - xfce.thunar - xfce.thunar-volman - yazi - imv - zathura - libreoffice-fresh - vesktop - telegram-desktop - zoom-us - slack - teams-for-linux - lazygit - postman - lazydocker - btop - bitwarden-desktop - protonvpn-gui - nix-tree - nix-du - nh - github-copilot-cli - claude-code - ollama - gollama - jan - warp-terminal - gemini-cli - peazip - p7zip - unzip - zstd - ]; - - stylix = { - enable = true; - base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; - - image = pkgs.fetchurl { - url = - "https://www.pixelstalk.net/wp-content/uploads/2025/05/A-dense-forest-with-towering-evergreens-and-a-glowing-mist-rising-from-the-ground.webp"; - hash = "sha256-e8RDn46vsP4b/kLAmYXKgBL12soOXJxAqpRvSruqbXA="; - }; - polarity = "dark"; - - cursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; - size = 18; - }; - - fonts = { - monospace = { - package = pkgs.nerd-fonts.jetbrains-mono; - name = "JetbrainsMono Nerd Font"; - - }; - sizes = { - applications = 11; - desktop = 11; - popups = 11; - terminal = 11; - }; - serif = config.stylix.fonts.monospace; - sansSerif = config.stylix.fonts.monospace; - emoji = config.stylix.fonts.monospace; - }; - targets = { - gtk.enable = true; - qt = { - enable = true; - platform = "qtct"; - }; - xfce.enable = true; - kde.enable = true; - }; - }; - - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. These will be explicitly sourced when using a - # shell provided by Home Manager. If you don't want to manage your shell - # through Home Manager then you have to manually source 'hm-session-vars.sh' - # located at either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/tim/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - # EDITOR = "emacs"; - }; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - services.gnome-keyring = { - enable = true; - components = [ "secrets" "ssh" "pkcs11" ]; - }; - services.udiskie.enable = true; - - programs.kitty = { - enable = true; - settings = { - confirm_os_window_close = 0; - enable_audio_bell = "no"; - hide_window_decorations = "yes"; - window_padding_width = 4; - window_margin_width = 4; - }; - }; - - programs.zsh = { - enable = true; - shellAliases = { - ls = "eza"; - hms = "home-manager switch"; - nrs = "sudo nixos-rebuild switch"; - }; - enableCompletion = true; - syntaxHighlighting.enable = true; - autosuggestion.enable = true; - oh-my-zsh = { - enable = true; - plugins = [ "sudo" "git" "docker" "docker-compose" "aliases" "gh" ]; - }; - }; - programs.starship.enable = true; - programs.cava.enable = true; - programs.fzf.enable = true; - programs.skim.enable = true; - programs.eza = { - enable = true; - icons = "auto"; - git = true; - colors = "never"; - enableZshIntegration = true; - }; - -} - diff --git a/configs/hyprland/hyprland-additions.nix b/configs/hyprland/hyprland-additions.nix new file mode 100644 index 0000000..df2c2e9 --- /dev/null +++ b/configs/hyprland/hyprland-additions.nix @@ -0,0 +1,152 @@ +# Additional Hyprland Configuration +# Add these to your main hyprland.conf file + +################### +### SCREENSHOTS ### +################### + +# Screenshot keybindings +bind = $mainMod SHIFT, S, exec, grimblast copy area +bind = $mainMod, Print, exec, grimblast copy output +bind = , Print, exec, grimblast copy screen +bind = $mainMod CTRL, S, exec, grimblast save area ~/Pictures/Screenshots/$(date +%Y%m%d_%H%M%S).png +bind = $mainMod ALT, S, exec, grimblast --freeze copy area + +#################### +### WINDOW RULES ### +#################### + +# Float specific windows +windowrulev2 = float, class:^(pavucontrol)$ +windowrulev2 = float, class:^(org.pulseaudio.pavucontrol)$ +windowrulev2 = float, class:^(pwvucontrol)$ +windowrulev2 = float, class:^(blueman-manager)$ +windowrulev2 = float, class:^(nm-connection-editor)$ +windowrulev2 = float, class:^(xfce-polkit)$ +windowrulev2 = float, class:^(qt5ct)$ +windowrulev2 = float, class:^(qt6ct)$ +windowrulev2 = float, class:^(nwg-look)$ +windowrulev2 = float, title:^(Picture-in-Picture)$ + +# Center floating windows +windowrulev2 = center, class:^(pavucontrol)$ +windowrulev2 = center, class:^(blueman-manager)$ + +# Size specific windows +windowrulev2 = size 800 600, class:^(pavucontrol)$ +windowrulev2 = size 1000 700, class:^(thunar)$, title:^(File Operation Progress)$ + +# Workspace assignments +# windowrulev2 = workspace 1 silent, class:^(kitty)$ +windowrulev2 = workspace 2 silent, class:^(firefox)$ +windowrulev2 = workspace 2 silent, class:^(Google-chrome)$ +windowrulev2 = workspace 3 silent, class:^(Code)$ +windowrulev2 = workspace 3 silent, class:^(code-url-handler)$ +windowrulev2 = workspace 4 silent, class:^(Postman)$ +windowrulev2 = workspace 5 silent, class:^(Spotify)$ +windowrulev2 = workspace 6 silent, class:^(vesktop)$ +windowrulev2 = workspace 6 silent, class:^(discord)$ +windowrulev2 = workspace 7 silent, class:^(Slack)$ +windowrulev2 = workspace 7 silent, class:^(Microsoft Teams)$ +windowrulev2 = workspace 8 silent, class:^(Thunderbird)$ +windowrulev2 = workspace 9 silent, class:^(obs)$ + +# Opacity rules +# windowrulev2 = opacity 0.95 0.85, class:^(kitty)$ +windowrulev2 = opacity 1.0 override 1.0 override, class:^(firefox)$ +windowrulev2 = opacity 1.0 override 1.0 override, class:^(Google-chrome)$ +windowrulev2 = opacity 1.0 override 1.0 override, title:^(.*YouTube.*)$ +windowrulev2 = opacity 1.0 override 1.0 override, title:^(.*Twitch.*)$ + +# Picture-in-Picture +windowrulev2 = float, title:^(Picture-in-Picture)$ +windowrulev2 = pin, title:^(Picture-in-Picture)$ +windowrulev2 = move 70% 70%, title:^(Picture-in-Picture)$ +windowrulev2 = size 25% 25%, title:^(Picture-in-Picture)$ + +# Dialog windows +windowrulev2 = float, class:^(.*), title:^(Open File)$ +windowrulev2 = float, class:^(.*), title:^(Save File)$ +windowrulev2 = float, class:^(.*), title:^(Open Folder)$ +windowrulev2 = center, class:^(.*), title:^(Open File)$ +windowrulev2 = center, class:^(.*), title:^(Save File)$ + +# Game mode (disable animations and effects for better performance) +windowrulev2 = immediate, class:^(steam_app).* +windowrulev2 = immediate, class:^(gamescope).* + +######################### +### CLIPBOARD MANAGER ### +######################### + +# Clipboard history +exec-once = wl-paste --type text --watch cliphist store +exec-once = wl-paste --type image --watch cliphist store + +# Clipboard keybind +bind = $mainMod, C, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy + +##################### +### COLOR PICKER ### +##################### + +bind = $mainMod ALT, C, exec, hyprpicker -a + +######################## +### SCREEN RECORDING ### +######################## + +# Note: Install wf-recorder or obs-studio for screen recording +# bind = $mainMod SHIFT, R, exec, wf-recorder -g "$(slurp)" -f ~/Videos/recording_$(date +%Y%m%d_%H%M%S).mp4 +# bind = $mainMod CTRL SHIFT, R, exec, killall -s SIGINT wf-recorder + +######################### +### WINDOW MANAGEMENT ### +######################### + +# Resize mode (vim-like) +bind = $mainMod, I, submap, resize +submap = resize +binde = , h, resizeactive, -20 0 +binde = , l, resizeactive, 20 0 +binde = , k, resizeactive, 0 -20 +binde = , j, resizeactive, 0 20 +bind = , escape, submap, reset +submap = reset + +# Move windows (vim-like) +bind = $mainMod SHIFT, h, movewindow, l +bind = $mainMod SHIFT, l, movewindow, r +bind = $mainMod SHIFT, k, movewindow, u +bind = $mainMod SHIFT, j, movewindow, d + +# Focus windows (vim-like) +bind = $mainMod, h, movefocus, l +bind = $mainMod, l, movefocus, r +bind = $mainMod, k, movefocus, u +bind = $mainMod, j, movefocus, d + +# Fullscreen +bind = $mainMod, F, fullscreen, 0 +bind = $mainMod SHIFT, F, fullscreen, 1 + +# Pin window +bind = $mainMod SHIFT, P, pin + +# Group windows (tabbed layout) +bind = $mainMod, G, togglegroup +bind = $mainMod, Tab, changegroupactive, f +bind = $mainMod SHIFT, Tab, changegroupactive, b + +###################### +### SYSTEM CONTROL ### +###################### + +# Lock screen +bind = $mainMod, Escape, exec, hyprlock + +# Logout menu +bind = $mainMod SHIFT, E, exec, wlogout + +# Power menu script (create this if needed) +# bind = $mainMod SHIFT, Escape, exec, ~/.local/bin/power-menu diff --git a/configs/hyprland/hyprland.conf b/configs/hyprland/hyprland.conf index 9c8d793..edaf688 100644 --- a/configs/hyprland/hyprland.conf +++ b/configs/hyprland/hyprland.conf @@ -34,7 +34,7 @@ monitor=,preferred,auto,auto # Set programs that you use $terminal = kitty -$fileManager = dolphin +$fileManager = thunar $menu = rofi -show drun @@ -59,8 +59,8 @@ exec-once = pypr # See https://wiki.hyprland.org/Configuring/Environment-variables/ -env = XCURSOR_SIZE,24 -env = HYPRCURSOR_SIZE,24 +env = XCURSOR_SIZE,18 +env = HYPRCURSOR_SIZE,18 ################### @@ -125,9 +125,11 @@ decoration { # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = true - size = 3 - passes = 1 - + size = 8 + passes = 3 + new_optimizations = true + xray = false + ignore_opacity = false vibrancy = 0.1696 } } @@ -211,8 +213,22 @@ input { } } -# Gestures configuration has been removed in newer Hyprland versions -# See https://wiki.hyprland.org/Configuring/Variables/ for current options +# https://wiki.hypr.land/Configuring/Gestures/ +# 3 finger horizontal โ†’ workspace switching +gesture = 3, horizontal, workspace +# gesture = 3, right, workspace + +# 3 finger up โ†’ fullscreen toggle +gesture = 3, up, fullscreen + +# 3 finger down โ†’ close the window +gesture = 3, down, close + +# 4 finger pinch out โ†’ open special "overview" workspace +gesture = 4, pinchout, special, overview + +# 4 finger pinch in โ†’ move back from special workspace +gesture = 4, pinchin, special, overview # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more @@ -221,7 +237,6 @@ device { sensitivity = -0.5 } - ################### ### KEYBINDINGS ### ################### @@ -231,19 +246,18 @@ $mainMod = SUPER # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, exec, $terminal -bind = $mainMod, C, killactive, +bind = $mainMod SHIFT, Q, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, $fileManager bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $menu bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, T, togglesplit, # dwindle -# Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d +# Move focus with mainMod + arrow keys (workspace navigation) +bind = $mainMod, left, workspace, e-1 +bind = $mainMod, right, workspace, e+1 +# Vim keys are used for window focus (see hyprland-additions.nix) # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 @@ -270,8 +284,8 @@ bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Example special workspace (scratchpad) -bind = $mainMod, S, togglespecialworkspace, magic -bind = $mainMod SHIFT, S, movetoworkspace, special:magic +bind = $mainMod, minus, togglespecialworkspace, magic +bind = $mainMod SHIFT, minus, movetoworkspace, special:magic # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 @@ -300,13 +314,12 @@ $pypr = pypr bind = $mainMod SHIFT, Z, exec, $pypr zoom bind = $mainMod ALT, P, exec, $pypr toggle_dpms bind = $mainMod SHIFT, O, exec, $pypr shift_monitors +1 -bind = $mainMod, B, exec, $pypr expose -bind = $mainMod, K, exec, $pypr change_workspace +1 -bind = $mainMod, J, exec, $pypr change_workspace -1 -bind = $mainMod, L, exec, $pypr toggle_dpms +bind = $mainMod ALT, B, exec, $pypr expose +bind = $mainMod, bracketleft, exec, $pypr change_workspace -1 +bind = $mainMod, bracketright, exec, $pypr change_workspace +1 bind = $mainMod SHIFT, M, exec, $pypr toggle stb stb-logs bind = $mainMod, A, exec, $pypr toggle term -bind = $mainMod, V, exec, $pypr toggle volume +bind = $mainMod SHIFT, V, exec, $pypr toggle volume # Waybar toggle bind = $mainMod, W, exec, pkill waybar || waybar @@ -316,6 +329,54 @@ bind = $mainMod, F1, exec, /home/tim/.dotfiles/scripts/keybind-viewer.py bind = $mainMod SHIFT, F1, exec, /home/tim/.dotfiles/scripts/keybinds-rofi.sh bind = $mainMod CTRL, F1, exec, $terminal -e /home/tim/.dotfiles/scripts/keybinds-show.sh +# Add these to your ~/.dotfiles/configs/hyprland/hyprland.conf + +# === ROFI NETWORK KEYBINDINGS === + +# Main network menu (connect/disconnect WiFi/Ethernet) +bind = $mainMod, N, exec, ~/.dotfiles/scripts/rofi-network.sh + +# Quick WiFi toggle (on/off) +bind = $mainMod SHIFT, N, exec, ~/.dotfiles/scripts/rofi-wifi-toggle.sh + +# === ADI1090X ROFI THEME KEYBINDINGS === + +# Launcher (Type-1 Style-6) - Main app launcher +bind = $mainMod, D, exec, ~/.dotfiles/scripts/rofi-launcher.sh + +# Screenshot menu (Type-2) +bind = $mainMod, S, exec, ~/.dotfiles/scripts/rofi-screenshot.sh +bind = , Print, exec, ~/.dotfiles/scripts/rofi-screenshot.sh + +# Volume control (Type-2) +bind = $mainMod CTRL, V, exec, ~/.dotfiles/scripts/rofi-volume.sh + +# Apps as Root (Type-2) - WARNING: Use with caution +bind = $mainMod SHIFT, A, exec, ~/.dotfiles/scripts/rofi-root-apps.sh + +# Power menu (Type-2 Style-2) +bind = $mainMod SHIFT, P, exec, ~/.dotfiles/scripts/rofi-powermenu.sh +bind = $mainMod, X, exec, ~/.dotfiles/scripts/rofi-powermenu.sh + +# Network information display +bind = $mainMod CTRL, N, exec, rofi-network-info + +# Advanced settings (only when needed) +bind = $mainMod ALT, N, exec, nm-connection-editor + +# === WINDOW RULES FOR NETWORK GUI === +# (Only used when launching nm-connection-editor for advanced settings) + +windowrulev2 = float, class:^(nm-connection-editor)$ +windowrulev2 = center, class:^(nm-connection-editor)$ +windowrulev2 = size 800 600, class:^(nm-connection-editor)$ +windowrulev2 = opacity 0.95, class:^(nm-connection-editor)$ + +# WiFi password dialog +windowrulev2 = float, title:^(Authentication Required)$ +windowrulev2 = center, title:^(Authentication Required)$ +windowrulev2 = size 500 300, title:^(Authentication Required)$ + ############################## ### WINDOWS AND WORKSPACES ### ############################## @@ -331,3 +392,6 @@ windowrule = suppressevent maximize, class:.* # Fix some dragging issues with XWayland windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 + +# Source additional configurations +source = ~/.dotfiles/configs/hyprland/hyprland-additions.nix diff --git a/configs/pyprland.toml b/configs/pyprland.toml index e10a284..dbc5451 100644 --- a/configs/pyprland.toml +++ b/configs/pyprland.toml @@ -6,7 +6,7 @@ plugins = [ "toggle_dpms", "magnify", "expose", - "shift_monitors", + "shift_monjdkitors", "workspaces_follow_focus", ] diff --git a/configs/rofi/catppuccin-mocha.rasi b/configs/rofi/catppuccin-mocha.rasi new file mode 100644 index 0000000..02e6ffc --- /dev/null +++ b/configs/rofi/catppuccin-mocha.rasi @@ -0,0 +1,30 @@ +/** + * Catppuccin Mocha color scheme for Rofi + */ + +* { + /* Catppuccin Mocha Colors */ + bg0: #1e1e2eff; + bg1: #181825ff; + bg2: #313244ff; + bg3: #45475aff; + + fg0: #cdd6f4ff; + fg1: #bac2deff; + fg2: #a6adc8ff; + + red: #f38ba8ff; + green: #a6e3a1ff; + yellow: #f9e2afff; + blue: #89b4faff; + magenta: #cba6f7ff; + cyan: #94e2d5ff; + + accent: @blue; + urgent: @red; + on: @green; + off: @red; + + background-color: transparent; + text-color: @fg0; +} diff --git a/configs/waybar/style.css b/configs/waybar/style.css index 928a4bb..d97c35f 100644 --- a/configs/waybar/style.css +++ b/configs/waybar/style.css @@ -2,16 +2,25 @@ border: none; border-radius: 0; font-family: "JetbrainsMono Nerd Font", "Font Awesome 6 Free"; - font-size: 14px; + font-size: 12px; min-height: 0; } -window#waybar { +/* window#waybar { background: rgba(30, 30, 46, 0.9); color: #cdd6f4; transition-property: background-color; transition-duration: 0.5s; border-radius: 6px; +} */ + +window#waybar { + background: rgba(30, 30, 46, 0.85); + color: #cdd6f4; + border-radius: 6px; + transition-property: background-color; + transition-duration: 0.5s; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); } window#waybar.hidden { @@ -22,7 +31,7 @@ window#waybar.hidden { background: transparent; margin: 2px 4px 2px 2px; padding: 0 5px; - border-radius: 6px; + border-radius: 8px; } #workspaces button { @@ -76,74 +85,50 @@ window#waybar.hidden { } #cpu, -#memory { - background: #a6e3a1; - color: #1e1e2e; - padding: 0 10px; - margin: 2px 2px; - border-radius: 6px; - font-weight: bold; -} - -#memory { - background: #f9e2af; -} - -#battery { - background: #fab387; - color: #1e1e2e; - padding: 0 10px; - margin: 2px 2px; - border-radius: 6px; +#memory, +#temperature, +#battery, +#uptime, +#network, +#pulseaudio, +#tray { + padding: 5px 10px; + margin: 3px; + border-radius: 8px; + background: rgba(255, 255, 255, 0.05); font-weight: bold; } -#battery.charging { - background: #a6e3a1; +#pulseaudio { + color: #8aadf4; } -#battery.warning:not(.charging) { - background: #f9e2af; - animation: blink 1s linear infinite alternate; +#network { + color: #a6da95; } -#battery.critical:not(.charging) { - background: #f38ba8; - animation: blink 0.5s linear infinite alternate; +#cpu { + color: #eed49f; } -#network { - background: #cba6f7; - color: #1e1e2e; - padding: 0 10px; - margin: 2px 2px; - border-radius: 6px; - font-weight: bold; +#memory { + color: #f5a97f; } -#network.disconnected { - background: #f38ba8; +#temperature { + color: #a6da95; } -#pulseaudio { - background: #f5c2e7; - color: #1e1e2e; - padding: 0 10px; - margin: 2px 2px; - border-radius: 6px; - font-weight: bold; +#battery { + color: #a6da95; } -#pulseaudio.muted { - background: #6c7086; - color: #cdd6f4; +#uptime { + color: #8aadf4; } #tray { - background: #45475a; - padding: 0 10px; - margin: 2px 2px 2px 4px; - border-radius: 6px; + color: #cdd6f4; } #tray > .passive { diff --git a/docs/ANDROID-DEVELOPMENT.md b/docs/ANDROID-DEVELOPMENT.md new file mode 100644 index 0000000..f54bd90 --- /dev/null +++ b/docs/ANDROID-DEVELOPMENT.md @@ -0,0 +1,298 @@ +# Android & Mobile Development Setup + +## Overview + +Your NixOS configuration now includes comprehensive tools for .NET, Java, and Android development. + +## Installed Packages + +### System-Level (NixOS) + +- **Android SDK**: Full Android SDK with platform tools, build tools, and emulator + - Platform versions: 34, 33, 31 + - Build tools: 34.0.0, 33.0.0 + - NDK included for native development + - System images for emulator (Google Play Store variants) + - ABI support: x86_64, arm64-v8a +- **ADB (Android Debug Bridge)**: Enabled system-wide + +### User-Level (Home Manager) + +- **dotnet-sdk**: .NET SDK for C# development +- **dotnet-aspnetcore**: ASP.NET Core runtime +- **jdk**: Java Development Kit (for Android & general Java development) +- **android-tools**: Android platform tools (adb, fastboot, etc.) +- **android-studio**: Full Android Studio IDE +- **qemu**: Emulation support +- **Development utilities**: curl, unzip, which, file + +## Environment Variables + +The following environment variables are automatically set: + +```bash +ANDROID_HOME=/nix/store/.../libexec/android-sdk +ANDROID_SDK_ROOT=/nix/store/.../libexec/android-sdk +``` + +## User Permissions + +Your user (`tim`) has been added to the `adbusers` group, allowing you to: + +- Use ADB without root +- Debug Android devices via USB +- Access Android emulators + +## Getting Started + +### Android Studio + +Launch Android Studio: + +```bash +android-studio +``` + +On first launch, Android Studio will: + +1. Detect the pre-installed Android SDK +2. Offer to download additional components +3. Set up the Android Virtual Device (AVD) Manager + +### Using ADB + +Check connected devices: + +```bash +adb devices +``` + +Install an APK: + +```bash +adb install app.apk +``` + +Access device shell: + +```bash +adb shell +``` + +### Android Emulator + +List available system images: + +```bash +${ANDROID_HOME}/emulator/emulator -list-avds +``` + +Create a new AVD (through Android Studio or command line): + +```bash +# Through Android Studio +Tools > Device Manager > Create Device + +# Or via command line +avdmanager create avd -n "Pixel_API_34" -k "system-images;android-34;google_apis_playstore;x86_64" +``` + +Start emulator: + +```bash +${ANDROID_HOME}/emulator/emulator -avd Pixel_API_34 +``` + +### .NET Development + +Check .NET version: + +```bash +dotnet --version +``` + +Create a new console app: + +```bash +dotnet new console -n MyApp +cd MyApp +dotnet run +``` + +Create an ASP.NET Core web app: + +```bash +dotnet new webapp -n MyWebApp +cd MyWebApp +dotnet run +``` + +### Java Development + +Check Java version: + +```bash +java -version +javac -version +``` + +Compile and run Java: + +```bash +javac HelloWorld.java +java HelloWorld +``` + +## Connecting Physical Android Devices + +### Enable USB Debugging on Android Device + +1. Go to **Settings** > **About Phone** +2. Tap **Build Number** 7 times to enable Developer Options +3. Go to **Settings** > **Developer Options** +4. Enable **USB Debugging** + +### Connect Device + +1. Connect device via USB +2. On the device, authorize the computer when prompted +3. Verify connection: + +```bash +adb devices +``` + +You should see your device listed. + +## Troubleshooting + +### ADB not finding device + +```bash +# Restart adb server +adb kill-server +adb start-server + +# Check USB permissions +lsusb +``` + +### Emulator won't start + +```bash +# Check KVM access (required for fast emulation) +ls -la /dev/kvm + +# Your user should have access via the kvm group +# If not, you may need to add yourself to the kvm group +``` + +### Android Studio SDK issues + +If Android Studio doesn't detect the SDK: + +1. Open Android Studio +2. Go to **File** > **Settings** > **Appearance & Behavior** > **System Settings** > **Android SDK** +3. Set SDK Location to: `$ANDROID_HOME` + +### .NET SSL Certificate Issues + +If you encounter SSL/HTTPS issues: + +```bash +# Trust the .NET development certificate +dotnet dev-certs https --trust +``` + +## Updating the Configuration + +### Add More Android Platform Versions + +Edit `/home/tim/.dotfiles/modules/nixos/programs/development.nix`: + +```nix +platformVersions = [ "34" "33" "31" "30" ]; # Add version 30 +``` + +### Change .NET Version + +Edit `/home/tim/.dotfiles/modules/home-manager/programs/development/default.nix`: + +```nix +dotnet-sdk_9 # Use .NET 9 instead of default (8) +``` + +### Add More System Images + +Edit the `systemImageTypes` in `development.nix`: + +```nix +systemImageTypes = [ "google_apis_playstore" "google_apis" "default" ]; +``` + +## Building Your Configuration + +After making changes: + +```bash +cd /home/tim/.dotfiles + +# For system-level changes (Android SDK, ADB) +sudo nixos-rebuild switch --flake .#nixos + +# For user-level changes (.NET, Android Studio) +home-manager switch --flake .#tim@nixos +``` + +## Resources + +- [Android Developers](https://developer.android.com/) +- [.NET Documentation](https://docs.microsoft.com/dotnet/) +- [NixOS Android Development](https://nixos.wiki/wiki/Android) +- [Android Studio User Guide](https://developer.android.com/studio/intro) + +## Known Limitations + +1. **Android SDK Updates**: Android SDK components are managed by Nix. Use `nix flake update` to get newer versions. +2. **Emulator Performance**: For best performance, ensure KVM is enabled and your user is in the `kvm` group. +3. **Google Play Services**: Some features may require additional setup for development builds. + +## Example Projects + +### React Native with Expo + +```bash +# Install Expo CLI +npm install -g expo-cli + +# Create new project +npx create-expo-app my-app +cd my-app + +# Start development server +npx expo start +``` + +### Flutter + +Flutter requires additional setup. See the Flutter template in `/home/tim/.dotfiles/templates/` (if available) or install separately. + +### Xamarin/.NET MAUI + +```bash +# Install MAUI workload +dotnet workload install maui + +# Create MAUI app +dotnet new maui -n MyMauiApp +cd MyMauiApp +dotnet build +``` + +## Next Steps + +1. **Launch Android Studio**: Set up your first project +2. **Create an AVD**: Set up an emulator for testing +3. **Connect a device**: Test with a physical Android device +4. **Build a sample app**: Try the "Hello World" tutorials +5. **Explore templates**: Check `/home/tim/.dotfiles/templates/` for development shells diff --git a/CUSTOMIZE.md b/docs/CUSTOMIZE.md similarity index 100% rename from CUSTOMIZE.md rename to docs/CUSTOMIZE.md diff --git a/INSTALL.md b/docs/INSTALL.md similarity index 100% rename from INSTALL.md rename to docs/INSTALL.md diff --git a/docs/INTEGRATION.md b/docs/INTEGRATION.md new file mode 100644 index 0000000..2b218d3 --- /dev/null +++ b/docs/INTEGRATION.md @@ -0,0 +1,310 @@ +# Integration Guide for New Enhancements + +This guide shows you how to integrate all the new enhancement files into your existing dotfiles. + +## Step-by-Step Integration + +### 1. Add System Modules + +Edit `modules/nixos/system/default.nix`: +```nix +{ config, pkgs, ... }: + +{ + imports = [ + ./security.nix # NEW + ./maintenance.nix # NEW + ]; + + # ... rest of existing config +} +``` + +### 2. Add Home Manager Service Modules + +Edit `modules/home-manager/services/default.nix`: +```nix +{ config, pkgs, ... }: + +{ + imports = [ + ./backup.nix # NEW + ]; + + # Home manager services + services = { + # ... existing services + }; +} +``` + +### 3. Add Desktop Modules + +Edit `modules/home-manager/desktop/default.nix`: +```nix +{ config, pkgs, ... }: + +{ + imports = [ + ./hyprland.nix + ./waybar.nix + ./notifications.nix # NEW + ]; +} +``` + +### 4. Add Network Module + +Edit `modules/home-manager/programs/default.nix`: +```nix +{ inputs, outputs, ... }: + +{ + imports = [ + ./shell + ./terminal + ./editor + ./browser + ./media + ./development + ./productivity + ./communication + ./utilities + ./keybind-viewer.nix + ./network # NEW + ]; +} +``` + +### 5. Update Hyprland Configuration + +Edit `configs/hyprland/hyprland.conf` and add at the end: +```conf +# Source additional configurations +source = ~/.dotfiles/configs/hyprland/hyprland-additions.conf +``` + +### 6. Make Scripts Executable + +```bash +cd ~/.dotfiles +chmod +x scripts/system-monitor.sh +chmod +x scripts/power-menu.sh +chmod +x scripts/rollback.sh +``` + +### 7. Add Scripts to PATH + +The scripts should be automatically available through home-manager, but you can also add to `.local/bin`: + +```bash +ln -sf ~/.dotfiles/scripts/system-monitor.sh ~/.local/bin/system-monitor +ln -sf ~/.dotfiles/scripts/power-menu.sh ~/.local/bin/power-menu +ln -sf ~/.dotfiles/scripts/rollback.sh ~/.local/bin/rollback +``` + +### 8. Configure Backups (Optional) + +Edit `modules/home-manager/services/backup.nix` and uncomment the restic configuration: +```nix +services.restic.backups = { + homeBackup = { + # ... configure your backup destination + repository = "/mnt/backup/restic"; # Change this! + passwordFile = "/home/tim/.config/restic/password"; + }; +}; +``` + +Create password file: +```bash +mkdir -p ~/.config/restic +echo "your-secure-password" > ~/.config/restic/password +chmod 600 ~/.config/restic/password +``` + +### 9. Update Makefile (Optional) + +Add new commands to your `Makefile`: +```makefile +# System health check +health: + @./scripts/system-monitor.sh + +# Rollback commands +rollback-system: + @./scripts/rollback.sh system --list + +rollback-home: + @./scripts/rollback.sh home --list +``` + +### 10. Test Configuration + +```bash +cd ~/.dotfiles +make check-fast +``` + +### 11. Apply Changes + +```bash +# Apply system changes +make switch-system + +# Apply home-manager changes +make switch-home +``` + +## New Features Available + +After integration, you'll have: + +### System-Level +- โœ… Firewall enabled with sensible defaults +- โœ… Fail2ban for SSH protection +- โœ… AppArmor security profiles +- โœ… Automatic garbage collection (weekly) +- โœ… SMART disk monitoring +- โœ… Automatic SSD TRIM + +### User-Level +- โœ… Mako notifications with Catppuccin theme +- โœ… Backup scripts (manual and automated) +- โœ… Syncthing for file synchronization +- โœ… Network diagnostic tools +- โœ… SSH configuration management + +### Hyprland Enhancements +- โœ… Screenshot keybinds (`Super+Shift+S` for area) +- โœ… Window rules for common applications +- โœ… Workspace assignments +- โœ… Clipboard manager integration +- โœ… Color picker (`Super+Shift+C`) +- โœ… Vim-like window navigation +- โœ… Resize mode +- โœ… Lock screen (`Super+L`) + +### Development Tools +- โœ… Python development shell template +- โœ… Node.js development shell template +- โœ… Rust development shell template +- โœ… System monitoring script +- โœ… Power menu script +- โœ… Rollback script + +### Scripts +- โœ… `system-monitor` - Check system health +- โœ… `power-menu` - Power options menu +- โœ… `rollback` - Rollback system or home-manager +- โœ… `network-status` - Show network information +- โœ… `network-restart` - Restart network services +- โœ… `backup-now` - Manual backup +- โœ… `test-notifications` - Test notification system + +## Testing New Features + +### Test Notifications +```bash +test-notifications +``` + +### Test System Monitor +```bash +system-monitor +``` + +### Test Power Menu +```bash +power-menu +``` + +### Test Rollback +```bash +rollback system --list +rollback home --list +``` + +### Test Network Tools +```bash +network-status +``` + +### Test Screenshots (Hyprland) +- `Super+Shift+S` - Select area +- `Super+Print` - Current output +- `Print` - Full screen + +### Test Color Picker (Hyprland) +- `Super+Shift+C` - Pick color + +### Test Development Shells +```bash +cd ~/dev/my-python-project +cp -r ~/.dotfiles/templates/devshells/python/* . +nix develop +``` + +## Customization + +### Firewall Ports +Edit `modules/nixos/system/security.nix`: +```nix +allowedTCPPorts = [ 5432 80 443 ]; # Add your ports +``` + +### Garbage Collection Frequency +Edit `modules/nixos/system/maintenance.nix`: +```nix +nix.gc.dates = "daily"; # or "weekly", "monthly" +``` + +### Notification Timeout +Edit `modules/home-manager/desktop/notifications.nix`: +```nix +defaultTimeout = 3000; # milliseconds +``` + +### Backup Paths +Edit `modules/home-manager/services/backup.nix`: +```nix +paths = [ + "/home/tim/Documents" + "/home/tim/Pictures" + # Add more paths +]; +``` + +## Troubleshooting + +If you encounter issues: + +1. Check syntax: `make check-fast` +2. View detailed errors: `make check` +3. Test build without switching: `make build-system` or `make build-home` +4. View the troubleshooting guide: `docs/TROUBLESHOOTING.md` + +## Rollback if Needed + +If something breaks: +```bash +# System rollback +sudo nixos-rebuild switch --rollback + +# Home-manager rollback +./scripts/rollback.sh home +``` + +## Next Steps + +1. **Configure Backups**: Set up automated backups with restic +2. **Customize Window Rules**: Add your applications to Hyprland window rules +3. **Create Dev Shells**: Set up development shells for your projects +4. **Fine-tune Security**: Review and adjust firewall and fail2ban settings +5. **Set Up Monitoring**: Review system health regularly with `system-monitor` + +## Questions? + +- Check `docs/TROUBLESHOOTING.md` +- Review NixOS options: https://search.nixos.org +- Ask on NixOS Discourse: https://discourse.nixos.org diff --git a/docs/KEYBINDING-FIXES.md b/docs/KEYBINDING-FIXES.md new file mode 100644 index 0000000..5a5219c --- /dev/null +++ b/docs/KEYBINDING-FIXES.md @@ -0,0 +1,167 @@ +# Keybinding Collision Fixes - Applied on November 2, 2025 + +## Summary +Fixed 7 keybinding collisions in Hyprland configuration files. + +--- + +## Changes Applied + +### 1. **$mainMod + C** - Moved from killactive to clipboard +- **Before**: `killactive` +- **After**: Clipboard manager (cliphist) +- **Note**: Kill window moved to `$mainMod + SHIFT + Q` (more intentional) + +### 2. **$mainMod + SHIFT + Q** - New keybinding for killactive +- **Before**: Not assigned +- **After**: `killactive` (close window) +- **Reason**: More intentional than just C + +### 3. **$mainMod + V** - Resolved triple collision +- **Kept**: `togglefloating` (most common use) +- **Moved pypr volume**: To `$mainMod + SHIFT + V` +- **Moved clipboard**: To `$mainMod + C` + +### 4. **$mainMod + SHIFT + S** - Kept for screenshots +- **Kept**: `grimblast copy area` (screenshots) +- **Moved scratchpad**: To `$mainMod + minus` and `$mainMod + SHIFT + minus` + +### 5. **$mainMod + J** - Resolved double collision +- **Before**: `togglesplit` AND `$pypr change_workspace -1` +- **After**: Only vim-style focus down (`movefocus, d`) +- **togglesplit moved to**: `$mainMod + T` +- **pypr workspace navigation moved to**: `$mainMod + bracketleft` + +### 6. **$mainMod + K** - Resolved collision +- **Before**: `$pypr change_workspace +1` conflicted with vim nav +- **After**: Only vim-style focus up (`movefocus, u`) +- **pypr workspace navigation moved to**: `$mainMod + bracketright` + +### 7. **$mainMod + L** - Resolved triple collision +- **Before**: `$pypr toggle_dpms`, `hyprlock`, and vim focus right +- **After**: Only vim-style focus right (`movefocus, r`) +- **hyprlock moved to**: `$mainMod + Escape` +- **toggle_dpms removed**: Duplicate of `$mainMod + ALT + P` + +### 8. **Arrow Keys** - Repurposed for workspace navigation +- **Before**: `movefocus` (duplicated vim keys) +- **After**: `workspace, e-1` and `workspace, e+1` for left/right +- **Reason**: Vim keys (h/j/k/l) handle focus movement + +### 9. **Color Picker** - Moved to avoid future conflicts +- **Before**: `$mainMod + SHIFT + C` +- **After**: `$mainMod + ALT + C` +- **Reason**: SHIFT+C might be needed for other functions + +### 10. **$mainMod + T** - New binding for togglesplit +- **Before**: Not assigned +- **After**: `togglesplit` (dwindle layout) +- **Reason**: Moved from J to avoid vim navigation conflict + +### 11. **$mainMod + [ and ]** - New pypr workspace navigation +- **Before**: Not assigned +- **After**: `$pypr change_workspace -1` (prev) and `+1` (next) +- **Reason**: Intuitive bracket keys for workspace switching + +### 12. **$mainMod + ALT + B** - Moved pypr expose +- **Before**: `$mainMod + B` +- **After**: `$mainMod + ALT + B` +- **Reason**: Reserved B for potential browser shortcut + +--- + +## Quick Reference - Updated Keybindings + +### Window Management +| Key | Action | +|-----|--------| +| `$mainMod + h/j/k/l` | Focus window (vim-style) | +| `$mainMod + SHIFT + h/j/k/l` | Move window (vim-style) | +| `$mainMod + I` | Enter resize mode | +| `$mainMod + V` | Toggle floating | +| `$mainMod + SHIFT + Q` | Kill window | +| `$mainMod + T` | Toggle split (dwindle) | +| `$mainMod + F` | Fullscreen | +| `$mainMod + SHIFT + F` | Maximize | +| `$mainMod + SHIFT + P` | Pin window | +| `$mainMod + G` | Toggle group (tabbed) | + +### Workspaces +| Key | Action | +|-----|--------| +| `$mainMod + 0-9` | Switch to workspace | +| `$mainMod + SHIFT + 0-9` | Move window to workspace | +| `$mainMod + [ / ]` | Previous/Next workspace (pypr) | +| `$mainMod + left/right` | Previous/Next workspace (scroll) | +| `$mainMod + minus` | Toggle scratchpad | +| `$mainMod + SHIFT + minus` | Move to scratchpad | + +### Applications +| Key | Action | +|-----|--------| +| `$mainMod + Q` | Terminal | +| `$mainMod + E` | File manager | +| `$mainMod + R` | App launcher (rofi) | +| `$mainMod + A` | Toggle pypr terminal | + +### Utilities +| Key | Action | +|-----|--------| +| `$mainMod + C` | Clipboard history | +| `$mainMod + SHIFT + V` | Volume control (pypr) | +| `$mainMod + N` | Network menu | +| `$mainMod + SHIFT + N` | WiFi toggle | +| `$mainMod + CTRL + N` | Network info | +| `$mainMod + W` | Toggle waybar | + +### Screenshots +| Key | Action | +|-----|--------| +| `$mainMod + SHIFT + S` | Screenshot area | +| `$mainMod + Print` | Screenshot output | +| `Print` | Screenshot screen | +| `$mainMod + CTRL + S` | Save screenshot to file | +| `$mainMod + ALT + S` | Screenshot area (frozen) | + +### System +| Key | Action | +|-----|--------| +| `$mainMod + Escape` | Lock screen | +| `$mainMod + SHIFT + E` | Logout menu (wlogout) | +| `$mainMod + M` | Exit Hyprland | +| `$mainMod + ALT + C` | Color picker | + +### Pypr Specific +| Key | Action | +|-----|--------| +| `$mainMod + SHIFT + Z` | Zoom | +| `$mainMod + ALT + P` | Toggle DPMS | +| `$mainMod + SHIFT + O` | Shift monitors | +| `$mainMod + ALT + B` | Expose windows | +| `$mainMod + SHIFT + M` | Toggle stb logs | + +### Keybinding Viewers +| Key | Action | +|-----|--------| +| `$mainMod + F1` | GUI keybind viewer | +| `$mainMod + SHIFT + F1` | Rofi keybind viewer | +| `$mainMod + CTRL + F1` | Terminal keybind viewer | + +--- + +## Files Modified +1. `/home/tim/.dotfiles/configs/hyprland/hyprland.conf` +2. `/home/tim/.dotfiles/configs/hyprland/hyprland-additions.nix` + +## Next Steps +1. Reload Hyprland configuration: `hyprctl reload` or `$mainMod + SHIFT + R` (if configured) +2. Test all keybindings to ensure they work as expected +3. Update any personal documentation or cheat sheets + +## Rollback +If you need to revert these changes, use git: +```bash +cd /home/tim/.dotfiles +git diff configs/hyprland/ +git checkout configs/hyprland/hyprland.conf configs/hyprland/hyprland-additions.nix +``` diff --git a/docs/KEYBINDINGS-QUICK-REF.md b/docs/KEYBINDINGS-QUICK-REF.md new file mode 100644 index 0000000..b226585 --- /dev/null +++ b/docs/KEYBINDINGS-QUICK-REF.md @@ -0,0 +1,147 @@ +# Hyprland Keybindings Quick Reference + +> **Updated**: November 2, 2025 - All collisions resolved โœ“ + +## ๐ŸชŸ Window Management + +| Keybinding | Action | +|------------|--------| +| `Super + h/j/k/l` | Focus window (left/down/up/right) | +| `Super + Shift + h/j/k/l` | Move window | +| `Super + I` then `h/j/k/l` | Resize window (exit with `Esc`) | +| `Super + V` | Toggle floating | +| `Super + Shift + Q` | Close window | +| `Super + T` | Toggle split (dwindle) | +| `Super + F` | Fullscreen | +| `Super + Shift + F` | Maximize | +| `Super + Shift + P` | Pin window | +| `Super + G` | Toggle group/tabbed | +| `Super + Tab` | Next tab in group | +| `Super + Shift + Tab` | Previous tab in group | + +## ๐Ÿ–ฅ๏ธ Workspaces + +| Keybinding | Action | +|------------|--------| +| `Super + 1-9/0` | Switch to workspace 1-10 | +| `Super + Shift + 1-9/0` | Move window to workspace | +| `Super + [` | Previous workspace (pypr) | +| `Super + ]` | Next workspace (pypr) | +| `Super + Left` | Previous workspace (scroll) | +| `Super + Right` | Next workspace (scroll) | +| `Super + -` (minus) | Toggle scratchpad | +| `Super + Shift + -` | Move window to scratchpad | + +## ๐Ÿš€ Applications + +| Keybinding | Action | +|------------|--------| +| `Super + Q` | Terminal (kitty) | +| `Super + E` | File manager (thunar) | +| `Super + R` | App launcher (wofi) | +| `Super + A` | Toggle dropdown terminal (pypr) | + +## ๐Ÿ› ๏ธ Utilities + +| Keybinding | Action | +|------------|--------| +| `Super + C` | Clipboard history (cliphist) | +| `Super + Shift + V` | Volume control menu (pypr) | +| `Super + N` | Network menu (rofi-network) | +| `Super + Shift + N` | WiFi toggle | +| `Super + Ctrl + N` | Network information | +| `Super + Alt + N` | Advanced network settings | +| `Super + W` | Toggle Waybar | + +## ๐Ÿ“ธ Screenshots + +| Keybinding | Action | +|------------|--------| +| `Super + Shift + S` | Select area & copy | +| `Super + Print` | Current monitor & copy | +| `Print` | Full screen & copy | +| `Super + Ctrl + S` | Select area & save to file | +| `Super + Alt + S` | Select area (frozen) & copy | + +## ๐Ÿ”’ System Control + +| Keybinding | Action | +|------------|--------| +| `Super + Escape` | Lock screen (hyprlock) | +| `Super + Shift + E` | Logout menu (wlogout) | +| `Super + M` | Exit Hyprland | +| `Super + Alt + C` | Color picker (hyprpicker) | + +## ๐ŸŽ›๏ธ Pypr Features + +| Keybinding | Action | +|------------|--------| +| `Super + Shift + Z` | Zoom window | +| `Super + Alt + P` | Toggle DPMS (display power) | +| `Super + Shift + O` | Shift monitors | +| `Super + Alt + B` | Expose all windows | +| `Super + Shift + M` | Toggle status bar logs | + +## ๐Ÿ“– Help & Information + +| Keybinding | Action | +|------------|--------| +| `Super + F1` | GUI keybind viewer | +| `Super + Shift + F1` | Rofi keybind viewer | +| `Super + Ctrl + F1` | Terminal keybind viewer | + +## ๐ŸŽต Media Controls + +| Keybinding | Action | +|------------|--------| +| `XF86AudioRaiseVolume` | Volume up 5% | +| `XF86AudioLowerVolume` | Volume down 5% | +| `XF86AudioMute` | Toggle mute | +| `XF86AudioMicMute` | Toggle mic mute | +| `XF86AudioNext` | Next track | +| `XF86AudioPrev` | Previous track | +| `XF86AudioPlay/Pause` | Play/Pause | + +## ๐Ÿ’ก Brightness (Laptop) + +| Keybinding | Action | +|------------|--------| +| `XF86MonBrightnessUp` | Increase brightness | +| `XF86MonBrightnessDown` | Decrease brightness | + +## ๐Ÿ–ฑ๏ธ Mouse Bindings + +| Keybinding | Action | +|------------|--------| +| `Super + Left Click` | Move window | +| `Super + Right Click` | Resize window | +| `Super + Scroll Up` | Next workspace | +| `Super + Scroll Down` | Previous workspace | + +--- + +## ๐ŸŽฏ Pro Tips + +1. **Vim Navigation**: All `h/j/k/l` keys follow vim conventions + - `h` = left, `j` = down, `k` = up, `l` = right + +2. **Workspace Switching**: Three methods available + - Numbers (1-9/0) for direct access + - Brackets ([/]) for sequential navigation + - Arrow keys (left/right) for sequential navigation + +3. **Scratchpad**: Use minus key (`-`) as it's easy to reach and remember + +4. **Quick Lock**: `Super + Escape` is intuitive for locking + +5. **Close vs Exit**: + - `Super + Shift + Q` closes current window + - `Super + M` exits entire Hyprland session + +6. **Screenshot Workflow**: + - Quick share: `Super + Shift + S` (copies to clipboard) + - Save file: `Super + Ctrl + S` (saves to ~/Pictures/Screenshots/) + +--- + +**Legend**: `Super` = Windows/Command key (mainMod) diff --git a/docs/LAPTOP-SETUP.md b/docs/LAPTOP-SETUP.md new file mode 100644 index 0000000..316b3b9 --- /dev/null +++ b/docs/LAPTOP-SETUP.md @@ -0,0 +1,279 @@ +# Laptop-Specific Configuration Guide + +## ๐Ÿ–ฅ๏ธ Your Hardware + +- **CPU**: Intel Core i5-6300U (6th Gen Skylake, 2 cores/4 threads) +- **RAM**: 7.4GB +- **Graphics**: Intel HD Graphics 520 (integrated) +- **Display**: 1366x768 @ 60Hz (eDP-1) +- **Boot**: UEFI mode +- **Disk**: /dev/sda (238.5GB) + - sda1: 1GB (/boot) + - sda2: 228.7GB (/) + - sda3: 8.8GB (swap) + +## โš™๏ธ Optimizations Applied + +### Power Management +โœ… **TLP enabled** for battery optimization +- Performance mode on AC power +- Powersave mode on battery +- CPU boost disabled on battery +- WiFi power saving on battery +- USB autosuspend enabled + +### Memory Management +โœ… **Zram**: 3.7GB compressed swap (50% of RAM) +โœ… **Tmpfs**: 2GB for /tmp +โœ… **Earlyoom**: Prevents system freezes on low memory +โœ… **Swappiness**: 10 (prefer RAM over swap) + +### CPU Settings +โœ… **Governor**: powersave on battery, performance on AC +โœ… **Intel microcode**: Updates enabled +โœ… **Thermal management**: thermald enabled +โœ… **Build jobs**: Limited to 2 (save battery during builds) + +### Graphics +โœ… **Intel HD 520 drivers**: Full VA-API support +โœ… **Hardware acceleration**: Enabled for video playback +โœ… **Framebuffer compression**: Enabled +โœ… **Panel self-refresh**: Enabled (saves power) + +### Display +โœ… **Resolution**: 1366x768 configured everywhere +โœ… **GRUB**: Sized for your screen +โœ… **SDDM**: Optimized cursor and font sizes +โœ… **Font sizes**: Reduced for laptop screen + +## ๐Ÿ”‹ Battery Tips + +### Check Battery Status +```bash +# Battery info +cat /sys/class/power_supply/BAT0/capacity +cat /sys/class/power_supply/BAT0/status + +# Power consumption +sudo powertop + +# TLP status +sudo tlp-stat +``` + +### Extend Battery Life +```bash +# Enable power saving mode +sudo tlp bat + +# Disable bluetooth when not needed +sudo systemctl stop bluetooth + +# Reduce screen brightness +brightnessctl set 30% + +# Check what's draining battery +sudo powertop --auto-tune +``` + +## ๐Ÿ’พ Resource Management + +### Database Services +Start only what you need: +```bash +# Start PostgreSQL +sudo systemctl start postgresql + +# Start Redis +sudo systemctl start redis + +# Start MongoDB +sudo systemctl start mongodb + +# Stop when not needed +sudo systemctl stop postgresql redis mongodb +``` + +### Monitor Resources +```bash +# System resources +btop + +# Memory usage +free -h + +# Disk usage +df -h + +# Process list +htop +``` + +### Clean Up Space +```bash +# Clean Nix store +sudo nix-collect-garbage -d +home-manager expire-generations "-7 days" + +# Optimize Nix store +nix-store --optimise + +# Clean package caches +sudo pacman -Sc # If coming from Arch +``` + +## ๐ŸŽฏ Performance vs Battery Trade-offs + +### For Maximum Battery Life +```bash +# Edit modules/nixos/performance.nix +powerManagement.cpuFreqGovernor = "powersave"; + +# Reduce brightness +brightnessctl set 40% + +# Disable unused services +sudo systemctl disable bluetooth +sudo systemctl disable cups # If not printing +``` + +### For Maximum Performance (AC Power) +```bash +# Edit modules/nixos/performance.nix +powerManagement.cpuFreqGovernor = "performance"; + +# Ensure TLP uses performance profile +services.tlp.settings.CPU_SCALING_GOVERNOR_ON_AC = "performance"; +``` + +## ๐Ÿ› Common Issues & Solutions + +### Issue: System feels slow +**Solutions:** +1. Check if databases are running: `ps aux | grep postgres` +2. Check memory: `free -h` +3. Close heavy applications +4. Run `btop` to see resource usage +5. Consider disabling some services in `modules/nixos/services/` + +### Issue: High CPU usage +**Solutions:** +1. Check with `htop` what's using CPU +2. Limit Nix build jobs in `performance.nix` +3. Close browser tabs (Chromium/Firefox can be heavy) + +### Issue: Running out of memory +**Solutions:** +1. Check Zram: `zramctl` +2. Close heavy IDEs (VSCode, RStudio) +3. Stop unused databases +4. Increase Zram percentage in `performance.nix` (currently 50%) + +### Issue: Battery drains quickly +**Solutions:** +1. Check TLP status: `sudo tlp-stat` +2. Reduce screen brightness +3. Close unused applications +4. Check power consumption: `sudo powertop` +5. Disable bluetooth: `sudo systemctl stop bluetooth` + +### Issue: Overheating +**Solutions:** +1. Check thermals: `sensors` +2. Clean laptop vents +3. Use cooling pad +4. Reduce CPU frequency temporarily: + ```bash + sudo cpupower frequency-set --max 1.5GHz + ``` + +## ๐Ÿ“Š Recommended Workflow + +### For Data Science Work +```bash +# Start only PostgreSQL and Redis +sudo systemctl start postgresql redis + +# Launch Jupyter Lab +jlab + +# Use lightweight data tools +duck # DuckDB for SQL +``` + +### For Backend Development +```bash +# Use Docker Compose for services +cd ~/.config/docker-compose +docker-compose -f dev-stack.yml up -d + +# This keeps databases in containers (easier to stop) +``` + +### For General Development +```bash +# Use direnv for project environments +# It automatically loads .envrc when you cd into project + +# Example .envrc +echo "use flake" > .envrc +direnv allow +``` + +## ๐Ÿ”ง Customization for Your Laptop + +### Change Display Scaling (if text too small) +Edit `modules/home-manager/theming/default.nix`: +```nix +fonts.sizes = { + applications = 11; # Increase from 10 + terminal = 12; # Increase from 11 +}; +``` + +### Adjust Zram Size +Edit `modules/nixos/performance.nix`: +```nix +zramSwap = { + memoryPercent = 60; # Increase from 50% if needed +}; +``` + +### Change CPU Governor +Edit `modules/nixos/performance.nix`: +```nix +# For always performance: +powerManagement.cpuFreqGovernor = "performance"; + +# For always powersave: +powerManagement.cpuFreqGovernor = "powersave"; + +# For automatic (recommended): +powerManagement.cpuFreqGovernor = "schedutil"; +``` + +## ๐Ÿ“ฑ Laptop-Specific Keybindings + +Already configured in Hyprland: +- **Brightness**: Fn + F5/F6 (or brightness keys) +- **Volume**: Fn + F10/F11/F12 +- **Media**: Fn + Play/Pause/Next/Prev + +## ๐ŸŽ“ Learning Resources + +- **TLP Documentation**: https://linrunner.de/tlp/ +- **Intel Graphics**: https://wiki.archlinux.org/title/Intel_graphics +- **Power Management**: https://wiki.archlinux.org/title/Power_management + +## โœ… Final Checklist + +- [ ] TLP enabled and configured +- [ ] Zram configured (50% of RAM) +- [ ] Database services set to manual start +- [ ] Intel microcode updates enabled +- [ ] Graphics drivers configured +- [ ] Display resolution correct (1366x768) +- [ ] Font sizes comfortable for your screen +- [ ] Power button action configured in SDDM + +Your laptop is now optimized for data engineering, development, and daily driving! ๐Ÿš€ diff --git a/docs/ROFI-THEMES.md b/docs/ROFI-THEMES.md new file mode 100644 index 0000000..3c74f81 --- /dev/null +++ b/docs/ROFI-THEMES.md @@ -0,0 +1,156 @@ +# Rofi Adi1090x Themes - Keybindings Reference + +## ๐ŸŽจ **Theme Configuration** + +All themes use **Catppuccin Mocha** color scheme with the following adi1090x styles: + +- **Launcher**: Type-1 Style-6 +- **Apps as Root**: Type-2 +- **Power Menu**: Type-2 Style-2 +- **Screenshot**: Type-2 +- **Volume**: Type-2 + +--- + +## โŒจ๏ธ **Keybindings** + +### **Main Launcher** +- `Super + D` - Open application launcher (Type-1 Style-6) +- `Super + R` - Alternative launcher (original rofi) +s +### **Screenshot** +- `Super + S` - Screenshot menu +- `Print` - Screenshot menu (alternative) + +**Screenshot Options:** +- ๓ฐน‘ Fullscreen +- ๐Ÿ–ฑ Selection (click and drag) +- ๐ŸชŸ Window (active window) +- โฒ Delay 3s (3-second delay) + +Screenshots saved to: `~/Pictures/Screenshots/` +Auto-copied to clipboard with `wl-clipboard` + +### **Volume Control** +- `Super + Ctrl + V` - Volume control menu +- `XF86AudioRaiseVolume` - Increase volume (hardware key) +- `XF86AudioLowerVolume` - Decrease volume (hardware key) +- `XF86AudioMute` - Toggle mute (hardware key) + +**Volume Menu Options:** +- ๓ฐ Increase (+5%) +- ๓ฐž Decrease (-5%) +- ๓ฐŸ Mute/Unmute +- ๐Ÿ”Š Max Volume (100%) +- ๐Ÿ”‰ 50% +- ๐ŸŽ› Pavucontrol (GUI mixer) + +### **Apps as Root** โš ๏ธ +- `Super + Shift + A` - Run applications as root (USE WITH CAUTION) + +**Root Apps Available:** +- ๐Ÿ“ File Manager (Thunar) +- ๐Ÿ’ป Terminal +- ๐Ÿ“ Text Editor (Neovim) +- ๓ฐ’“ System Monitor (btop) +- ๐Ÿ“ฆ Package Manager +- ๐Ÿ’พ Disk Usage Analyzer + +### **Power Menu** +- `Super + Shift + P` - Power menu +- `Super + X` - Power menu (alternative) + +**Power Options:** +- โป Shutdown +- ๐Ÿ”„ Reboot +- ๐Ÿ’ค Suspend +- ๐Ÿ› Hibernate +- ๓ฐ’ฒ Logout +- ๐Ÿ”’ Lock + +### **Network** (Existing) +- `Super + N` - Network menu +- `Super + Shift + N` - WiFi toggle + +### **Window Management** (Existing - No Conflicts) +- `Super + Q` - Terminal +- `Super + Shift + Q` - Kill active window +- `Super + M` - Exit Hyprland +- `Super + E` - File manager +- `Super + V` - Toggle floating +- `Super + T` - Toggle split +- `Super + W` - Toggle Waybar + +--- + +## ๐ŸŽฏ **No Keybinding Conflicts** + +All new keybindings have been carefully chosen to avoid conflicts with existing ones: + +**Existing bindings preserved:** +- `Super + [1-9,0]` - Workspaces +- `Super + Arrow Keys` - Workspace navigation +- `Super + Vim keys` - Window focus +- `Super + Shift + [1-9,0]` - Move to workspace +- `Super + A` - Pypr toggle term +- `Super + Shift + V` - Pypr toggle volume +- `Super + Ctrl + V` - **NEW** Rofi volume menu +- `Super + Shift + M` - Pypr toggle stb +- `Super + F1` - Keybind viewer +- `Super + Shift + F1` - Keybinds rofi + +**New bindings added:** +- `Super + D` - Rofi launcher โœจ +- `Super + S` / `Print` - Screenshot โœจ +- `Super + Ctrl + V` - Volume menu โœจ +- `Super + Shift + A` - Root apps โœจ +- `Super + Shift + P` / `Super + X` - Power menu โœจ + +--- + +## ๐Ÿ“ฆ **Dependencies Installed** + +- `grim` - Screenshot utility for Wayland +- `slurp` - Region selector for screenshots +- `wl-clipboard` - Clipboard manager for Wayland +- `jq` - JSON processor +- `rofi-themes-adi1090x` - Theme collection + +--- + +## ๐ŸŽจ **Color Scheme** + +All menus use Catppuccin Mocha colors: +- **Background**: #1e1e2e, #313244 +- **Foreground**: #cdd6f4 +- **Accent (Blue)**: #89b4fa +- **Urgent (Red)**: #f38ba8 +- **Green**: #a6e3a1 +- **Yellow**: #f9e2af + +--- + +## ๐Ÿ“ **Script Locations** + +All scripts are located in `~/.dotfiles/scripts/`: +- `rofi-launcher.sh` +- `rofi-powermenu.sh` +- `rofi-screenshot.sh` +- `rofi-volume.sh` +- `rofi-root-apps.sh` + +Configuration file: `~/.config/rofi/catppuccin-mocha.rasi` + +--- + +## ๐Ÿ”ง **Customization** + +To modify themes, edit the respective script in `~/.dotfiles/scripts/` and adjust the RASI theme code. + +To add more options to menus, edit the `options` variable in each script. + +--- + +**Created**: November 6, 2025 +**Theme**: Catppuccin Mocha +**Style**: adi1090x Type-1 & Type-2 diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md new file mode 100644 index 0000000..e59caaa --- /dev/null +++ b/docs/TROUBLESHOOTING.md @@ -0,0 +1,401 @@ +# Troubleshooting Guide + +## Common Issues and Solutions + +### Build Failures + +#### Issue: `nixpkgs` options conflict with `useGlobalPkgs` +``` +Failed assertions: +- tim profile: `nixpkgs` options are disabled when `home-manager.useGlobalPkgs` is enabled. +``` + +**Solution:** +Remove `nixpkgs.config` from any Home Manager files. Add this to `home/tim/default.nix`: +```nix +nixpkgs.config = lib.mkForce {}; +``` + +#### Issue: Flake syntax error +**Solution:** +```bash +nix-instantiate --parse flake.nix +``` +Look for missing semicolons, brackets, or quotes. + +#### Issue: Hash mismatch for fetchurl +**Solution:** +```bash +# Get new hash +nix-prefetch-url + +# Or use this in your config +hash = lib.fakeSha256; # Will show actual hash in error +``` + +### Home Manager Issues + +#### Issue: Activation fails with collision +``` +error: collision between ... and ... +``` + +**Solution:** +```bash +# Remove conflicting files +rm ~/.config/problematic-file + +# Or use backup extension +home-manager switch --flake . -b backup +``` + +#### Issue: Service fails to start +**Solution:** +```bash +# Check service status +systemctl --user status service-name + +# Check logs +journalctl --user -xeu service-name + +# Test service manually +/nix/store/xxx-service/bin/service-name +``` + +### Hyprland Issues + +#### Issue: Hyprland won't start +**Solution:** +```bash +# Check logs +journalctl -b | grep hyprland + +# Try running from TTY +Hyprland + +# Check if required packages are installed +which waybar kitty +``` + +#### Issue: Screen tearing or stuttering +**Solution:** +Add to `hyprland.conf`: +```conf +env = WLR_NO_HARDWARE_CURSORS,1 +env = WLR_DRM_NO_ATOMIC,1 +``` + +#### Issue: Applications not appearing in rofi +**Solution:** +```bash +# Update desktop database +update-desktop-database ~/.local/share/applications + +# Or rebuild home-manager +home-manager switch --flake . +``` + +### Display Manager Issues + +#### Issue: SDDM doesn't show theme +**Solution:** +```bash +# Check theme directory +ls /run/current-system/sw/share/sddm/themes/ + +# Rebuild system +sudo nixos-rebuild switch --flake . + +# Check SDDM config +cat /etc/sddm.conf +``` + +#### Issue: Can't login after rebuild +**Solution:** +1. Switch to TTY (Ctrl+Alt+F2) +2. Login as root or user +3. Check logs: `journalctl -xeu display-manager` +4. Rollback: `sudo nixos-rebuild switch --rollback` + +### Network Issues + +#### Issue: No internet after boot +**Solution:** +```bash +# Check NetworkManager status +systemctl status NetworkManager + +# Restart NetworkManager +sudo systemctl restart NetworkManager + +# Check connections +nmcli device status +nmcli connection show +``` + +#### Issue: DNS not resolving +**Solution:** +```bash +# Check DNS +cat /etc/resolv.conf + +# Test DNS +nslookup google.com + +# Restart resolved +sudo systemctl restart systemd-resolved +``` + +### Audio Issues + +#### Issue: No audio output +**Solution:** +```bash +# Check PipeWire status +systemctl --user status pipewire pipewire-pulse wireplumber + +# Restart audio services +systemctl --user restart pipewire pipewire-pulse wireplumber + +# Check sinks +wpctl status +``` + +#### Issue: Wrong default audio device +**Solution:** +```bash +# List devices +wpctl status + +# Set default +wpctl set-default +``` + +### Graphics Issues + +#### Issue: NVIDIA drivers not working +**Solution:** +Add to `hosts/nixos/default.nix`: +```nix +services.xserver.videoDrivers = [ "nvidia" ]; +hardware.nvidia = { + modesetting.enable = true; + open = false; # Use proprietary driver + nvidiaSettings = true; +}; +``` + +#### Issue: Screen flickering on Intel +**Solution:** +```nix +boot.kernelParams = [ "i915.enable_psr=0" ]; +``` + +### Performance Issues + +#### Issue: System is slow +**Solution:** +```bash +# Check what's using resources +btop + +# Check disk I/O +iotop + +# Check journal size +journalctl --disk-usage + +# Clean up if needed +sudo journalctl --vacuum-size=100M +``` + +#### Issue: Nix store taking too much space +**Solution:** +```bash +# Check store size +du -sh /nix/store + +# List generations +sudo nix-env --list-generations --profile /nix/var/nix/profiles/system + +# Delete old generations +sudo nix-collect-garbage -d + +# Optimize store +nix-store --optimise +``` + +### Backup and Recovery + +#### Issue: Need to rollback system +**Solution:** +```bash +# List generations +sudo nix-env --list-generations --profile /nix/var/nix/profiles/system + +# Switch to specific generation +sudo nixos-rebuild switch --rollback + +# Or boot into previous generation from GRUB/systemd-boot menu +``` + +#### Issue: Configuration lost +**Solution:** +```bash +# If dotfiles are backed up +cd ~/.dotfiles +git log # Find good commit +git checkout +make switch-system +make switch-home + +# If using backup service +~/.local/bin/backup-restore +``` + +### Package Issues + +#### Issue: Package not found +**Solution:** +```bash +# Search for package +nix search nixpkgs + +# Update flake +nix flake update + +# Check if in unstable +nix search nixpkgs# +``` + +#### Issue: Package fails to build +**Solution:** +```bash +# Try with more details +nixos-rebuild switch --flake . --show-trace + +# Check if package is broken +nix eval nixpkgs#.meta.broken + +# Try different version/channel +``` + +### Hyprlock Issues + +#### Issue: Hyprlock won't unlock +**Solution:** +- Ensure PAM is configured correctly +- Switch to TTY (Ctrl+Alt+F2) and kill hyprlock +- Check logs: `journalctl --user -xeu hyprlock` + +### Git Issues + +#### Issue: Git credentials not saved +**Solution:** +```bash +# Check keyring +secret-tool lookup protocol git + +# Start keyring daemon +eval $(gnome-keyring-daemon --start) + +# Configure git credential helper +git config --global credential.helper libsecret +``` + +## Debugging Commands + +### System Information +```bash +# NixOS version +nixos-version + +# Check flake inputs +nix flake metadata + +# Show configuration +nixos-option + +# Evaluate config value +nix eval .#nixosConfigurations.nixos.config.