fix: fix the error about options not set when disabling the devShell or package options for templates

This commit is contained in:
2026-04-28 18:31:06 -05:00
parent bc9f888bcf
commit b4f51b4209
2 changed files with 56 additions and 44 deletions
+39 -33
View File
@@ -102,16 +102,19 @@
# Dev Shell that lets you enter an environment with all the necessary utilites # Dev Shell that lets you enter an environment with all the necessary utilites
# Available through 'nix develop' # Available through 'nix develop'
# Also can be activated automatically if direnv is installed on the system with 'direnv allow' # Also can be activated automatically if direnv is installed on the system with 'direnv allow'
devShells.${cfg.devShell.name} = lib.mkIf cfg.devShell.enable (pkgs.mkShell { devShells = lib.mkIf cfg.devShell.enable {
packages = [ ${cfg.devShell.name} =
pyEnv pkgs.mkShell {
]; packages = [
pyEnv
];
shellHook = '' shellHook = ''
export PYTHONPATH="${pyEnv}/${pyEnv.sitePackages}:$PYTHONPATH" export PYTHONPATH="${pyEnv}/${pyEnv.sitePackages}:$PYTHONPATH"
''; '';
} }
// cfg.devShell.extraAttrs); // cfg.devShell.extraAttrs;
};
# Formatter for nix files, available through 'nix fmt' # Formatter for nix files, available through 'nix fmt'
treefmt = { treefmt = {
@@ -120,32 +123,35 @@
# Your custom packages # Your custom packages
# Accessible through 'nix build', 'nix shell', 'nix run', etc # Accessible through 'nix build', 'nix shell', 'nix run', etc
packages.${cfg.package.name} = lib.mkIf cfg.package.enable (pkgs.runCommand cfg.outputName {} packages = lib.mkIf cfg.package.enable {
/* ${cfg.package.name} =
bash pkgs.runCommand cfg.outputName {}
*/ /*
'' bash
mkdir $out */
cd $out ''
mkdir $out
cd $out
${pyEnv}/bin/python ${cfg.builder} ${pyEnv}/bin/python ${cfg.builder}
${ ${
if cfg.outputName != "" if cfg.outputName != ""
then then
/* /*
bash bash
*/ */
'' ''
for ext in ${lib.concatStringsSep " " outputExt}; do for ext in ${lib.concatStringsSep " " outputExt}; do
if [[ -f output.$ext ]]; then if [[ -f output.$ext ]]; then
mv output.$ext ${cfg.outputName}.$ext mv output.$ext ${cfg.outputName}.$ext
fi fi
done done
'' ''
else "" else ""
} }
''); '';
};
}; };
}); });
}; };
+17 -11
View File
@@ -135,15 +135,18 @@
# Dev Shell that lets you enter an environment with all the necessary utilites # Dev Shell that lets you enter an environment with all the necessary utilites
# Available through 'nix develop' # Available through 'nix develop'
# Also can be activated automatically if direnv is installed on the system with 'direnv allow' # Also can be activated automatically if direnv is installed on the system with 'direnv allow'
devShells.${cfg.devShell.name} = lib.mkIf cfg.devShell.enable (craneLib.devShell { devShells = lib.mkIf cfg.devShell.enable {
inherit (self') checks; ${cfg.devShell.name} =
craneLib.devShell {
inherit (self') checks;
# extra tooling dependencies # extra tooling dependencies
packages = cfg.devDeps; packages = cfg.devDeps;
inputsFrom = [self'.packages.${cfg.package.name}]; inputsFrom = [self'.packages.${cfg.package.name}];
} }
// cfg.devShell.extraAttrs); // cfg.devShell.extraAttrs;
};
# Formatter for nix files, available through 'nix fmt' # Formatter for nix files, available through 'nix fmt'
treefmt = { treefmt = {
@@ -156,10 +159,13 @@
# Your custom packages # Your custom packages
# Accessible through 'nix build', 'nix shell', 'nix run', etc # Accessible through 'nix build', 'nix shell', 'nix run', etc
packages.${cfg.package.name} = lib.mkIf cfg.package.enable (craneLib.buildPackage { packages = lib.mkIf cfg.package.enable {
inherit src buildInputs nativeBuildInputs cargoArtifacts; ${cfg.package.name} =
} craneLib.buildPackage {
// cfg.package.extraAttrs); inherit src buildInputs nativeBuildInputs cargoArtifacts;
}
// cfg.package.extraAttrs;
};
checks = { checks = {
clippy = craneLib.cargoClippy { clippy = craneLib.cargoClippy {