diff --git a/flake.nix b/flake.nix index 5eef227..9d441fe 100644 --- a/flake.nix +++ b/flake.nix @@ -114,6 +114,7 @@ templates = { xdp-c.description = "My template for building a XDP program in C"; python.description = "My template for a base project in Python"; + latex.description = "My template for a base project in Latex"; }; }; } diff --git a/modules/home/cli/shells/fish/default.nix b/modules/home/cli/shells/fish/default.nix index 6b5784a..fb1b18d 100644 --- a/modules/home/cli/shells/fish/default.nix +++ b/modules/home/cli/shells/fish/default.nix @@ -84,11 +84,6 @@ in eval $pokemon_command ''; - hmg = '' - set current_gen (home-manager generations | head -n 1 | awk '{print $7}') - home-manager generations | awk '{print $7}' | tac | fzf --preview "echo {} | xargs -I % sh -c 'nvd --color=always diff $current_gen %' | xargs -I{} bash {}/activate" - ''; - fish_command_not_found = '' # If you run the command with comma, running the same command # will not prompt for confirmation for the rest of the session diff --git a/templates/latex/default.nix b/templates/latex/default.nix new file mode 100644 index 0000000..9dc9423 --- /dev/null +++ b/templates/latex/default.nix @@ -0,0 +1,37 @@ +{ stdenv, texlive }: +stdenv.mkDerivation { + pname = "pname"; + version = "0.0.1"; + + src = ./.; + + buildInputs = [ + (texlive.combine { + inherit (texlive) + scheme-medium + fourier + lastpage + etaremune + datetime2 + ; + }) + ]; + + buildPhase = '' + runHook preBuild + + pdflatex my_pdf.tex + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + + mv my_pdf.pdf $out + + runHook postInstall + ''; +} diff --git a/templates/latex/flake.nix b/templates/latex/flake.nix new file mode 100644 index 0000000..aaea8a0 --- /dev/null +++ b/templates/latex/flake.nix @@ -0,0 +1,38 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + treefmt-nix.url = "github:numtide/treefmt-nix"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + treefmt-nix, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; + in + { + packages = { + default = pkgs.callPackage ./. { }; + }; + + devShells = { + default = pkgs.mkShell { packages = self.packages.${system}.default.buildInputs; }; + }; + + formatter = treefmtEval.config.build.wrapper; + + checks = { + formatting = treefmtEval.config.build.check self; + }; + } + ); +} diff --git a/templates/latex/treefmt.nix b/templates/latex/treefmt.nix new file mode 100644 index 0000000..970592a --- /dev/null +++ b/templates/latex/treefmt.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + projectRootFile = "flake.nix"; + programs.nixfmt.enable = true; +} diff --git a/templates/python/default.nix b/templates/python/default.nix index c03f387..b36d32d 100644 --- a/templates/python/default.nix +++ b/templates/python/default.nix @@ -5,7 +5,7 @@ }: buildPythonPackage { pname = "pname"; - version = "version"; + version = "0.0.1"; pyproject = true; src = ./.; diff --git a/templates/xdp-c/default.nix b/templates/xdp-c/default.nix index 551c7fd..7e72091 100644 --- a/templates/xdp-c/default.nix +++ b/templates/xdp-c/default.nix @@ -11,7 +11,7 @@ }: stdenv.mkDerivation { pname = "pname"; - version = "version"; + version = "0.0.1"; src = ./.;