If i run nix-shell -p awscli2 on my laptop, i instantly get the package and ready to go and use. However, if i declare that i want to install awscli2 permanently with home-manager, like this:
home.packages = with pkgs; [
awscli2
];
HM/Nix wants to build it from source:
these 6 derivations will be built:
/nix/store/bvwaf7d8a2m49kpsmfjlmsng80fpbiyj-awscli2-2.30.6.drv
/nix/store/4zfsms7qfyby5b0jnhkz4lgrfb51fvkn-home-manager-path.drv
/nix/store/24fgb19zxi3z0z2pfc5bh1y3wyglmipc-activation-script.drv
/nix/store/4jnglkkd061zfj0spa4jqwpccknd2nw0-hm_fontconfigconf.d10hmfonts.conf.drv
/nix/store/g04icmfc6ks2m820mamzy3cryrlkn0c6-home-manager-files.drv
/nix/store/kn1x8i13bshibpxvdavcf4r4crqiyd3i-home-manager-generation.drv
awscli2> building '/nix/store/bvwaf7d8a2m49kpsmfjlmsng80fpbiyj-awscli2-2.30.6.drv'
awscli2> Sourcing python-remove-tests-dir-hook
awscli2> Sourcing python-catch-conflicts-hook.sh
awscli2> Sourcing python-remove-bin-bytecode-hook.sh
awscli2> Sourcing pypa-build-hook
awscli2> Using pypaBuildPhase
awscli2> Sourcing python-runtime-deps-check-hook
awscli2> Using pythonRuntimeDepsCheckHook
awscli2> Sourcing pypa-install-hook
awscli2> Using pypaInstallPhase
awscli2> Sourcing python-imports-check-hook.sh
awscli2> Using pythonImportsCheckPhase
awscli2> Sourcing python-namespaces-hook
awscli2> Sourcing python-catch-conflicts-hook.sh
awscli2> Sourcing pytest-check-hook
awscli2> Using pytestCheckPhase
awscli2> Running phase: unpackPhase
awscli2> unpacking source archive /nix/store/f9jg7zmbgmpx7gdd0mgqfibakjhr6l93-source
awscli2> source root is source
awscli2> setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/tox.ini"
awscli2> Running phase: patchPhase
awscli2> Running phase: updateAutotoolsGnuConfigScriptsPhase
awscli2> Running phase: configurePhase
awscli2> patching script interpreter paths in ./configure
awscli2> ./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/cl2gkgnh26mmpka81pc2g5bzjfrili92-bash-5.3p3/bin/sh"
awscli2> configure flags: --prefix=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6 --bindir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/bin --sbindir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/sbin --includedir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/include --mandir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/share/man --infodir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/share/info --docdir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/share/doc/awscli --libdir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/lib --libexecdir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/libexec --localedir=/nix/store/ndjw5xffc02r3myq627fxjiikkqc9g5l-awscli2-2.30.6/share/locale
awscli2> checking for a Python interpreter with version >= 3.8... python
awscli2> checking for python... /nix/store/62fdlzq1x1ak2lsxp4ij7ip5k9nia3hc-python3-3.13.7/bin/python
awscli2> checking for python version... 3.13
awscli2> checking for python platform... linux
awscli2> checking for GNU default python prefix... ${prefix}
awscli2> checking for GNU default python exec_prefix... ${exec_prefix}
awscli2> checking for python script directory (pythondir)... ${PYTHON_PREFIX}/lib/python3.13/site-packages
awscli2> checking for python extension module directory (pyexecdir)... ${PYTHON_EXEC_PREFIX}/lib/python3.13/site-packages
awscli2> checking for sqlite3... yes
awscli2> checking for --with-install-type... system-sandbox
awscli2> checking for --with-download-deps... no
awscli2> configure: creating ./config.status
.....
How come that makes a difference and is there a way to prevent this? I just had a build of awscli2 take over 25 minutes and then it failed some test
The first thing I would suspect is that you are not using the same version of nixpkgs for HM and nix-shell.
nix-shellgenerally uses nix-channel version, unless you’ve set your NIX_PATH explicitly. What do nix-instantiate '<nixpkgs>' --eval 'lib.version' and echo $NIX_PATH say?
HM can be set up a lot of ways – are you running it as a NixOS module? Standalone? Flake vs non-flake? Are you setting nix.nixPath manually?
nix-instantiate '<nixpkgs>' --eval 'lib.version'
unpacking 'https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/%2A.tar.gz' into the Git cache...
<LAMBDA>
error: path '/home/vicnil/lib.version' does not exist
echo $NIX_PATH results in nothing, so it’s not set.
I am running Fedora with Determinate Nix installed, and Home-manager installed standalone.
However, if your home-manager config is flake-based, then the nixpkgs in your channels is totally irrelevant to where home-manager is getting its packages. Can you do a nix flake metadata and see if the date on your nixpkgs input to your flake looks recent? You need to be running nix flake update regularly to ensure that your packages installed through home-manager get updated.
Yeah, it’s from 2 days ago. Looks fine. Then I suppose the reason you’re having trouble is because the package doesn’t build properly on current unstable… Yup. You can wait for that to get fixed, or you could downgrade your nixpkgs to a previous commit where it worked.