forked from Shinonome/alt-illogical-impulse
Fix venv derivation - define in let block properly
This commit is contained in:
@@ -8,6 +8,17 @@ let
|
|||||||
cfg = config.programs.dots-hyprland.python;
|
cfg = config.programs.dots-hyprland.python;
|
||||||
mainCfg = config.programs.dots-hyprland;
|
mainCfg = config.programs.dots-hyprland;
|
||||||
|
|
||||||
|
# Build Python venv as a derivation (happens during build, not activation)
|
||||||
|
venvDerivation = pkgs.runCommand "dots-hyprland-venv" {
|
||||||
|
buildInputs = [ pkgs.python312 ];
|
||||||
|
nativeBuildInputs = with pkgs; [ cmake pkg-config gcc gnumake wayland wayland-protocols ];
|
||||||
|
} ''
|
||||||
|
export HOME=$TMPDIR
|
||||||
|
mkdir -p $out
|
||||||
|
${setupVenvScript}
|
||||||
|
mv $HOME/.local/state/quickshell/.venv $out/venv
|
||||||
|
'';
|
||||||
|
|
||||||
# Virtual environment setup script that replicates installer behavior
|
# Virtual environment setup script that replicates installer behavior
|
||||||
setupVenvScript = pkgs.writeShellScript "setup-dots-hyprland-venv" ''
|
setupVenvScript = pkgs.writeShellScript "setup-dots-hyprland-venv" ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -228,15 +239,7 @@ in
|
|||||||
echo "🔗 Linking pre-built Python venv..."
|
echo "🔗 Linking pre-built Python venv..."
|
||||||
$DRY_RUN_CMD mkdir -p $(dirname ${cfg.venvPath})
|
$DRY_RUN_CMD mkdir -p $(dirname ${cfg.venvPath})
|
||||||
$DRY_RUN_CMD rm -rf ${cfg.venvPath}
|
$DRY_RUN_CMD rm -rf ${cfg.venvPath}
|
||||||
$DRY_RUN_CMD cp -r ${pkgs.runCommand "dots-hyprland-venv" {
|
$DRY_RUN_CMD cp -r ${venvDerivation}/venv ${cfg.venvPath}
|
||||||
buildInputs = [ pkgs.python312 ];
|
|
||||||
nativeBuildInputs = with pkgs; [ cmake pkg-config gcc gnumake wayland wayland-protocols ];
|
|
||||||
} ''
|
|
||||||
export HOME=$TMPDIR
|
|
||||||
mkdir -p $out
|
|
||||||
${setupVenvScript}
|
|
||||||
mv $HOME/.local/state/quickshell/.venv $out/venv
|
|
||||||
''}/venv ${cfg.venvPath}
|
|
||||||
echo "✅ Python venv linked successfully"
|
echo "✅ Python venv linked successfully"
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user