| 14 Jul 2023 |
| @lehmanator:gnulinux.club joined the room. | 18:42:50 |
Artturin | In reply to @arianvp:matrix.org
I have
nixConfig = {
substituters = [ "https://cache.garnix.io" ];
trusted-public-keys = [ "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" ];
};
in my flake and I accepted the options
but nix show-config doesnt show the settings in the shell :
(nix:shell-env) Arians-MacBook-Pro:server-optimised-nixos arian$ nix show-config
accept-flake-config = false
access-tokens =
allow-dirty = true
allow-import-from-derivation = true
allow-symlinked-store = false
allow-unsafe-native-code-during-evaluation = false
allowed-impure-host-deps = /System/Library /bin/sh /dev /usr/lib
allowed-uris =
allowed-users = *
auto-allocate-uids = false
auto-optimise-store = true
bash-prompt =
bash-prompt-prefix = (nix:$name)\040
bash-prompt-suffix =
build-hook = /nix/var/nix/profiles/default/bin/nix __build-remote
build-poll-interval = 5
build-users-group = nixbld
builders = @/etc/nix/machines
builders-use-substitutes = false
commit-lockfile-summary =
compress-build-log = true
connect-timeout = 0
cores = 12
darwin-log-sandbox-violations = false
diff-hook =
download-attempts = 5
download-speed = 0
eval-cache = true
experimental-features = flakes nix-command
extra-platforms = x86_64-darwin
fallback = false
flake-registry = https://channels.nixos.org/flake-registry.json
fsync-metadata = true
gc-reserved-space = 8388608
hashed-mirrors =
http-connections = 25
http2 = true
id-count = 128
ignore-try = false
impersonate-linux-26 = false
keep-build-log = true
keep-derivations = true
keep-env-derivations = false
keep-failed = false
keep-going = false
keep-outputs = false
log-lines = 10
max-build-log-size = 0
max-free = 18446744073709551615
max-jobs = 1
max-silent-time = 0
min-free = 0
min-free-check-interval = 5
nar-buffer-size = 33554432
narinfo-cache-negative-ttl = 3600
narinfo-cache-positive-ttl = 2592000
netrc-file = /etc/nix/netrc
nix-path = /Users/arian/.nix-defexpr/channels nixpkgs=flake:nixpkgs
plugin-files =
post-build-hook =
pre-build-hook =
preallocate-contents = false
print-missing = true
pure-eval = true
require-sigs = true
restrict-eval = false
run-diff-hook = false
sandbox = false
sandbox-fallback = true
sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /bin/bash /bin/sh /private/tmp /private/var/tmp /usr/lib
secret-key-files =
show-trace = false
stalled-download-timeout = 300
start-id = 56930
store = auto
substitute = true
substituters = https://cache.nixos.org/
sync-before-registering = false
system = aarch64-darwin
system-features = benchmark big-parallel nixos-test
tarball-ttl = 3600
timeout = 0
trace-function-calls = false
trace-verbose = false
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
trusted-substituters =
trusted-users = root arian
use-case-hack = true
use-registries = true
use-sqlite-wal = true
user-agent-suffix =
warn-dirty = true
They're used only in the flake not in the shell IIRC | 23:03:26 |
Artturin | Yep https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html?highlight=Nixconfig#flake-format | 23:05:10 |
| 15 Jul 2023 |
| @ek_is_anika:tchncs.de joined the room. | 12:19:52 |
| @2xsaiko:tchncs.de changed their profile picture. | 18:53:19 |
| 16 Jul 2023 |
| @windchimesofmagic:matrix.org joined the room. | 02:36:11 |
| @ek_is_anika:tchncs.de changed their display name from Anika (not new to matrix btw) to Anika (prev. known as Hayley). | 19:07:41 |
| 18 Jul 2023 |
| antimimonpneumatos joined the room. | 06:55:03 |
| 19 Jul 2023 |
| @ek_is_anika:tchncs.de changed their display name from Anika (prev. known as Hayley) to Anika. | 12:56:03 |
| 20 Jul 2023 |
| Carl Thomé joined the room. | 22:09:03 |
| 23 Jul 2023 |
| El_Zarco changed their display name from El_Zarco to Zarco. | 01:07:33 |
| El_Zarco changed their display name from Zarco to zarco. | 02:46:22 |
| docsunset joined the room. | 16:43:24 |
| 24 Jul 2023 |
| catenane joined the room. | 03:42:01 |
| 25 Jul 2023 |
| eric joined the room. | 01:21:17 |
| @federicodschonborn:matrix.org changed their profile picture. | 01:56:54 |
moots | how do i crossbuild a flake nixosconfiguration to aarch64 from x86 on none nixos? | 16:41:18 |
moots |
flake.nixosConfigurations."naked-oci" = withSystem "aarch64-linux" (ctx@{ pkgs,config, inputs', ... }:
inputs.nixpkgs.lib.nixosSystem {
# Expose `packages`, `inputs` and `inputs'` as module arguments.
# Use specialArgs permits use in `imports`.
# Note: if you publish modules for reuse, do not rely on specialArgs, but
# on the flake scope instead. See also https://flake.parts/define-module-in-separate-file.html
specialArgs = {
packages = config.packages;
inherit inputs inputs';
pkgs = pkgs.pkgsCross.aarch64-multiplatform;
};
modules = [
# This module could be moved into a separate file; otherwise we might
# as well have used ctx.config.packages directly.
({ config, lib, packages, pkgs, ... }: {
imports = [
inputs.disko.nixosModules.disko
];
nixpkgs.hostPlatform = "aarch64-linux";
...
tried like that error: a 'aarch64-linux' with features {} is required to build '/nix/store/8zwd7397wqs1dsw6j3v11jkfaivlspc3-aarch64-unknown-linux-gnu-binutils-wrapper-2.40.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test, uid-range}
| 16:42:26 |
@ulli:hrnz.li | just like you would to without flakes. Flakes do nothing for cross-compilation | 16:42:54 |
| nf changed their profile picture. | 16:43:10 |
@ulli:hrnz.li | (i.e. use a nixpkgs instantiated with the correct build and host platforms) | 16:43:57 |
@ulli:hrnz.li | if you don't pass pkgs to nixosSystem, you can use the nixpkgs nixos module for that | 16:44:15 |
@ulli:hrnz.li | if you do pass pkgs to nixosSystem, this pkgs needs to be correctly instantiated | 16:44:34 |
moots | hmm guess i have to dig into flake-parts | 16:48:06 |
moots | cause im not sure where i can edit the pkgs var which it uses | 16:51:10 |
@ulli:hrnz.li | you want to pass pkgs directly to nixosSystem, and not inside specialArgs (which will probably be ignored) | 16:56:02 |
@2xsaiko:tchncs.de | moots: hrnz already said it, but specifically you should just be able to set these nixos options and that's all you need, keep the rest like a non-cross system
{
nixpkgs.buildPlatform = "x86_64-linux";
nixpkgs.hostPlatform = "aarch64-linux";
}
| 17:16:39 |
@2xsaiko:tchncs.de | I feel like setting pkgs like that will prevent e.g. nixpkgs.overlays from working | 17:17:04 |
@ulli:hrnz.li | yes, when pkgs is passed to nixosSystem, everything in the nixpkgs nixos-module won't have any effect anymore | 17:17:54 |
moots | In reply to @2xsaiko:tchncs.de
moots: hrnz already said it, but specifically you should just be able to set these nixos options and that's all you need, keep the rest like a non-cross system
{
nixpkgs.buildPlatform = "x86_64-linux";
nixpkgs.hostPlatform = "aarch64-linux";
}
that doesnt work, and i havent figured out yet how to change nixpkgs before its passed to the nixos config when using flake-parts withsystem | 17:21:55 |