I originally thought a monorepo was the way to go here and, although it
worked, I do want to keep this config as simple as possible for people
that just want to see how to set up Hyprland/dwm on NixOS.
For those curious in running NixOS on a phone specifically, there will
soon be a separate mobile-config repository that should make learning
from it easier.
It turns out that sharing this config with the server isn't actually
that useful, especially since nix makes it easy to run any program in
nixpkgs on demand.
This makes it possible to build a custom NixOS installer iso with the
tools I want. Ideally I get to a point where I can use the iso like a
live cd with Hyprland and/or dwm installed with everything already
configured.
Build the iso with the following command:
```
nix build .#nixosConfigurations.iso.config.system.build.isoImage
```
Then, use qemu to test the iso:
```
qemu-system-x86_64 -enable-kvm -m 256 -cdrom ./result/iso/nixos-*
```
Using @attrs for the flake was cool at first, but this doesn't actually
work if we want to use our nix-config inside NixOS containers due to how
`self` works.
Because of this, it's easier to simply ban @attrs altogether and use
`nix-config` for everything since it's possible to access *all* the
inputs of nix-config from itself instead of having to manually inherit
each input we want (which could be any of them).
Previously we used a mobile-nixos config without the mobile-nixos
modules to start up a QEMU virtual machine on x86_64-linux without
having to worry about cross-compiling aarch64-linux.
Although this worked, the added complexity was not ideal and the
compilation time of the kernel with emulation was definitely not
ideal (5+ hours).
Note that I *may* add this again in the future, although I'd rather
set the system to x86_64-linux and cross-compile instead, which
mobile-nixos already supports but takes a large amount of ram.
I originally wanted to avoid maintaining my own forks of flake inputs to
simplify usage with the actual upstream if wanted, however the lack of
flakes supporting patches means that it's actually *easier* to maintain
my own repositories with the changes I want.
The main advantage of this is not having to wait for upstream. This also
means that I'm able to easily control which things I want to update and
when.
This fixes an issue where previously homeManagerModules would be an
unknown flake output. Note that this change is a part of Nix 2.22.3
but not Nix 2.23.3.
This is necessary since the boot process is handled by mobile-nixos.
Note that the implementation here should allow us to move aarch64
differences out of the flake.nix and simplify nixosConfigurations
again long-term.
This was my attempt at using GNOME Mobile. It works inside the x86_64
virtual machine but fails when reaching "Started Display Manager" on the
actual device.