1
0
Fork 0
nixos-config/lib/update-system.nix
2020-12-16 19:26:54 +01:00

17 lines
571 B
Nix

{ pkgs, nixos-rebuild }:
let configPath = "/etc/nixos";
in {
update-system = pkgs.writeHaskellScript {
name = "update-system";
bins = [ nixos-rebuild pkgs.nix-output-monitor ];
} ''
main = do
paths <- myNixPath "${configPath}"
args <- getArgs
setEnv "WITH_SECRETS" "false"
nix_build (paths ++ buildSystemParams ++ ["--no-out-link"] ++ remoteBuildParams ++ fmap toString args) &!> StdOut |> nom
setEnv "WITH_SECRETS" "true"
nixos_rebuild (paths ++ ["switch"] ++ fmap toString args) &!> StdOut |> nom
'';
}