!sBfrWMVsLoSyFTCkNv:nixos.org

OfBorg

166 Members
Number of builds and evals in queue: <TBD>62 Servers

Load older messages


SenderMessageTime
7 Jul 2021
@cole-h:matrix.orgcole-hAppreciate it, thanks.21:23:49
@andi:kack.itandi-gonna take a while. Eval is super slow on this machine for whatever reason. Might just be the newer Nix :/21:24:47
@cole-h:matrix.orgcole-hAll good. I've rolled back the darwin machine to the previous generation for the moment.21:25:06
@andi:kack.itandi-

cole-h:

   Compiling bitvec v0.19.5
diff --git a/default.nix b/default.nix
index 644ebb0..8d1ff6f 100644
--- a/default.nix
+++ b/default.nix
@@ -4,6 +4,8 @@
 }:

 let
+  inherit (pkgs) lib;
+
   pkg = pkgs.rustPlatform.buildRustPackage {
     name = "ofborg";
     src = pkgs.nix-gitignore.gitignoreSource [] ./.;
@@ -15,7 +17,10 @@ let

     buildInputs = with pkgs; [
       openssl
-    ];
+    ] ++ lib.optional pkgs.stdenv.isDarwin (with pkgs; [
+      darwin.apple_sdk.frameworks.Security
+      darwin.apple_sdk.frameworks.CoreFoundation
+    ]);

     preBuild = ''
       cargo clippy
21:33:47
@andi:kack.itandi- *

cole-h:

diff --git a/default.nix b/default.nix
index 644ebb0..8d1ff6f 100644
--- a/default.nix
+++ b/default.nix
@@ -4,6 +4,8 @@
 }:

 let
+  inherit (pkgs) lib;
+
   pkg = pkgs.rustPlatform.buildRustPackage {
     name = "ofborg";
     src = pkgs.nix-gitignore.gitignoreSource [] ./.;
@@ -15,7 +17,10 @@ let

     buildInputs = with pkgs; [
       openssl
-    ];
+    ] ++ lib.optional pkgs.stdenv.isDarwin (with pkgs; [
+      darwin.apple_sdk.frameworks.Security
+      darwin.apple_sdk.frameworks.CoreFoundation
+    ]);

     preBuild = ''
       cargo clippy
21:33:54
@sandro:supersandro.deSandroWhy not use with pkgs once at the beginning?21:34:44
@cole-h:matrix.orgcole-hThanks Andi21:35:06
@cole-h:matrix.orgcole-h withs with large scopes are not fun to debug :) 21:35:23
@andi:kack.itandi-to keep the namespace sane and not pollute whatever someone might merge with little review into the scope. It makes it easier to reason about.21:35:24
@piegames:matrix.orgpiegames I'm really not fond of with statements because they are glob imports, but they have a valid use case in lists of packages. 21:36:18
* @piegames:matrix.orgpiegames would really like to have an import statement that allows to write lib.foo without having to do with pkgs;21:36:50
@sandro:supersandro.deSandroHaving with pkgs on every other line is just noise and makes the file not easily copyable into nixpkgs.21:37:26
@andi:kack.itandi- inherit (pkgs) lib? 21:37:24
@piegames:matrix.orgpiegames Obvious hacky workaround: with { lib = pkgs.lib; }; 21:37:32
@piegames:matrix.orgpiegames
In reply to @andi:kack.it
inherit (pkgs) lib?
Oh I see. I didn't know this was applicable in let bindings as well, I thought I had to write let lib = pkgs.lib(to be fair, they are more or less equally bad)
21:38:51
@cole-h:matrix.orgcole-h %s/with pkgs; ?// is pretty easy if you want to copy into Nixpkgs ;) 21:39:16
@cole-h:matrix.orgcole-h But I prefer sparse withs to global withs. 21:39:34
@sandro:supersandro.deSandroThat won't work. You still have some () around21:40:02
@cole-h:matrix.orgcole-hParens don't hurt. Might not be pretty, but21:40:26
@cole-h:matrix.orgcole-h Anyways, I don't plan on changing to use one large with pkgs; at the top (nor will I accept a change doing so). 21:40:49
@cole-h:matrix.orgcole-h * Either way, I don't plan on changing to use one large with pkgs; at the top (nor will I accept a change doing so). 21:40:53
@andi:kack.itandi-

Perhaps this is cleaner:

diff --git a/default.nix b/default.nix
index 644ebb0..ed618f0 100644
--- a/default.nix
+++ b/default.nix
@@ -4,25 +4,39 @@
 }:

 let
-  pkg = pkgs.rustPlatform.buildRustPackage {
+  inherit (pkgs) lib;
+
+  pkg = pkgs.callPackage ({ lib
+  , stdenv
+  , rustPlatform
+  , pkgconfig
+  , rustPackages
+  , darwin
+  , nix-gitignore
+  , openssl
+  , nix
+  }: rustPlatform.buildRustPackage {
     name = "ofborg";
-    src = pkgs.nix-gitignore.gitignoreSource [] ./.;
+    src = nix-gitignore.gitignoreSource [] ./.;

-    nativeBuildInputs = with pkgs; [
+    nativeBuildInputs = [
       pkgconfig
       pkgs.rustPackages.clippy
     ];

-    buildInputs = with pkgs; [
+    buildInputs = [
       openssl
-    ];
+    ] ++ lib.optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+      Security
+      CoreFoundation
+    ]);

     preBuild = ''
       cargo clippy
     '';

     doCheck = false; # Tests require access to a /nix/ and a nix daemon
-    checkInputs = with pkgs; [
+    checkInputs = [
       nix
     ];

@@ -32,7 +46,7 @@ let
         "hubcaps-0.3.16" = "1p7rn8y71fjwfag65437gz7a56pysz9n69smaknvblyxpjdzmh4d";
       };
     };
-  };
+  }) {};
21:42:49
@cole-h:matrix.orgcole-h andi-: Thanks -- the darwin machine is back up :) 21:59:02
@andi:kack.itandi-the one single darwin machine. That is a nice summary of Darwin support ;-)21:59:30
@cole-h:matrix.orgcole-hlol21:59:35
@andi:kack.itandi-did you also deploy the PHP part? That is the one I am scare about22:00:16
@andi:kack.itandi-I never ever tried running that22:00:24
@cole-h:matrix.orgcole-hYep, everything is totally deployed :P22:00:26
@cole-h:matrix.orgcole-hofborg is responding to PR's, so I believe that the PHP stuff is all good22:02:04
@andi:kack.itandi-fascinating22:02:15

Show newer messages


Back to Room ListRoom Version: 6