Skip to content

CTRL-OS Modules

We maintain a set of opinionated NixOS modules that work great with CTRL-OS in the CTRL-OS Modules repository. We support Flake-based and traditional systems.

Using CTRL-OS Modules

To use CTRL-OS modules you need to enable a Nixpkgs overlay in your configuration. CTRL-OS modules sometimes use software that is not yet packaged in any Nixpkgs branch. For this reason, we maintain an overlay with these packages directly in the CTRL-OS modules repository.

To consume the modules in a Nix Flake, add the overlay and the module to your flake.nix:

{
    description = "A NixOS Flake consuming CTRL-OS modules";

    inputs = {
        nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
        ctrl-os-modules.url = "github:cyberus-ctrl-os/ctrl-os-modules";
    };

    outputs = { nixpkgs, ctrl-os-modules, ... }: {
      nixosConfigurations.host = nixpkgs.lib.nixosSystem {
        modules = [
          ({ config, pkgs, ... }: {
              nixpkgs.overlays = [
                  ctrl-os-modules.overlays.default
              ];
          })

          # Consume any module from CTRL-OS modules, you need. Note that
          # modules need to be individually enabled. See their documentation.
          #
          # Also note that not every module is supported on every NixOS and
          # CTRL-OS version. Refer to the module documentation for details.
          ctrl-os-modules.nixosModules.developer

          # Add your modules here.
          # ...
        ];
      };
}

Here is a configuration fragment that enables CTRL-OS modules on a system that does not use Flakes:

{ config, pkgs, ... }:
let
    ctrl-os-modules = pkgs.fetchFromGitHub {
        owner = "cyberus-ctrl-os";
        repo = "ctrl-os-modules";
        rev = "main";
        # Replace the fake hash with the correct one
        hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
    };
in
{
    nixpkgs.overlays = [
        (self: super: import "${ctrl-os-modules}/packages/default.nix" { pkgs = self; })
    ];

    imports = [
        "${ctrl-os-modules}/modules/developer.nix"
    ];
}

List of Modules

The following modules are currently available.

ctrl-os.developer

A module to enable the ctrl-os binary cache and features that are used throughout this documentation, such as Flakes.

Find the documentation here.

ctrl-os.vms

A module to run run generic (non-NixOS) virtual machines declaratively from your NixOS configuration.

Find the documentation here.