| 30 Mar 2024 |
hive ⬡ | wowee | 00:10:45 |
| @jackleightcap:matrix.org joined the room. | 00:11:01 |
Alex | Just a few months ago I noticed that my system was using the powersave CPU frequency scaling driver instead of amd-pstate. Changing that made things significantly faster. If you're on an AMD CPU, maybe you have the same problem? | 00:15:17 |
hive ⬡ | we do have the server set to powersave mode, so it's probably something similar, but i don't think we could afford to run it without it | 00:15:53 |
hive ⬡ | oh well | 00:16:01 |
Alex | IIRC powersave means it will always use the min frequency | 00:16:35 |
hive ⬡ | ye | 00:16:39 |
hive ⬡ | tbh after thinking it over, it's probably costing more to have the server running this long, so i will probably turn power saver off after this | 00:17:47 |
Alex | On the other hand lower cpufreq should be more power efficient (due to lower core temperatures).
I guess if you wanted to maximise power efficiency the only way of finding the sweet spot is a lot of benchmarking. | 00:20:04 |
hive ⬡ | yeah | 00:26:32 |
| @shalokshalom:kde.org left the room. | 00:27:37 |
hive ⬡ | In reply to @skeuchel:matrix.org
tau: Here is a minimal flake that at least evaluates
{
inputs = {
nixpkgs.url = "github:AlexandreTunstall/nixpkgs/ghc-cross";
};
outputs = { nixpkgs, ... }:
{
nixosConfigurations.riscv64 = nixpkgs.lib.nixosSystem {
modules = [({lib, pkgs, ...}: {
nixpkgs.crossSystem.system = "riscv64-linux";
nixpkgs.localSystem.system = "x86_64-linux";
environment.systemPackages = [
pkgs.haskell.compiler.native-bignum.ghc948
];
# Dummy values
fileSystems."/".device = lib.mkDefault "/dev/sda1";
boot.loader.grub.device = lib.mkDefault "/dev/sda";
})];
};
};
}
Maybe you can use that to figure out what is going wrong.
i really don't understand why it's not building, i added the crossSystem and localSystem options,
┏━ 1 Errors:
⋮
┃ 182| buildCommand = ''
┃ | ^
┃ 183| mkdir -p $out/nix-support $out/sd-image
┃
┃ (stack trace truncated; use '--show-trace' to show the full trace)
┃
┃ error: Package ‘ghc-9.6.4’ in /nix/store/y45vqv6pa8bhgag1dw86rvi6rk55xhxn-source/pkgs/development/compilers/ghc/common-hadrian.nix:525 is not available o…
┃ hostPlatform.config = "riscv64-unknown-linux-gnu"
┃ package.meta.platforms = [
┃ "aarch64-darwin"
┃ "aarch64-linux"
┃ "i686-linux"
┃ "x86_64-darwin"
┃ "x86_64-linux"
┃ ]
┃ package.meta.badPlatforms = [ ]
┃ , refusing to evaluate.
┃
┃ a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
┃ for a single invocation of the nix tools.
┃
┃ $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
┃
┃ Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
┃ then pass `--impure` in order to allow use of environment variables.
┃
┃ b) For `nixos-rebuild` you can set
┃ { nixpkgs.config.allowUnsupportedSystem = true; }
┃ in configuration.nix to override this.
┃
┃ c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
┃ { allowUnsupportedSystem = true; }
┃ to ~/.config/nixpkgs/config.nix.
┣━━━
┗━ ∑ ⚠ Exited with 1 errors reported by nix at 00:52:48 after 7s
| 00:54:58 |
hive ⬡ | ┏━ 1 Errors:
┃ error:
┃ … while calling the 'derivationStrict' builtin
┃
┃ at /derivation-internal.nix:9:12:
┃
┃ 8|
┃ 9| strict = derivationStrict drvAttrs;
┃ | ^
┃ 10|
┃
┃ … while evaluating derivation 'nixos-sd-image-24.05.20240327.2726f12-riscv64-linux-starfive-visionfive2.img'
┃ whose name attribute is located at /nix/store/y45vqv6pa8bhgag1dw86rvi6rk55xhxn-source/pkgs/stdenv/generic/make-derivation.nix:331:7
┃
┃ … while evaluating attribute 'buildCommand' of derivation 'nixos-sd-image-24.05.20240327.2726f12-riscv64-linux-starfive-visionfive2.img'
┃
┃ at /nix/store/y45vqv6pa8bhgag1dw86rvi6rk55xhxn-source/nixos/modules/installer/sd-card/sd-image.nix:182:7:
┃
┃ 181|
┃ 182| buildCommand = ''
┃ | ^
┃ 183| mkdir -p $out/nix-support $out/sd-image
┃
┃ (stack trace truncated; use '--show-trace' to show the full trace)
┃
┃ error: cannot bootstrap GHC on this platform ('riscv64-linux' with libc 'defaultLibc')
┣━━━
┗━ ∑ ⚠ Exited with 1 errors reported by nix at 00:53:28 after 6s
( when adding the --impure flag ) | 00:55:41 |
hive ⬡ | if cross compilation is supported, why do i keep getting this error ? it's really frustrating | 00:56:48 |
hive ⬡ | ok even after i've built ghc locally | 02:01:47 |
hive ⬡ | and i've set the nixpkgs to alexandretunstall/nixpkgs/ghc-cross-usable | 02:01:54 |
hive ⬡ | it still saying cannot bootstrap ghc on this platform | 02:02:08 |
hive ⬡ | i do not understand what is going on | 02:02:13 |
Alex | It looks like you're missing the overlay that replaces the Nixpkgs GHCs with those based off of the cross-compiled GHC.
Do you have a link to a reproducer I can look at? | 07:46:13 |
hive ⬡ | git.solarpunk.moe/geekygays/nixconf | 17:12:33 |
hive ⬡ | * https://git.solarpunk.moe/geekygays/nixconf | 17:12:41 |
Alex | nixosConfigurations.cmb2.config.system.build.toplevel on branch magrathea?
Let me take a look... | 17:20:12 |
hive ⬡ | yeah the magrathrea branch | 17:22:01 |
hive ⬡ | 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 |
hive ⬡ | thank u <3333 | 17:58:22 |
hive ⬡ | 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 |