1
0
Fork 0
universal-calculator/flake.nix

120 lines
9.8 KiB
Nix

{
description = ''
A basic Haskell flake for solving problems and sketching out concepts.
https://tristancacqueray.github.io/blog/beautiful-haskell
'';
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
};
outputs = { self, nixpkgs }: {
devShell.x86_64-linux =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
ghc' = pkgs.haskell.packages.ghc928.ghcWithHoogle (self: with self;
[
relude
split
aeson
random
neat-interpolation
# maths
primes
arithmoi
# graphing libraries!
Chart
Chart-cairo
]
);
clean = pkgs.writeShellScriptBin "clean" ''
# Delete executables
find . -type f -executable -not -path '*/.git/*' -delete
# Delete all Haskell IR files
find . -type f -name '*.hi' -delete
find . -type f -name '*.o' -delete
# Delete any test graphs created
find . -type f -name '*.png' -delete
'';
in
pkgs.mkShell {
buildInputs = with pkgs.haskellPackages; [
ghc'
haskell-language-server
ghcid
hlint
] ++ (with pkgs; [
# Scripts
clean
go
gofumpt
nodejs
]);
shellHook = ''
echo ".------..------..------..------..------..------..------..------..------..------."
echo "|U.--. ||N.--. ||I.--. ||V.--. ||E.--. ||R.--. ||S.--. ||A.--. ||L.--. ||=.--. |"
echo "| (\/) || :(): || (\/) || :(): || (\/) || :(): || :/\: || (\/) || :/\: || (\/) |"
echo "| :\/: || ()() || :\/: || ()() || :\/: || ()() || :\/: || :\/: || (__) || :\/: |"
echo "| '--'U|| '--'N|| '--'I|| '--'V|| '--'E|| '--'R|| '--'S|| '--'A|| '--'L|| '--'=|"
echo "[------'[------'[------'[------'[------'[------'[------'[------'[------'[------'"
echo ".------..------..------..------..------..------..------..------..------..------."
echo "|C.--. ||A.--. ||L.--. ||C.--. ||U.--. ||L.--. ||A.--. ||T.--. ||O.--. ||R.--. |"
echo "| :/\: || (\/) || :/\: || :/\: || (\/) || :/\: || (\/) || :/\: || :/\: || :(): |"
echo "| :\/: || :\/: || (__) || :\/: || :\/: || (__) || :\/: || (__) || :\/: || ()() |"
echo "| '--'C|| '--'A|| '--'L|| '--'C|| '--'U|| '--'L|| '--'A|| '--'T|| '--'O|| '--'R|"
echo "[------'[------'[------'[------'[------'[------'[------'[------'[------'[------'"
echo " _ _ _ _ "
echo "| | | | (_) | | ______ "
echo "| | | | _ __ _ __ __ ___ _ __ ___ __ _ | ||______|"
echo "| | | || '_ \ | |\ \ / / / _ \| '__|/ __| / _[ || | ______ "
echo "| |_| || | | || | \ V / | __/| | \__ \| (_| || ||______|"
echo " \___/ |_| |_||_| \_/ \___||_| |___/ \__,_||_| "
echo " "
echo " "
echo " _____ _ _ _ "
echo "/ __ \ | | | | | | "
echo "| / \/ __ _ | | ___ _ _ | | __ _ | |_ ___ _ __ "
echo "| | / _[ || | / __|| | | || | / _[ || __| / _ \ | '__| "
echo "| \__/\| (_| || || (__ | |_| || || (_| || |_ | (_) || | "
echo " \____/ \__,_||_| \___| \__,_||_| \__,_| \__| \___/ |_| "
'';
};
};
}