Redshift: Difference between revisions

From NixOS Wiki
imported>Andriokha
Add basic description of setting up a location provider and the redshift service.
 
imported>Andriokha
It looks like you don't need to explicitly install packages needed for a service.
Line 13: Line 13:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
{ config, pkgs, callPackage, ... }: {
{ config, pkgs, callPackage, ... }: {
  environment.systemPackages = with pkgs; [
    ...
    redshift
  ];
   ...
   ...
   # All values except 'enable' are optional.
   # All values except 'enable' are optional.

Revision as of 15:37, 23 April 2020

Prerequisites

You can either manually configure a location or specify a location provider such as geoclue2 with the following options:

Installation

Install it with the redshift package. Example snippet of configuration.nix:

{ config, pkgs, callPackage, ... }: {
  ...
  # All values except 'enable' are optional.
  services.redshift = {
    enable = true;
    brightness = {
      # Note the string values below.
      day = "1";
      night = "1";
    };
    temperature = {
      day = 5500;
      night = 3700;
    };
  };
};