Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nix to nix 2.13 #1026

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dep/nixpkgs_unstable/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DO NOT HAND-EDIT THIS FILE
import (import ./thunk.nix)
7 changes: 7 additions & 0 deletions dep/nixpkgs_unstable/github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"owner": "NixOS",
"repo": "nixpkgs",
"private": false,
"rev": "22ce075f1c3ffb413dfc53b10ff3e577b5b15941",
"sha256": "1pgxmdw7qi5kq1jn9fq1jfv757y67rfgkid2zkip8licyghlgdr1"
}
12 changes: 12 additions & 0 deletions dep/nixpkgs_unstable/thunk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT HAND-EDIT THIS FILE
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
in fetch json
4 changes: 2 additions & 2 deletions haskell-overlays/obelisk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ in
librarySystemDepends = [
pkgs.jre
pkgs.git
pkgs.nix
pkgs.nixpkgs_unstable.nixVersions.nix_2_13
pkgs.nix-prefetch-git
pkgs.openssh
pkgs.rsync
Expand All @@ -38,7 +38,7 @@ in
pkgs.cabal-install
pkgs.coreutils
pkgs.git
pkgs.nix
pkgs.nixpkgs_unstable.nixVersions.nix_2_13
pkgs.nix-prefetch-git
pkgs.rsync
];
Expand Down
6 changes: 5 additions & 1 deletion lib/command/src/Obelisk/Command/Project.hs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ filePermissionIsSafe s umask = not fileWorldWritable && fileGroupWritable <= uma
nixShellRunConfig :: MonadObelisk m => FilePath -> Bool -> Maybe String -> m NixShellConfig
nixShellRunConfig root isPure command = do
nixpkgsPath <- fmap T.strip $ readProcessAndLogStderr Debug $ setCwd (Just root) $
proc nixExePath ["eval", "(import .obelisk/impl {}).nixpkgs.path"]
proc nixExePath ["eval", "--impure", "--expr", "(import .obelisk/impl {}).nixpkgs.path"]
nixRemote <- liftIO $ lookupEnv "NIX_REMOTE"
pure $ def
& nixShellConfig_pure .~ isPure
Expand Down Expand Up @@ -383,8 +383,12 @@ findProjectAssets root = do
isDerivation <- readProcessAndLogStderr Debug $ setCwd (Just root) $
proc nixExePath
[ "eval"
, "--impure"
, "--expr"
, "(let a = import ./. {}; in toString (a.reflex.nixpkgs.lib.isDerivation a.passthru.staticFilesImpure))"
, "--raw"
-- `--expr` and `--impure` are a side-effect of a newer nix version
-- `nix eval` is no longer the same as 2.3
-- `--raw` is not available with old nix-instantiate. It drops quotation
-- marks and trailing newline, so is very convenient for shelling out.
]
Expand Down
2 changes: 2 additions & 0 deletions nixpkgs-overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ in {
lib.cleanSource (gitignoreSource src);

obeliskExecutableConfig = self.callPackage ../lib/executable-config {};

nixpkgs_unstable = import ../dep/nixpkgs_unstable { };
}