weirdness

This commit is contained in:
Lukas Wurzinger 2025-01-19 00:59:05 +01:00
parent 9046d3108e
commit 5e59462491
No known key found for this signature in database
2 changed files with 43 additions and 5 deletions

View file

@ -1,3 +0,0 @@
{
services.envfs.enable = true;
}

View file

@ -15,6 +15,8 @@
"php84"
];
selectedPhp = "php84";
extraConfig = ''
memory_limit = -1
@ -34,15 +36,54 @@
inherit extraConfig;
}
);
prefix = "/var/lib/phps";
/*
phpHomeLink = ".local/bin/php";
usephp = pkgs.writeShellApplication {
name = "usephp";
text = ''
if (( $# != 1 )); then
echo incorrect number of arguments >&2
exit 1
fi
ln --symbolic --force -- ${lib.escapeShellArg prefix}/"$1"/bin/php ~/${lib.escapeShellArg phpHomeLink}
'';
};
composer = pkgs.writeShellApplication {
name = "composer";
text = ''
php=~/${lib.escapeShellArg phpHomeLink}
if [[ ! -x $php ]]; then
echo php has not been linked >&2
exit 1
fi
exec -- "$php" ${pkgs.phpPackages.composer}/bin/.composer-wrapped
'';
};
*/
in {
nix.settings = {
substituters = ["https://fossar.cachix.org/"];
trusted-public-keys = ["fossar.cachix.org-1:Zv6FuqIboeHPWQS7ysLCJ7UT7xExb4OE8c4LyGb5AsE="];
};
systemd.tmpfiles.settings.php =
systemd.tmpfiles.settings =
builtins.mapAttrs (name: drv: {
"/var/lib/phps/${name}"."L+".argument = drv.outPath;
"${prefix}/${name}"."L+".argument = drv.outPath;
})
phps;
environment.systemPackages = [
phps.${selectedPhp}.packages.composer
];
/*
environment.systemPackages = [
usephp
composer
];
*/
}