Open yayayayaka opened 3 years ago
While reinstalling my system I discovered a bug where nixos-install ignores anything you set behind the -I nixos-config= flag.
nixos-install
-I nixos-config=
This is due to a hard-coded if-condition that only takes the NIXOS_CONFIG variable into consideration.
Steps to reproduce the behavior:
/mnt/etc/nixos/configuration.nix
nixos-install -I nixos-config=/path/to/your/configuration.nix
configuration file /mnt/etc/nixos/configuration.nix doesn't exist
nixos-install installs a NixOS system with /path/to/your/configuration.nix as configuration entry point.
/path/to/your/configuration.nix
NIXOS_CONFIG=/path/to/your/configuration.nix
@ju1m @edolstra
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
nix-shell -p nix-info --run "nix-info -m"
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m" - system: `"x86_64-linux"` - host os: `Linux 5.10.52-1-lts, NixOS, 21.05.1790.382039c05a1 (Okapi)` - multi-user?: `no` - sandbox: `yes` - version: `nix-env (Nix) 2.3.14` - channels(root): `"nixos-21.05.1790.382039c05a1"` - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Maintainer information:
# a list of nixpkgs attributes affected by the problem attribute: nixos-install-tools # a list of nixos modules affected by the problem module:
I marked this as stale due to inactivity. → More info
Describe the bug
While reinstalling my system I discovered a bug where
nixos-install
ignores anything you set behind the-I nixos-config=
flag.This is due to a hard-coded if-condition that only takes the NIXOS_CONFIG variable into consideration.
Steps To Reproduce
Steps to reproduce the behavior:
/mnt/etc/nixos/configuration.nix
nixos-install -I nixos-config=/path/to/your/configuration.nix
nixos-install
fails withconfiguration file /mnt/etc/nixos/configuration.nix doesn't exist
Expected behavior
nixos-install
installs a NixOS system with/path/to/your/configuration.nix
as configuration entry point.Workaround
NIXOS_CONFIG=/path/to/your/configuration.nix
to thenixos-install
commandNotify maintainers
@ju1m @edolstra
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information: