forked from Mirrors/nixos-infect
NIXOS_IMPORT option
Allow to boot and configure the machine in one go
This commit is contained in:
parent
a025094b20
commit
5d8c2ed208
2 changed files with 16 additions and 0 deletions
15
README.md
15
README.md
|
@ -40,6 +40,21 @@ Potential tweaks:
|
||||||
- `/etc/nixos/networking.nix`, networking settings determined at runtime tweak
|
- `/etc/nixos/networking.nix`, networking settings determined at runtime tweak
|
||||||
if no ipv6, different number of adapters, etc.
|
if no ipv6, different number of adapters, etc.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
#cloud-config
|
||||||
|
write_files:
|
||||||
|
- path: /etc/nixos/host.nix
|
||||||
|
permissions: '0644'
|
||||||
|
content: |
|
||||||
|
{pkgs, ...}:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [ vim ];
|
||||||
|
}
|
||||||
|
runcmd:
|
||||||
|
- curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIXOS_IMPORT=./host.nix NIX_CHANNEL=nixos-17.03 bash 2>&1 | tee /tmp/infect.log
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
Motivation for this script: nixos-assimilate should supplant this script
|
Motivation for this script: nixos-assimilate should supplant this script
|
||||||
entirely, if it's ever completed. nixos-in-place was quite broken when I
|
entirely, if it's ever completed. nixos-in-place was quite broken when I
|
||||||
tried it, and also took a pretty janky approach that was substantially more
|
tried it, and also took a pretty janky approach that was substantially more
|
||||||
|
|
|
@ -15,6 +15,7 @@ makeConf() {
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./networking.nix # generated at runtime by nixos-infect
|
./networking.nix # generated at runtime by nixos-infect
|
||||||
|
$NIXOS_IMPORT
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.cleanTmpDir = true;
|
boot.cleanTmpDir = true;
|
||||||
|
|
Loading…
Reference in a new issue