Fil-C on Nix

Filnix wiki

mbrock/filnix

shells/world.nix

λpkgs, filcc, ports, runfilc
let
9ghostty-terminfo=
pkgs.runCommand"ghostty-terminfo" { }
mkdir -p $out/share/terminfo
${pkgs.ncurses}/bin/tic -x -o $out/share/terminfo ${../misc/ghostty.terminfo}
14dank-bashrc=
pkgs.writeText"dank-bashrc"
echo
tput bold
figlet -f fender "Fil-C" | sed 's/^/ /' | clolcat -f | head -n-1
tput sgr0; tput dim
echo -n ' '; clang 2>&1 -v | grep Fil-C
tput sgr0
echo; echo ' You feel an uncanny sense of safety...'
tput sgr0
echo
export CC=filc
export CXX=filc++
export PKG_CONFIG=pkgconf
30shutdown-tools=
let
32shutdown-bin=
pkgs.writeShellScriptBin"shutdown"
sync
kill -CONT 1
in
pkgs.runCommand"shutdown-tools" { }
mkdir -p $out/bin
ln -s ${shutdown-bin}/bin/shutdown $out/bin/poweroff
ln -s ${shutdown-bin}/bin/shutdown $out/bin/halt
ln -s ${shutdown-bin}/bin/shutdown $out/bin/reboot
used by world-pkgs

ghostty-terminfo is on TERMINFO_DIRS; ncurses 6.6 also ships the entry, so it cannot be in the same buildEnv.

in
rec
54filc-world=
pkgs.mkShellNoCC
55name=
"filc-world"
56buildInputs=
57shellHook=
source ${dank-bashrc}

This shell gives you a pure PATH with nothing from your system!

63filc-world-shell=
let
65env=
pkgs.buildEnv
66name=
"filc-world"
69pure-dank-bashrc=
pkgs.writeText"pure-dank-bashrc"
export PATH="${env}/bin"
export TERMINFO_DIRS="${ghostty-terminfo}/share/terminfo"
export PS1='\[\033[1;32m\][filc]\[\033[0m\] \w \$ '
eval $(dircolors)
alias ls='ls --color=auto'
source ${dank-bashrc}
in
pkgs.writeShellScriptBin"filc-world-shell"
exec ${ports.bash}/bin/bash --rcfile ${pure-dank-bashrc} --noprofile
82inherit
world-pkgs