Caution

⚠️ Caution: Modifying the file /etc/nixos/customConfig/default.nix is at your own risk. Only do so if you know what you are doing! ⚠️


GLF-OS provides a space to add your custom configurations in /etc/nixos/customConfig/default.nix

If the current configuration and flatpaks do not fully meet your needs, you can modify the configuration.


Adding an application present in the Nix repositories.

Note

Please note that you can find a large number of applications at the following link:
https://search.nixos.org/packages


Here is a practical example: we are going to add Google Chrome.

The option to install Google Chrome is pkgs.google-chrome, which can be found here : https://search.nixos.org/packages?channel=25.05&from=0&size=50&sort=relevance&type=packages&query=google-chrome

1- Open the file /etc/nixos/customConfig/default.nix. The Gnome Text Editor tool will do the job.

2 -Add pkgs.google-chrome below the comment # Add your stable apps here (example: pkgs.btop)

{
  lib,
  config,
  pkgs,
  pkgs-unstable,
  ...
}:

{
  environment.systemPackages = [
  # Add your stable apps here (exemple: pkgs.btop)
    pkgs.google-chrome


  # Add your unstable apps here (exemple: pkgs-unstable.btop)


  ];


  # Add your custom configuration here ↓

}

3- Save your file with CTRL+S; you will be asked for the root password.

4- Run the command with the terminal:

glf-update

5- Reboot your machine

Add a custom configuration.

If you now want to open specific ports in the firewall, this is done in the configuration section of the same file /etc/nixos/customConfig/default.nix.

{
  lib,
  config,
  pkgs,
  pkgs-unstable,
  ...
}:

{
  environment.systemPackages = [
  # Add your stable apps here (exemple: pkgs.btop)
    pkgs.google-chrome


  # Add your unstable apps here (exemple: pkgs-unstable.btop)


  ];


  # Add your custom configuration here ↓
  networking.firewall.allowedTCPPortRanges = [
    { from = 51413; to = 51413; }
  ];

}

Save your file with CTRL+S, and you will be prompted for the root password.

Run the command:

glf-update

Reboot your machine



Understanding how your settings combine with ours

This is the most useful notion on this page, and it explains every example below.

NixOS does not read your file "after" ours in order to overwrite it: it merges them. What happens depends on the option type.

Option type What happens
A list your entries are added to ours, nothing is lost
A simple value (boolean, string, package) conflict if we already set it, lib.mkForce is required

Extending an application GLF already provides

Note

You have nothing to remove on our side: your list is added to ours.

Take OBS Studio. GLF already declares four plugins, and adds more depending on your graphics card. To add your own, simply declare the list in your file:

{
  # Add your custom configuration here ↓
  programs.obs-studio.plugins = with pkgs.obs-studio-plugins; [
    obs-backgroundremoval
    obs-shaderfilter
    input-overlay
  ];
}

Caution

Three pitfalls to avoid:

The same reasoning applies to Steam, whose compatibility tools we already populate. To add utilities to its environment:

{
  programs.steam.extraPackages = [
    pkgs.steamtinkerlaunch
    pkgs.protontricks
  ];
}

Changing a value GLF already set

Here merging is not enough: two simple values conflict and evaluation fails. lib.mkForce settles it in your favour.

{
  fonts.fontconfig.defaultFonts.monospace = lib.mkForce [ "JetBrainsMono Nerd Font" ];
}

Note

Without lib.mkForce you will get an error such as "The option has conflicting definition values". That message does not mean you did something wrong: it simply asks you to say which definition wins.


Disabling a GLF component

Each major component exposes a switch, already listed as a comment in your file:

{
  glf.firefox.enable = lib.mkForce false;   # remove Firefox
  glf.gaming.enable = lib.mkForce false;    # remove the whole gaming pack
  glf.printing.enable = lib.mkForce false;  # remove printing
}

Note

For individual applications, prefer GLF Customizer: it writes to a file meant for that purpose and avoids conflicts.


Modifying a package itself

When no option exists, act on the package.

{
  environment.systemPackages = [
    (pkgs.mpv.override { scripts = [ pkgs.mpvScripts.mpris ]; })
  ];
}

Caution

The package no longer matches the one in the binary cache, so it will be rebuilt on your machine. Plan for the time it takes.


Finding options and packages


Going further, on the NixOS side


If something goes wrong

Note

A failed evaluation installs nothing: your system stays exactly as it was. You cannot break it by trying.

If a boot goes wrong after a change, pick the previous generation in the boot menu, it is always there.

To roll back without rebooting:

sudo nixos-rebuild switch --rollback

🌐 www.gaminglinux.frDiscord-Symbol-Blurple Discord GLF


© 2025 GLF