Porting Regolith to Nix

New to nix, can someone point me to some sources for porting regolith (set of packages for debian and ubuntu) to nixos? I think the process would go from customizing i3 to look like regolith first, and then porting each package one by one. Let me know if this sounds good, or if there might be another approach. Thanks

Please correct me if I’m wrong — but I think regolith is mostly about making i3/tiling accessible to folks in the Ubuntu ecosystem.

So I guess my question is: what brings you to try to port regolith? What is your goal?

If you’d just like i3 and other packages, you can likely find most of that functionality already in nixpkgs/nixos. Which is probably what I’d suggest. But I probably don’t know everything about your use case

Regolith is about making tiling accessible to Ubuntu users, but it’s not only i3 configuration. Its a set of packages for Ubuntu, containing different implementations for notifications, rofi, etc, also uses its own build of st, has a very useful tool called ilia etc. What I need to do is to port all these packages to nix and create a package group which can install regolith as a desktop environment

I have found some sources for nixpkgs for installing from deb files, and building from source, though the file system is very different to other Linux OSes and hence I am a bit lost there

1 Like

Thanks for the clarification! I didn’t know that Regolith had evolved so much since I last used it a few years ago.

Perhaps seek help from users more experienced with the Regolith ecosystem, but my general advice would be to go with the “build from source” route via writing Nix derivations.

The general idea is that you would create a nix expression to build your software, then include that expression in your config, or upstream it to nixpkgs.

A toy example for ilia could look something like the below. Note that I have NOT tested this, so I can’t say if this will work properly. But the general idea will hold:

# ilia.nix
{ pkgs, ... }:

pkgs.stdenv.mkDerivation rec {
  pname = "ilia";
  version = "<YOURVERSION>";

  src = pkgs.fetchFromGithub {
    owner = "regolith-linux";
    repo = "ilia";
    # You need to replace 'rev' with the actual commit hash you want to build
    rev = "commit-hash-here";
    # Replace 'sha256' with the correct hash for the 'rev' you are using
    sha256 = "0y...z";
  };

  nativeBuildInputs = with pkgs; [ meson ninja pkg-config ];
}

After that you can then put it in your system’s path:

# configuration.nix

# … other config …
environment.systemPackages = [
    (import ./ilia.nix)
    # … other packages …
];
# … other config …

Again, you’ll have to test this and play around to make sure it works, but this is the general approach I’d follow to port this software.

1 Like