| 30 Mar 2024 |
👉@crystallinefire:chat.solarpunk.moe | its under systems/riscv64-linux/cmb2 | 17:22:36 |
Alex | I 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 | 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:
- Compiling
nix-output-monitor requires GHC.
- 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 | * 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:
- Compiling
nix-output-monitor requires GHC.
- 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 |
👉@crystallinefire:chat.solarpunk.moe | thank u <3333 | 17:58:22 |
👉@crystallinefire:chat.solarpunk.moe | ur incredible | 17:58:32 |
Alex | 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 |
👉@crystallinefire:chat.solarpunk.moe | right 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 |
👉@crystallinefire:chat.solarpunk.moe | i don't think nix build has an option for that | 05:46:16 |
👉@crystallinefire:chat.solarpunk.moe | i know nix-build does, but i have been able to find a flag for nix build anywhere | 05:46:37 |
Alex | 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 | 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 |
👉@crystallinefire:chat.solarpunk.moe | alright, thanks | 06:57:41 |
👉@crystallinefire:chat.solarpunk.moe | after a 9 hour build, the build for diffutils failed the overflow checks,,, ;-; | 20:37:50 |
👉@crystallinefire:chat.solarpunk.moe | Download diffutils-log.txt | 20:39:54 |
👉@crystallinefire:chat.solarpunk.moe | it successfully built so i really have no idea why the checks failed | 20:40:35 |
👉@crystallinefire:chat.solarpunk.moe | i think i should probably report this bug to nixpkgs | 20:42:00 |
Alex |
Segmentation fault
Check kernel log. | 20:50:16 |
👉@crystallinefire:chat.solarpunk.moe | would that be journalctl | 20:51:00 |
Alex | journalctl -ek
If on a systemd distribution (like NixOS) | 20:51:22 |
Alex | At 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 |
👉@crystallinefire:chat.solarpunk.moe | i'm not seeing any segfaults in the logs | 20:56:37 |
👉@crystallinefire:chat.solarpunk.moe | https://github.com/NixOS/nixpkgs/issues/300550 | 20:58:15 |
👉@crystallinefire:chat.solarpunk.moe | i'll try to get it to crash again and see if i can find it | 20:58:26 |
👉@crystallinefire:chat.solarpunk.moe | would it show up in dmesg ? | 20:58:37 |
Alex | On the system that ran the build?
There should definitely be something there at the timestamp at which it crashed... | 20:58:46 |
Alex | I don't know, I never use dmesg | 20:58:55 |
👉@crystallinefire:chat.solarpunk.moe | yeah on the system that ran the build | 21:00:23 |
👉@crystallinefire:chat.solarpunk.moe | to be fair i don't really know what i'm looking for | 21:00:29 |
👉@crystallinefire:chat.solarpunk.moe | i skimmed the logs and tried to / search for SEG or FAULT but i couldn't find anything | 21:00:48 |