Fix bugs related to mismatched / missing nix

This commit is contained in:
Jack O'Sullivan 2022-06-12 23:21:57 +01:00
parent 543c5fd968
commit 25dd48b795
3 changed files with 9 additions and 3 deletions

View File

@ -239,6 +239,12 @@ in
packages = with pkgs; [ packages = with pkgs; [
pkgs'.mine.nix pkgs'.mine.nix
]; ];
# Without this, we are at the mercy of whatever version of nix is in $PATH...
# TODO: Is this the right thing to do?
extraActivationPath = [
config.nix.package
];
}; };
}) })
(mkIf pkgs.stdenv.isLinux (mkMerge [ (mkIf pkgs.stdenv.isLinux (mkMerge [
@ -272,7 +278,7 @@ in
# No targets.genericLinux equivalent apparently # No targets.genericLinux equivalent apparently
sessionVariablesExtra = sessionVariablesExtra =
'' ''
. "${pkgs.nix}/etc/profile.d/nix.sh" . "${config.nix.package}/etc/profile.d/nix.sh"
''; '';
packages = with pkgs; [ packages = with pkgs; [
cacert cacert

View File

@ -198,7 +198,7 @@ in
'' ''
if [ ! -e "${sysProfile}" ]; then if [ ! -e "${sysProfile}" ]; then
echo "Creating dummy profile" echo "Creating dummy profile"
${pkgs.nix}/bin/nix-env -p ${sysProfile} --set ${dummyProfile} ${config.nix.package}/bin/nix-env -p ${sysProfile} --set ${dummyProfile}
fi fi
''} ''}

View File

@ -9,7 +9,7 @@ let
keepGensOpt = with lib.types; mkOpt' ints.unsigned 10 keepGensOpt = with lib.types; mkOpt' ints.unsigned 10
"Number of generations to keep when cleaning up old deployments (0 to disable deletion on deployment)."; "Number of generations to keep when cleaning up old deployments (0 to disable deletion on deployment).";
keepGensSnippet = p: n: optionalString (n > 0) '' keepGensSnippet = p: n: optionalString (n > 0) ''
${pkgs.nix}/bin/nix-env -p "${p}" --delete-generations +${toString n} ${config.nix.package}/bin/nix-env -p "${p}" --delete-generations +${toString n}
''; '';
# Based on https://github.com/serokell/deploy-rs/blob/master/flake.nix # Based on https://github.com/serokell/deploy-rs/blob/master/flake.nix