| 21 Nov 2023 |
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 |
Pol | I'll do it quickly | 09:00:35 |
rikudou@lemmings.world | Download shell.nix | 09:00:58 |
Pol | doing it. | 09:02:15 |
rikudou@lemmings.world | Thanks! | 09:02:23 |
Pol | Without testing it, I'm pretty sure this should work: https://gist.github.com/drupol/8e5eb2f7cb344fe7009b72d97d1bd90f | 09:08:48 |
Pol |  Download image.png | 09:10:23 |
Pol | Yep, seems to work | 09:10:29 |
Pol | Now, going to make it simpler. | 09:10:36 |
rikudou@lemmings.world | I get this error instead: error: getting status of '/nix/store/1wlb2g44ajwr6n14apkigayzqy227ylk-source/flake.nix': No such file or directory | 09:11:02 |
rikudou@lemmings.world | Where does this come from on line 5? nixpkgs_php7429 | 09:12:53 |
Pol | It works here | 09:14:38 |
Pol | Make sure you have the latest version of the file | 09:14:45 |
Pol | In reply to @rikudou:lemmings.world Where does this come from on line 5? nixpkgs_php7429 I made it up myself | 09:14:56 |
Pol | It could be any name actually | 09:15:12 |
Pol | Once you are in the directory where the flake it, just do: nix develop | 09:15:35 |
Pol | And you will enter the default development shell | 09:15:45 |
rikudou@lemmings.world | Yeah, I understand that now, I had some version which had inputs.php7429 but nixpkgs_php7429 in the outputs, that confused me | 09:15:51 |
Pol | yeah my bad | 09:16:01 |
rikudou@lemmings.world | I still get the same error | 09:16:21 |
Pol | indeed. | 09:17:08 |
Pol | Fixing it. | 09:17:10 |
rikudou@lemmings.world | Hm, but the same file works in a different dir. How's that possible? | 09:17:27 |
rikudou@lemmings.world | The full thing is:
warning: Git tree '/home/username/some-project' is dirty
error: getting status of '/nix/store/1wlb2g44ajwr6n14apkigayzqy227ylk-source/flake.nix': No such file or directory | 09:17:59 |
rikudou@lemmings.world | In reply to @rikudou:lemmings.world Hm, but the same file works in a different dir. How's that possible? Well, not works, but it fails on infinite recursion instead | 09:18:27 |
Pol | Fixed | 09:18:34 |
Pol | https://gist.github.com/drupol/8e5eb2f7cb344fe7009b72d97d1bd90f | 09:18:35 |
rikudou@lemmings.world | It works in an empty directory, but not in my git directory (which indeed has uncommitted changes) | 09:20:27 |