!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

234 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux https://github.com/orgs/NixOS/teams/risc-v69 Servers

Load older messages


SenderMessageTime
30 Mar 2024
@hive:the-apothecary.clubDagn Hivegit.solarpunk.moe/geekygays/nixconf17:12:33
@hive:the-apothecary.clubDagn Hive* https://git.solarpunk.moe/geekygays/nixconf17:12:41
@alex:tunstall.xyzAlex nixosConfigurations.cmb2.config.system.build.toplevel on branch magrathea?
Let me take a look...
17:20:12
@hive:the-apothecary.clubDagn Hiveyeah the magrathrea branch17:22:01
@hive:the-apothecary.clubDagn Hiveits under systems/riscv64-linux/cmb217:22:36
@alex:tunstall.xyzAlexI can't say I fully understand which of the modules is included in the configuration, but I'll start from there.17:23:22
@alex:tunstall.xyzAlex

Well, I've gotten it to evaluate.

diff --git a/flake.nix b/flake.nix
index a3995c4..837952e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -7,7 +7,7 @@
   };
 
   inputs = {
-    nixpkgs.url = "github:geekygays/nixpkgs";
+    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
     nixos-hardware.url = "github:nixos/nixos-hardware";
     systems.url = "github:geekygays/systems";
 
diff --git a/modules/nixos/core/default.nix b/modules/nixos/core/default.nix
index 75ef1c9..45fbf7e 100644
--- a/modules/nixos/core/default.nix
+++ b/modules/nixos/core/default.nix
@@ -65,7 +65,7 @@
     '';
   };
   environment.systemPackages = with pkgs; [
-    nvd nixpkgs-fmt nix-output-monitor
+    nvd nixpkgs-fmt
     coreutils mime-types file
     usbutils pciutils gitFull git-crypt
   ];

This works for two reasons:

  1. Compiling nix-output-monitor requires GHC.
  2. Your custom Nixpkgs incorporates my ghc-cross branch, which prevents the ShellCheck fix from working.

To compile ShellCheck and nix-output-monitor, you must overlay the default GHC builds to replace them with a usable GHC.

Note that my ghc-cross branch doesn't do all of that; it only makes it possible to build a cross-compiler. Something similar to the example module I wrote into the notes is needed to do that.

(If you don't want to make your flake impure, you can use packages.x86_64-linux instead of builtins.storePath and it won't complain about being unable to build x86_64-linux as long as the output is already in the cache.)

17:51:15
@alex:tunstall.xyzAlex *

Well, I've gotten it to evaluate.

diff --git a/flake.nix b/flake.nix
index a3995c4..837952e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -7,7 +7,7 @@
   };
 
   inputs = {
-    nixpkgs.url = "github:geekygays/nixpkgs";
+    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
     nixos-hardware.url = "github:nixos/nixos-hardware";
     systems.url = "github:geekygays/systems";
 
diff --git a/modules/nixos/core/default.nix b/modules/nixos/core/default.nix
index 75ef1c9..45fbf7e 100644
--- a/modules/nixos/core/default.nix
+++ b/modules/nixos/core/default.nix
@@ -65,7 +65,7 @@
     '';
   };
   environment.systemPackages = with pkgs; [
-    nvd nixpkgs-fmt nix-output-monitor
+    nvd nixpkgs-fmt
     coreutils mime-types file
     usbutils pciutils gitFull git-crypt
   ];

This works for two reasons:

  1. Compiling nix-output-monitor requires GHC.
  2. Your custom Nixpkgs incorporates my ghc-cross branch, which prevents the ShellCheck fix from working.

To compile ShellCheck and nix-output-monitor, you must overlay the default GHC builds to replace them with a usable GHC.

Note that my ghc-cross branch doesn't do all of that; it only makes it possible to build a cross-compiler. Something similar to the example module I wrote into the notes is needed to do that.

(If you don't want to make your flake impure, you can use packages.x86_64-linux instead of builtins.storePath and it won't complain about being unable to build x86_64-linux as long as the output is already in the cache.)

17:52:26
@hive:the-apothecary.clubDagn Hivethank u <333317:58:22
@hive:the-apothecary.clubDagn Hiveur incredible17:58:32
@alex:tunstall.xyzAlex

tau I've been modernising my RISC-V configuration, so I just so happen to have a pure flake that can evaluate GHC. It's not yet done building so I'm not entirely sure it'll work flawlessly on my VF2, but feel free to use it as a reference for how to overlay GHC.

https://github.com/AlexandreTunstall/nixos-riscv

18:06:38
31 Mar 2024
@hive:the-apothecary.clubDagn Hiveright now it's doing an emulated build, and i'm guessing there's no way to get it to do a cross build ?05:45:32
@hive:the-apothecary.clubDagn Hivei don't think nix build has an option for that05:46:16
@hive:the-apothecary.clubDagn Hivei know nix-build does, but i have been able to find a flag for nix build anywhere05:46:37
@alex:tunstall.xyzAlex
In reply to @hive:the-apothecary.club
right now it's doing an emulated build, and i'm guessing there's no way to get it to do a cross build ?

Cross-compiling Haskell packages doesn't work.

I think the main issue is probably that Cabal needs to compile Setup.hs for the build platform, so you can't just instruct it to use a GHC that targets the host platform.

06:29:33
@alex:tunstall.xyzAlex
In reply to @hive:the-apothecary.club
i don't think nix build has an option for that
Nix can cross-compile an entire NixOS system, but not when using flakes unless the flake was specifically written for cross-compilation (e.g. by setting nixpkgs.buildPlatform).
06:35:46
@hive:the-apothecary.clubDagn Hivealright, thanks06:57:41
@hive:the-apothecary.clubDagn Hiveafter a 9 hour build, the build for diffutils failed the overflow checks,,, ;-;20:37:50
@hive:the-apothecary.clubDagn HiveDownload diffutils-log.txt20:39:54
@hive:the-apothecary.clubDagn Hiveit successfully built so i really have no idea why the checks failed20:40:35
@hive:the-apothecary.clubDagn Hivei think i should probably report this bug to nixpkgs20:42:00
@alex:tunstall.xyzAlex

Segmentation fault

Check kernel log.

20:50:16
@hive:the-apothecary.clubDagn Hivewould that be journalctl20:51:00
@alex:tunstall.xyzAlex
journalctl -ek

If on a systemd distribution (like NixOS)

20:51:22
@alex:tunstall.xyzAlexAt the very least those logs should tell you exactly which process segfaulted and a bit of information about what exactly it tried to do.20:54:10
@hive:the-apothecary.clubDagn Hivei'm not seeing any segfaults in the logs20:56:37
@hive:the-apothecary.clubDagn Hive https://github.com/NixOS/nixpkgs/issues/300550 20:58:15
@hive:the-apothecary.clubDagn Hivei'll try to get it to crash again and see if i can find it20:58:26
@hive:the-apothecary.clubDagn Hivewould it show up in dmesg ?20:58:37
@alex:tunstall.xyzAlex On the system that ran the build?
There should definitely be something there at the timestamp at which it crashed...
20:58:46

Show newer messages


Back to Room ListRoom Version: 10