Coder Social home page Coder Social logo

nix-overlay-guix's Introduction

Guix overlay for NixOS

It’s an overlay for installing Guix in NixOS. Forked originally from Emiller88’s Guix overlay.

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 NixOS modules exported for this project. The most useful (and only) modules are for enabling Guix daemon (either with the Nix-built version or the binary installation).

Please see ./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).

Some prerequisites:

  • You need NixOS installed, of course. The minimum version required is at least the latest release version. This flake derivation recommends to use the unstable release version.

  • 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.

{
  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 cachix installed.

Using with Nix flakes

This is the recommended installation method.

Now, add it in your flake configuration…​

inputs.guix-overlay.url = "github:foo-dogsquared/nix-overlay-guix";

…​and add the overlay in nixpkgs.overlays.

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.

{
  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 Nix channels but it is not there yet. Though, I recommend using something like 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.

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.

nixpkgs.overlays = [
  (final: prev: import <guix-overlay/pkgs> { pkgs = prev; })
];

Now, import the NixOS module and enable the imported service.

{
  imports = [
    <guix-overlay/modules/nixos/guix.nix>
  ];

  services.guix.enable = true;
}

Post-installation

You might want to do these things after installation:

  • Follow the 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 Semantic Versioning scheme for its stable version.

  • Follow the conventions in most NixOS modules from nixpkgs as of the appropriate version.

  • Keep in mind about the main nixpkgs branch to be followed. This is seen in ./flake.nix.

  • For other stable versions, this should be kept at a separate branch similar to how nixpkgs and home-manager does it.

TODO

  • ✓ Cleanup the codebase.

    • ✓ Cleanup the additional Guile modules.

    • ✓ Format with nixfmt.

  • ✓ Document the flake and its outputs.

  • ✓ Make it easy to use if installed with traditional channels. Or at least document it.

  • ✓ Cache the package set of this project.

  • ✓ Make use of a CI system to automate building and updating.

  • ✓ Create packages for Guix with the binary installation.

    • ❏ Create the binary installation with various versions just for fun OwO (This aged well considering the original author of this flake be deprecating the binary installation now.)

    • ❏ Make the same with Nix-built Guix with offering the various versions.

nix-overlay-guix's People

Contributors

bqv avatar edmundmiller avatar foo-dogsquared avatar yvieta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.