NixOS support for CM4

Thanks for the pointer. I’m in the process of grafting your code into my flake set up (based on this) so i can use it with nixos-generators

boot = {
    kernelPackages = pkgs.unstable.callPackages kernelPackagesCfg {};
};
1 Like

so, the issue was the stable vs unstable (there are some backported patches in stable linux-rpi kernel). solutions: upgrade the build machine to unstable or… I have to pin the linux-rpi unstable in uc/kernel.

It seems that 24.11 has since been released. Does this change the situation at all re: stable / unstable / pinning?

@jDmacD

Thanks for the pointer. I’m in the process of grafting your code into my flake set up (based on this) so i can use it with nixos-generators

How did this go? Any chance we can get a link to your flake config?

I am sharing my sway-based configuration, which is a fork of the oom-hardware repo. It’s still a work in progress, but feel free to follow the repo.

1 Like

I dig this Thread :slight_smile: my uConsole is Running NixOS, and it even rebuilds successfully. But the kernel takes an eternity to build. I would like to integrate ccache into the build but a simple

 programs.ccache.enable = true;
 nix.sandboxPaths = [ (toString config.programs.ccache.cacheDir) ];

Didn’t do the trick. Anyone tried something similar and is willing to share?

I haven’t been tried this personally yet, but it looks like there are 2 ways to go about it.

  1. Enable ccache for specific packages
    This is essentially what you have already I think you just need to set programs.ccache.packageNames.
  2. Enable ccache system wide.
    There’s an example overlay on the nixos wiki for this
    CCache - NixOS Wiki

However I am quite new to nix so I could be completely wrong.

Reference: CCache system wide? - #2 by Atemu - Help - NixOS Discourse

Update: This seems to work.

programs.ccache = {
    enable = true;
    packageNames = [ "linux_rpi4" ];
};
nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ];

But you need to rebuild twice, the first for the ccache to be applied, the second to use the ccache

Thanks so much for this, I’m a complete nixos noob, ran all sorts of linux distros over the past 20 years but never tried Nix, It’s taken me a couple of days to work out what it’s all about but final it’s building :grin: I’m sure I’ll have question’s but just thought I’d say Hi and thanks, great work :+1:.

this is why there is a remote cache in my repo - I try to push the binary kernel to the cache to speedup the rebuilding the kernels. I will soon move it to the new more capable server, but it will be still public.

I try to not do the builds on the uConsole - instead I use remote builders (my workstation, the kernel rebuild time is about 10-15 minutes, which is acceptable ((-; )

(today’s is my first “free” day when I can read the forum ((-; since a month or so).

about the ccache: it’s a great idea, but you have to override stdenv or add the packages to programs.ccache.packageNames

1 Like

I’m having problems, if i make any changes to the config that doesn’t involve the kernel, running “nixos-rebuild switch” builds it fine. but if i have to build the kernel it doesn’t finish (just hangs after about 4 hours). I’m not near my uConsole until later today, what log or info would you need to see why this happens? sorry for my noobness but nix is new to me :sweat_smile:. Thanks in advance, Steve

i obviously need to do some more research, but perhaps someone here could help me too. I don’t think I understand how this all works yet. I have started fresh installs several times and had different results each time :man_facepalming: . I managed to set up my user account and install cinnamon desktop environment, but I had problems with the sudo command not working to edit some root files, so i thought I’d try again afresh but now I don’t seem to be able to rebuild without it building the kernel (which never finishes, hangs after several hours). I know I did manage to rebuild a few times (editing the configuration.nix file) without the kernel being built on one of my attempts but now even without editing anything just installing nixos then logging in as root (no password) then doing “nixos-rebuild switch” it attempts to builds the kernel and fails.

edit: sorry, looks like I can’t follow basic instructions. all sorted.

What was your issue in the end? Just incase someone else ends up having the same issue

1 Like

I forgot the “nix-channel --update” before building.
Thanks so much for this guy’s, it’s amazing. now running kde plasma5.

there was a issue with linux_rpi4 kernel a couple of commits ago.

it was fixed in nixos-unstable branch:

and in my repo:

living on the bleeding edge is always fun ((-;

1 Like

BTW, next week I will receive the CM5 Development KIT and the CM5W-8GBLITE module - between the flights I will try to make a uc-cm5 kernel and image.

2 Likes

awesome, i have the cm5 emmc 32gb version. so looking forward to see what you can do :grin:.

remember: always do two backups ((-; I have to rebuild my binary cache to new machine and unfortunately (due to broken backup) the public key changed… If you use my binary cache please change your config:

    nix.settings.substituters = ["https://cache-nix.project2.xyz/uconsole"];
    nix.settings.trusted-substituters = ["https://cache-nix.project2.xyz/uconsole"];
    nix.settings.trusted-public-keys = ["uconsole:vvqOLjqEwTJBUqv1xdndD1YHcdlMc/AnfAz4V9Hdxyk="];
1 Like

got the CM5 dev kit:

unfortunately aarch64 image do not support RPi5 (yet!). it will take more than I planned ;/ ((-;

I downloaded this image, and I want to know what the default username and password for this system are.

current image: (advice: I do not archive previous images ((-; )

https://test.project2.xyz/uc-cm4/nixos-sd-uconsole-cm4-020625.img.zst

try login to root without any password ((-; make your changes to the configs in /etc/nixos/ and setup your own password.

Excuse me, could you please help me solve the network issue? This is my first time using NixOS, and I’m not very familiar with it. I’ve already flashed the NixOS image you provided to the SD card and successfully booted it, but I don’t know how to connect to Wi-Fi. Thank you very much!