diff --git a/lib/update-system.nix b/lib/update-system.nix index 146bbb1a..f374ce32 100644 --- a/lib/update-system.nix +++ b/lib/update-system.nix @@ -3,7 +3,7 @@ let configPath = "/etc/nixos"; in { update-system = pkgs.writeHaskellScript { name = "update-system"; - bins = [ nixos-rebuild ]; + bins = [ nixos-rebuild pkgs.nix-output-monitor ]; } '' privatePath = "${configPath}/private" canaryPath = privatePath <> "/submodule-is-checked-out" @@ -12,8 +12,7 @@ in { paths <- myNixPath "${configPath}" args <- getArgs bracket (rm canaryPath) (\() -> exe "/run/wrappers/bin/sudo" "-u" "maralorn" "git" "-C" privatePath "restore" canaryPath) $ \() -> do - nixos_rebuild (paths ++ ["build"] ++ remoteBuildParams ++ fmap toString args) - rm "result" - nixos_rebuild (paths ++ ["switch"] ++ fmap toString args) + nix_build (paths ++ buildSystemParams ++ ["--no-out-link"] ++ remoteBuildParams ++ fmap toString args) &!> StdOut |> nom + nixos_rebuild (paths ++ ["switch"] ++ fmap toString args) &!> StdOut |> nom ''; } diff --git a/nixos/machines/hera/configuration.nix b/nixos/machines/hera/configuration.nix index 7d34c069..7f88d8e0 100644 --- a/nixos/machines/hera/configuration.nix +++ b/nixos/machines/hera/configuration.nix @@ -1,8 +1,4 @@ { config, pkgs, ... }: - -# You need pw-files for every configured user in ./secret/pw-useralias for login to work. -# dropbearkey -t rsa -f /etc/nixos/nixos/machines//secret/boot_rsa - let inherit (config.m-0.private) me; inherit (import ../../../common/common.nix { inherit pkgs; }) syncthing; diff --git a/overlays/testing.nix b/overlays/testing.nix index a02c95a3..4d512e0e 100644 --- a/overlays/testing.nix +++ b/overlays/testing.nix @@ -25,7 +25,7 @@ in { name = "test-system-config"; inherit bins; inherit imports; - } (haskellBody "system" ''nix_build $ ["", "-A", "system"] ++ paths ++ ["-I", [i|nixos-config=#{configDir}/nixos/machines/#{hostname}/configuration.nix|], "-o", [i|result-system-#{hostname}|]] ++ fmap toString args''); + } (haskellBody "system" ''nix_build $ buildSystemParams ++ paths ++ ["-I", [i|nixos-config=#{configDir}/nixos/machines/#{hostname}/configuration.nix|], "-o", [i|result-system-#{hostname}|]] ++ fmap toString args''); test-home-config = self.writeHaskellScript { name = "test-home-config"; diff --git a/overlays/writeHaskellScript.nix b/overlays/writeHaskellScript.nix index 702ce49f..664c9424 100644 --- a/overlays/writeHaskellScript.nix +++ b/overlays/writeHaskellScript.nix @@ -55,6 +55,9 @@ self: super: { tag name str = ["-I", [i|#{name :: Text}=#{str :: Text}|]] :: [String] getNivAssign name = tag name <$> getNivPath path name + buildSystemParams :: [String] + buildSystemParams = ["", "-A", "system"] + remoteBuildParams :: [String] remoteBuildParams = ["--builders", "@/etc/nix/machines", "--max-jobs", "1"]