| 21 Nov 2023 |
Pol | This is what a typical inputs set looks like in a flake: | 08:25:51 |
Pol |  Download image.png | 08:25:54 |
Pol | If I wanted to add php74 to it, I would do: | 08:26:06 |
Pol |  Download image.png | 08:27:11 |
Pol | Sadly, I won't be able to provide a PR these days, sorry :( quite busy with work and life recently | 08:27:43 |
rikudou@lemmings.world | And how do I install it afterwards? | 08:28:11 |
Pol | Oh right | 08:29:09 |
Pol | I forgot the part where we include the overlay. | 08:29:16 |
Adam Stotesbury | In reply to @rikudou:lemmings.world I've updated it a bit, there was a mistake Just wanted to thank you again for your help. Got me on the right path. First time user of NixOs and even though it's taking me awhile to wrap my head around it I'm loving it so far. Really appreciate you taking the time to help. | 08:29:25 |
rikudou@lemmings.world | In reply to @stotes:matrix.org Just wanted to thank you again for your help. Got me on the right path. First time user of NixOs and even though it's taking me awhile to wrap my head around it I'm loving it so far. Really appreciate you taking the time to help. No problem! I've been in the exact same spot just a month (or so) ago! | 08:29:52 |
Adam Stotesbury | 😄🙏 | 08:30:15 |
Pol |  Download image.png | 08:31:50 |
Pol | Then, you can use php74, by doing:pkgs.php7429.php | 08:32:05 |
rikudou@lemmings.world | Thanks! | 08:32:42 |
Pol | you really should look at Flakes | 08:33:01 |
Pol | This is a Nix killer feature :) | 08:33:10 |
rikudou@lemmings.world | I've been planning to! I know the theory behind it, but haven't had time to learn the syntax, yet. | 08:33:53 |
Pol | the syntax is not that different from regular use of Nix | 08:34:07 |
Pol | it's just that flake has a structure where multiple outputs can be created | 08:34:31 |
Pol | * it's just that flake has a fixed structure where multiple outputs can be created | 08:34:42 |
rikudou@lemmings.world | Well, it's also very cryptic, I've read a bit on them and I still don't understand how to do even the most basic things. I still don't know how to incorporate the bits you shared today (about the php package) into, well, anything, be it configuration.nix or flake.nix. | 08:45:02 |
rikudou@lemmings.world | It seems like something I'll have to read on thoroughly and I don't have the time for that lately | 08:45:42 |
Pol | OK, I can help if you want, just let me know clearly what is unclear and I'll do my best. | 08:47:31 |
rikudou@lemmings.world | Well, creating a complete shell.nix equivalent would be a great start, I have no clue how to install the package in a flake.nix | 08:49:11 |
Pol | shell.nix was made to create development shells. This correspond to the attribute: devShells.default in a flake | 08:49:53 |
Pol | * shell.nix was made to create development shells. This correspond to the attribute: devShells.default in a flake | 08:50:29 |
Pol | For building stuff, it's packages.<something> | 08:50:48 |
rikudou@lemmings.world | In reply to @rikudou:lemmings.world
Here's a fully working shell.nix with what you want, it can easily be adapted to configuration.nix:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs.buildPackages;
let
custom = import (builtins.fetchTarball https://github.com/nixos/nixpkgs/tarball/1d8b8365a02efbf668311dc9db06cb98d49e7302) {};
php74 = custom.php74.buildEnv {
extensions = ({ enabled, all }: enabled ++ (with all; [
redis
xdebug
]));
extraConfig = ''
xdebug.mode=debug
date.timezone=Australia/Brisbane
'';
};
in
[
php74
custom.php74Packages.composer
custom.php74Extensions.pdo
custom.php74Extensions.redis
custom.php74Extensions.xdebug
];
}
I meant more like adapting this to a flake.nix, if possible? That will probably help me find the connections | 08:51:51 |
Pol | Of course! | 09:00:23 |
Pol | Send me your shell.nix | 09:00:31 |