Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foo-dogsquared/nix-overlay-guix
A package and module for using GNU Guix on Nix(OS).
https://github.com/foo-dogsquared/nix-overlay-guix
guix nix nix-overlay nix-packages nixos-module
Last synced: 3 months ago
JSON representation
A package and module for using GNU Guix on Nix(OS).
- Host: GitHub
- URL: https://github.com/foo-dogsquared/nix-overlay-guix
- Owner: foo-dogsquared
- Created: 2022-01-14T07:31:14.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-04T02:53:24.000Z (about 1 year ago)
- Last Synced: 2024-04-13T15:40:05.275Z (10 months ago)
- Topics: guix, nix, nix-overlay, nix-packages, nixos-module
- Language: Nix
- Homepage:
- Size: 122 KB
- Stars: 39
- Watchers: 3
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Guix overlay for NixOS
:toc:It's an overlay for installing Guix in NixOS.
Forked originally from link:https://github.com/Emiller88/guix[Emiller88's Guix overlay].== Migrating to nixpkgs' version
As of 2023-12-04, most of the things over here has been upstreamed into nixpkgs including the https://github.com/NixOS/nixpkgs/pull/264331[module].
This means development will now take place over at nixpkgs and any issues and discussions should be filed over there (be sure to ping me as well).
I recommend to use nixpkgs' version as it is also actively maintained and has more options (such as `services.guix.gc`) compared to here.As for this Git repo, it will stay the way it is indefinitely (considering to archive it to make it more obvious).
To get started (if applicable):
* Remove the flake input entirely.
* Remove the overlay (if you use it) since Guix is available from nixpkgs now.
* Remove the imported module from this flake.
* Remove the reference of the package from this flake in `services.guix.package`.As for the module itself, there should be no changes from the user side.
Just set `services.guix.enable = true;` somewhere in your NixOS configuration and it's all set.== What's in the flake?
To quickly show the goods, just run `nix flake show ${FLAKE}`.
Here's what the flake should contain from the most interesting to the most boring.
* `overlays.default` which contains the overlay for the Guix (and its dependencies) as a Nix package.
* `packages.${system}.${package}` containing derivations of Guix and the dependencies.
* `nixosModules` contains various link:./modules/nixos/[NixOS modules] exported for this project.
The most useful (and only) modules are for enabling Guix daemon (either with the link:./modules/nixos/guix.nix[Nix-built version] or the link:./modules/nixos/guix-binary.nix[binary installation]).Please see link:./flake.nix[`./flake.nix`] for more details.
WARNING: While the flake offers a way to install the binary installation for ease of use, it is deprecated and will be removed in 4 years after Guix v1.4.0 has been released.
It is recommended to use the modules with Nix-built package instead.== Getting started
[WARNING]
====
While the Guix package is usable, it isn't fully functional with some missing dependencies and no proper testing so expect some bugs to pop up.
It just so happens to be usable with the most basic use cases (e.g., installing and upgrading packages, managing Guix installation).
I haven't used Guix to its full capabilities so if you use Guix extensively, please file an issue.
====Some prerequisites:
* You need NixOS installed, of course.
The minimum version required is at least 22.05.
Whether or not this works at unstable branches is a game of gamble and only minimally tested.* If you have Nix with flakes experimental feature enabled, you need Nix 2.8 and above as well with the new command line interface enabled (i.e., `experimental-features = nix-command flakes` from your Nix configuration).
This project also has a binary cache available in case you want to speed up your installation.
Here's one way to set it up in your NixOS configuration.
[source, nix]
----
{
nix.settings = {
substituters = [ "https://foo-dogsquared.cachix.org" ];
trusted-public-keys = [ "foo-dogsquared.cachix.org-1:/2fmqn/gLGvCs5EDeQmqwtus02TUmGy0ZlAEXqRE70E=" ];
};
}
----Or you can use `cachix use foo-dogsquared` if you have link:https://www.cachix.org/[cachix] installed.
=== Using with Nix flakes
This is the recommended installation method.
Now, add it in your flake configuration...
[source, nix]
----
inputs.guix-overlay.url = "github:foo-dogsquared/nix-overlay-guix";
----...and add the overlay in `nixpkgs.overlays`.
[source, nix]
----
nixpkgs.overlays = [
# Your overlays...# The guix overlay.
inputs.guix-overlay.overlays.default
];
----You can now add Guix as a additional package to your NixOS system.
Though, there is a NixOS module that already sets up most of the things to make Guix work with NixOS nicely.[source, nix]
----
{
imports = [
inputs.guix-overlay.nixosModules.guix
];# Enabling the Guix daemon and install the package manager in your system.
services.guix.enable = true;
}
----=== Using with channels
This project tries to be easy to use with link:https://nixos.org/manual/nix/unstable/package-management/channels.html[Nix channels] but it is not there yet.
Though, I recommend using something like link:https://github.com/nmattia/niv[niv] to ease channel management (i.e., `niv add foo-dogsquared/nix-overlay-guix`).For now, you'll have to keep in mind about the requirements of this being supporting mainly NixOS 22.05.
As root, add the project as part of the channel list.
[source, shell]
----
nix-channel --add https://github.com/foo-dogsquared/nix-overlay-guix/archive/master.tar.gz guix-overlay
nix-channel --update
----In your NixOS configuration, you have to add the Guix package set as an overlay.
[source, nix]
----
nixpkgs.overlays = [
(final: prev: import { pkgs = prev; })
];
----Now, import the NixOS module and enable the imported service.
[source, nix]
----
{
imports = [
];services.guix.enable = true;
}
----=== Post-installation
You might want to do these things after installation:
- Follow the link:https://guix.gnu.org/manual/en/html_node/Application-Setup.html[Application Setup guide from the Guix manual] more specifically on locales (i.e., `guix install glib-locales`).
This is to ensure Guix-managed applications use the appropriate locale data.
However, you don't need to setup `GUIX_LOCPATH` environment variable as the module already does this.== Development guidelines
Non-exhaustive list of guidelines when developing this project.
* This project follows the link:https://semver.org/[Semantic Versioning] scheme for its stable version.
* Follow the conventions in most NixOS modules from link:https://github.com/NixOS/nixpkgs/[nixpkgs] as of the appropriate version.
* Keep in mind about the main nixpkgs branch to be followed.
This is seen in link:./flake.nix[./flake.nix].* For other stable versions, this should be kept at a separate branch similar to how nixpkgs and link:https://github.com/nix-community/home-manager/[home-manager] does it.
== Why fork it?
* First and foremost, I want to explore how to make an overlay like this.
I want the two package manager work together without much trouble (in the side of NixOS anyways).* Try to make Guix work on a NixOS-based system.
I want it to make my Guix workflow works without resorting to virtual machines.
My workstation is just a potato ran by a hamster that is nearing its life expectancy and I cannot afford it any longer.
I WANT IT TO JUST WORK!* Well, the original repository doesn't see much additional commits in the last year.
In that timeframe, Guix v1.3.0 has been released and more features is yet to be seen such as the Guix home configurations and additional fixes and small-scale features.
I don't want to miss out with another clunky virtual machine that is just further making my battery drain more.=== TODO
* [x] Cleanup the codebase.
** [x] Cleanup the additional Guile modules.
** [x] Format with `nixfmt`.* [x] Document the flake and its outputs.
* [x] Make it easy to use if installed with traditional channels.
Or at least document it.* [x] Cache the package set of this project.
* [x] Make use of a CI system to automate building and updating.
* [x] Create packages for Guix with the binary installation.
** [ ] Create the binary installation with various versions just for fun ;p
(This aged well considering I'll be deprecating the binary installation now.)
** [ ] Make the same with Nix-built Guix with offering the various versions.