1
0
Fork 0

Apply nix-rfc formatting to flake

main
Bill Ewanick 2025-03-02 15:05:33 -05:00
parent ba2e16d000
commit 23c65a00a8
1 changed files with 78 additions and 73 deletions

151
flake.nix
View File

@ -32,87 +32,92 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
outputs = { self, nixpkgs }: { outputs =
devShell.x86_64-linux = { self, nixpkgs }:
let {
pkgs = nixpkgs.legacyPackages.x86_64-linux; devShell.x86_64-linux =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
ghc' = pkgs.haskell.packages.ghc928.ghcWithHoogle (self: with self; ghc' = pkgs.haskell.packages.ghc928.ghcWithHoogle (
[ self: with self; [
relude relude
split split
aeson aeson
random random
neat-interpolation neat-interpolation
# maths # maths
primes primes
arithmoi arithmoi
# graphing libraries! # graphing libraries!
# Chart # Chart
# Chart-cairo # Chart-cairo
] ]
); );
clean = pkgs.writeShellScriptBin "clean" '' clean = pkgs.writeShellScriptBin "clean" ''
# Delete executables # Delete executables
find . -type f -executable -not -path '*/.git/*' -delete find . -type f -executable -not -path '*/.git/*' -delete
# Delete all Haskell IR files # Delete all Haskell IR files
find . -type f -name '*.hi' -delete find . -type f -name '*.hi' -delete
find . -type f -name '*.o' -delete find . -type f -name '*.o' -delete
# Delete any test graphs created # Delete any test graphs created
find . -type f -name '*.png' -delete find . -type f -name '*.png' -delete
''; '';
in in
pkgs.mkShell { pkgs.mkShell {
buildInputs = with pkgs.haskellPackages; [ buildInputs =
ghc' with pkgs.haskellPackages;
[
ghc'
haskell-language-server haskell-language-server
ghcid ghcid
hlint hlint
] ++ (with pkgs; [ ]
kotlin ++ (with pkgs; [
jdk23 kotlin
nixfmt-rfc-style jdk23
nixfmt-rfc-style
# Scripts
clean
]);
shellHook = '' # Scripts
echo ".------..------..------..------..------..------..------..------..------..------." clean
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 " _ _ _ _ " shellHook = ''
echo "| | | | (_) | | ______ " echo ".------..------..------..------..------..------..------..------..------..------."
echo "| | | | _ __ _ __ __ ___ _ __ ___ __ _ | ||______|" echo "|U.--. ||N.--. ||I.--. ||V.--. ||E.--. ||R.--. ||S.--. ||A.--. ||L.--. ||=.--. |"
echo "| | | || '_ \ | |\ \ / / / _ \| '__|/ __| / _[ || | ______ " echo "| (\/) || :(): || (\/) || :(): || (\/) || :(): || :/\: || (\/) || :/\: || (\/) |"
echo "| |_| || | | || | \ V / | __/| | \__ \| (_| || ||______|" echo "| :\/: || ()() || :\/: || ()() || :\/: || ()() || :\/: || :\/: || (__) || :\/: |"
echo " \___/ |_| |_||_| \_/ \___||_| |___/ \__,_||_| " echo "| '--'U|| '--'N|| '--'I|| '--'V|| '--'E|| '--'R|| '--'S|| '--'A|| '--'L|| '--'=|"
echo " " echo "[------'[------'[------'[------'[------'[------'[------'[------'[------'[------'"
echo " " echo ".------..------..------..------..------..------..------..------..------..------."
echo " _____ _ _ _ " echo "|C.--. ||A.--. ||L.--. ||C.--. ||U.--. ||L.--. ||A.--. ||T.--. ||O.--. ||R.--. |"
echo "/ __ \ | | | | | | " echo "| :/\: || (\/) || :/\: || :/\: || (\/) || :/\: || (\/) || :/\: || :/\: || :(): |"
echo "| / \/ __ _ | | ___ _ _ | | __ _ | |_ ___ _ __ " echo "| :\/: || :\/: || (__) || :\/: || :\/: || (__) || :\/: || (__) || :\/: || ()() |"
echo "| | / _[ || | / __|| | | || | / _[ || __| / _ \ | '__| " echo "| '--'C|| '--'A|| '--'L|| '--'C|| '--'U|| '--'L|| '--'A|| '--'T|| '--'O|| '--'R|"
echo "| \__/\| (_| || || (__ | |_| || || (_| || |_ | (_) || | " echo "[------'[------'[------'[------'[------'[------'[------'[------'[------'[------'"
echo " \____/ \__,_||_| \___| \__,_||_| \__,_| \__| \___/ |_| "
''; echo " _ _ _ _ "
}; echo "| | | | (_) | | ______ "
}; echo "| | | | _ __ _ __ __ ___ _ __ ___ __ _ | ||______|"
echo "| | | || '_ \ | |\ \ / / / _ \| '__|/ __| / _[ || | ______ "
echo "| |_| || | | || | \ V / | __/| | \__ \| (_| || ||______|"
echo " \___/ |_| |_||_| \_/ \___||_| |___/ \__,_||_| "
echo " "
echo " "
echo " _____ _ _ _ "
echo "/ __ \ | | | | | | "
echo "| / \/ __ _ | | ___ _ _ | | __ _ | |_ ___ _ __ "
echo "| | / _[ || | / __|| | | || | / _[ || __| / _ \ | '__| "
echo "| \__/\| (_| || || (__ | |_| || || (_| || |_ | (_) || | "
echo " \____/ \__,_||_| \___| \__,_||_| \__,_| \__| \___/ |_| "
'';
};
};
} }