nix: Make nix-shell not fail on non-krops machines
Only krops stores the current configuration under /var/src/config. As I use krops much less, this is not present on all machines.
This commit is contained in:
parent
b10b83c207
commit
a39a2ba616
|
@ -10,7 +10,7 @@ let
|
||||||
let
|
let
|
||||||
# Load the system config and get the `nixpkgs.overlays` option
|
# Load the system config and get the `nixpkgs.overlays` option
|
||||||
# This fails gracefully if getFlake is not available
|
# This fails gracefully if getFlake is not available
|
||||||
overlays = if builtins.hasAttr "getFlake" builtins
|
overlays = if (builtins.hasAttr "getFlake" builtins && builtins.pathExists "/var/src/config")
|
||||||
then (builtins.getFlake "/var/src/config").nixosConfigurations.${config.networking.hostName}.config.nixpkgs.overlays
|
then (builtins.getFlake "/var/src/config").nixosConfigurations.${config.networking.hostName}.config.nixpkgs.overlays
|
||||||
else [ ];
|
else [ ];
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue