From 48c09b2cf2a163b6cc1666385a222f3943f1fd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Sat, 1 Jul 2023 16:34:23 +0200 Subject: [PATCH 1/3] Pass `--extra-experimental-features` where necessary --- src/Nix.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Nix.hs b/src/Nix.hs index a105c3f..3a6a154 100644 --- a/src/Nix.hs +++ b/src/Nix.hs @@ -67,7 +67,7 @@ nixEvalApply :: ExceptT Text m Text nixEvalApply applyFunc attrPath = ourReadProcess_ - (proc (binPath <> "/nix") (["eval", ".#" <> T.unpack attrPath, "--apply", T.unpack applyFunc])) + (proc (binPath <> "/nix") (["--extra-experimental-features", "nix-command", "--extra-experimental-features", "flakes", "eval", ".#" <> T.unpack attrPath, "--apply", T.unpack applyFunc])) & fmapRT (fst >>> T.strip) nixEvalApplyRaw :: @@ -77,7 +77,7 @@ nixEvalApplyRaw :: ExceptT Text m Text nixEvalApplyRaw applyFunc attrPath = ourReadProcess_ - (proc (binPath <> "/nix") (["eval", ".#" <> T.unpack attrPath, "--raw", "--apply", T.unpack applyFunc])) + (proc (binPath <> "/nix") (["--extra-experimental-features", "nix-command", "--extra-experimental-features", "flakes", "eval", ".#" <> T.unpack attrPath, "--raw", "--apply", T.unpack applyFunc])) & fmapRT (fst >>> T.strip) nixEvalExpr :: @@ -86,7 +86,7 @@ nixEvalExpr :: ExceptT Text m Text nixEvalExpr expr = ourReadProcess_ - (proc (binPath <> "/nix") (["eval", "--expr", T.unpack expr])) + (proc (binPath <> "/nix") (["--extra-experimental-features", "nix-command", "eval", "--expr", T.unpack expr])) & fmapRT (fst >>> T.strip) -- Error if the "new version" is actually newer according to nix @@ -136,7 +136,7 @@ lookupAttrPath updateEnv = getDerivationFile :: MonadIO m => Text -> ExceptT Text m Text getDerivationFile attrPath = do npDir <- liftIO $ Git.nixpkgsDir - proc "env" ["EDITOR=echo", (binPath <> "/nix"), "edit", attrPath & T.unpack, "-f", "."] + proc "env" ["EDITOR=echo", (binPath <> "/nix"), "--extra-experimental-features", "nix-command", "edit", attrPath & T.unpack, "-f", "."] & ourReadProcess_ & fmapRT (fst >>> T.strip >>> T.stripPrefix (T.pack npDir <> "/") >>> fromJust) @@ -186,7 +186,7 @@ buildCmd attrPath = silently $ proc (binPath <> "/nix-build") (nixBuildOptions ++ ["-A", attrPath & T.unpack]) log :: Text -> ProcessConfig () () () -log attrPath = proc (binPath <> "/nix") ["log", "-f", ".", attrPath & T.unpack] +log attrPath = proc (binPath <> "/nix") ["--extra-experimental-features", "nix-command", "log", "-f", ".", attrPath & T.unpack] build :: MonadIO m => Text -> ExceptT Text m () build attrPath = From cdd91540e661c41eb433a66cd65351835e40724c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Sat, 1 Jul 2023 16:41:25 +0200 Subject: [PATCH 2/3] Document need for `upstream` origin. See #137 --- doc/interactive-updates.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/interactive-updates.md b/doc/interactive-updates.md index 3ad754c..b60d754 100644 --- a/doc/interactive-updates.md +++ b/doc/interactive-updates.md @@ -14,10 +14,14 @@ nixpkgs-update supports interactive, single package updates via the no longer uses `hub` itself). 2. Go to your local checkout of nixpkgs, and **make sure the working directory is clean**. Be on a branch you are okay committing to. -3. Run it like: `nixpkgs-update update "postman 7.20.0 7.21.2"` +3. Ensure that there is an Git origin called `upstream` which points to nixpkgs: + ```sh + git remote add upstream "https://github.com/NixOS/nixpkgs.git" + ``` +4. Run it like: `nixpkgs-update update "postman 7.20.0 7.21.2"` which mean update the package "postman" from version 7.20.0 to version 7.21.2. -4. It will run the updater, and, if the update builds, it will commit +5. It will run the updater, and, if the update builds, it will commit the update and output a message you could use for a pull request. # Flags From cee6ef0c1ea3b777f8deaa911123e11220d2064b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Sat, 1 Jul 2023 16:47:47 +0200 Subject: [PATCH 3/3] Pass `--no-out-link` to `nix-build` --- src/Utils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Utils.hs b/src/Utils.hs index 24cd434..e00f96d 100644 --- a/src/Utils.hs +++ b/src/Utils.hs @@ -253,7 +253,8 @@ nixBuildOptions :: [String] nixBuildOptions = [ "--option", "sandbox", - "true" + "true", + "--no-out-link" -- do not pollute current directory with `result` symlink ] <> nixCommonOptions