-
-
Save emilazy/975aa88aec11685a67e737a53906770b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ sources ? import ./nix/sources.nix # do // { nixpkgs = ...; } | |
, nixos-config ? <nixos-config> | |
}: | |
let | |
eval = import (sources.nixpkgs + "/nixos/lib/eval-config.nix") { | |
system = builtins.currentSystem; | |
modules = [ nixos-config ]; | |
specialArgs = { inherit sources; }; | |
}; | |
system = eval.config.system.build.toplevel; | |
inherit (eval) pkgs; | |
action = name: pkgs.writeShellScriptBin name '' | |
${pkgs.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set ${system} | |
# NIXOS_INSTALL_BOOTLOADER=1 | |
${system}/bin/switch-to-configuration ${name} | |
''; | |
in | |
pkgs.symlinkJoin { | |
name = "switch-to-configuration"; | |
paths = [ | |
(action "boot") | |
(action "switch") | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment