Reformat some templates to be a bit easier to read

This commit is contained in:
Evie Litherland-Smith 2024-05-29 11:58:59 +01:00
parent de96cd3bf2
commit d326ff8034

113
templates
View file

@ -122,15 +122,37 @@ org-mode
nix-mode nix-mode
(buildphase > "buildPhase= ''" n (p "Build Instructions") n " '';") (buildphase > "buildPhase= ''" n
(checkPhase > "checkPhase= ''" n (p "") n " '';") (p "Build Instructions") n
(configurephase > "configurePhase= ''" n (p "") n " '';") " '';")
(fixupphase > "fixupPhase= ''" n (p "") n " '';") (checkPhase > "checkPhase= ''" n
(distphase > "distPhase= ''" n (p "") n " '';") (p "") n
(patchphase > "patchPhase= ''" n (p "") n " '';") " '';")
(unpackphase > "unpackPhase= ''" n (p "") n " '';") (configurephase > "configurePhase= ''" n
(installCheckPhasephase > "installCheckPhasePhase= ''" n (p "") n " '';") (p "") n
(installphase > "installphase= ''" n p " mkdir -p $out/bin" n> "for f in $(find . -executable -type f);" n> "do" n> "cp $f $out/bin" n> "done}" n> " '';") " '';")
(fixupphase > "fixupPhase= ''" n
(p "") n
" '';")
(distphase > "distPhase= ''" n
(p "") n
" '';")
(patchphase > "patchPhase= ''" n
(p "") n
" '';")
(unpackphase > "unpackPhase= ''" n
(p "") n
" '';")
(installCheckPhasephase > "installCheckPhasePhase= ''" n
(p "") n
" '';")
(installphase > "installphase= ''" n
p " mkdir -p $out/bin" n
> "for f in $(find . -executable -type f);" n
> "do" n
> "cp $f $out/bin" n
> "done}" n
> " '';")
(gitpackage "{ lib" n ", stdenv" n ", fetchFromGitHub" n ", " (p "inputs") n ", " (p "inputs") n "}:" n n> (gitpackage "{ lib" n ", stdenv" n ", fetchFromGitHub" n ", " (p "inputs") n ", " (p "inputs") n "}:" n n>
"stdenv.mkDerivation rec {" n> "pname = \"" (p "" pkgn nil) "\";" n> "version = \"" p "\";" n n> "stdenv.mkDerivation rec {" n> "pname = \"" (p "" pkgn nil) "\";" n> "version = \"" p "\";" n n>
@ -145,46 +167,45 @@ nix-mode
"platforms = platforms." "platforms = platforms."
(p (completing-read "Platform: " '("all" "allBut" "arm" "cygwin" "darwin" "freebsd" "gnu" "i686" "illumos" "linux" "mesaPlatforms" "mips" "netbsd" "none" "openbsd" "unix" "x86"))) ";" n> q "};" n> "}" (p (completing-read "Platform: " '("all" "allBut" "arm" "cygwin" "darwin" "freebsd" "gnu" "i686" "illumos" "linux" "mesaPlatforms" "mips" "netbsd" "none" "openbsd" "unix" "x86"))) ";" n> q "};" n> "}"
) )
(pythonshell "with import " (p "<nixpkgs>") " {};" (pythonshell "with import " (p "<nixpkgs>") " {};" n
n> "mkShellNoCC {" > "mkShellNoCC {" n
n> "packages = [" > "packages = [" n
n> "(" (p "python3") ".withPackages" > "(" (p "python3") ".withPackages" n
n> "(ps: with ps; ["(p "python-lsp-server isort mypy") "]))" > "(ps: with ps; ["(p "python-lsp-server isort mypy") "]))" n
n> q > q n
n> "];" > "];" n
n> "}") > "}")
(poetryshell "# See https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#cases" (poetryshell "# See https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md#cases" n
n "# for edgecases like setuptools not found" "# for edgecases like setuptools not found" n
n "with import " (p "<nixpkgs>") " {};" "with import " (p "<nixpkgs>") " {};" n
n "with (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" "with (builtins.getFlake \"github:nix-community/poetry2nix\").lib.mkPoetry2Nix {inherit pkgs;};" n
n> "(mkPoetryEnv rec {" > "(mkPoetryEnv rec {" n
n> "projectDir = ./.;" > "projectDir = ./.;" n
n> "preferWheels = true;" > "preferWheels = true;" n
n> "extras = [\"*\"];" > "extras = [\"*\"];" n
n> "editablePackageSources = {" (p "package") "=projectDir;};" > "editablePackageSources = {" (p "package") "=projectDir;};" n
n> "extraPackages = ps: with ps; [" (p "python-lsp-server isort mypy") " " q "];" > "extraPackages = ps: with ps; [" (p "python-lsp-server isort mypy") " " q "];" n
n> "})" > "})" n
n> ".env") > ".env")
(poetryoverride "overrides = defaultPoetryOverrides.extend" (poetryoverride "overrides = defaultPoetryOverrides.extend" n
n> "(self: super: {" > "(self: super: {" n
n> (s package) " =" > (s package) " =" n
n> "super." package ".overridePythonAttrs" > "super." package ".overridePythonAttrs" n
n> "(old: {" > "(old: {" n
n> "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];" > "buildInputs = (old.buildInputs or []) ++ [super." (p "setuptools" ) "];" n
n> "});" > "});" n
n> "});") > "});")
python-base-mode python-base-mode
(main "def main(" (p "*args, **kwargs") ") -> " (p "None") ":" (main "def main(" (p "*args, **kwargs") ") -> " (p "None") ":" n
n> q "return" > q "return" n n
n "if __name__ == \"__main__\":" n
n "if __name__ == \"__main__\":" > "main()")
n> "main()") (args "def parse_arguments() -> argparse.Namespace:" n
(args "def parse_arguments() -> argparse.Namespace:" > "parser = argparse.ArgumentParser(description=\"" p "\")" n
n> "parser = argparse.ArgumentParser(description=\"" p "\")" > p n
n> p > "return parser.parse_args()")
n> "return parser.parse_args()")
(logg "logger = logging.getLogger(__name__)") (logg "logger = logging.getLogger(__name__)")
(nimp "raise NotImplementedError") (nimp "raise NotImplementedError")