Custom user configuration - Gaming-Linux-FR/GLF-OS GitHub Wiki

Custom configurations

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.

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-switch

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-switch