Skip to content

Commit

Permalink
Revert "Replace redshift by go-sct"
Browse files Browse the repository at this point in the history
This reverts commit ade34b3.

I understand now why redshift wasn't working this time. See [this
issue](NixOS/nixpkgs#321121).
  • Loading branch information
dmarcoux committed Jun 30, 2024
1 parent 6b911c6 commit c9966fa
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 6 deletions.
2 changes: 1 addition & 1 deletion home-manager/autorandr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Enable autorandr. Profiles are specific to hosts, so they're not defined here
programs.autorandr.enable = true;

# Since I'm using sct, the gamma always varies. It's skipped when detecting changes and applying a profile.
# Since I'm using Redshift, the gamma always varies. It's skipped when detecting changes and applying a profile.
xdg.configFile."autorandr/settings.ini".text = ''
[config]
skip-options=gamma
Expand Down
1 change: 1 addition & 0 deletions home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
./pasystray.nix
./picom.nix
./playerctl.nix
./redshift.nix
./ripgrep.nix
./rofi.nix
./ruby.nix
Expand Down
3 changes: 0 additions & 3 deletions home-manager/i3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@
# Center floating windows in the workspace in which they appear
for_window [floating] move position center

# Launc sct to control color temperature of the screen
exec --no-startup-id sct -dayTemp 5500 -nightTemp 3500

# Launch terminal
# Somehow, this alacritty instance has a bigger font size due to the `Window Scale Factor` being wrong.
# This issue started to happen when I upgraded to NixOS 24.05 and I don't know why... following alacritty instances
Expand Down
25 changes: 25 additions & 0 deletions home-manager/redshift.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# User configuration for redshift

{ pkgs, options, ... }:

{
# Install redshift
home.packages = [ options.services.redshift.package.value ];

# Use redshift to adapt screen's color temperature depending on the time of day
services.redshift = {
enable = true;

# Use GeoClue2 as location provider
provider = "geoclue2";

# Colour temperature to use at day/night, between 1000 and 25000 K
temperature = {
day = 5500;
night = 3500;
};

# Start the redshift-gtk tray applet
tray = true;
};
}
1 change: 1 addition & 0 deletions nixos/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
./packages.nix
./podman.nix
./printing.nix
./redshift.nix
./udiskie.nix
./unclutter.nix
./vscode.nix
Expand Down
2 changes: 0 additions & 2 deletions nixos/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
go_1_21
# Go Language Server
unstable.gopls
# Control color temperature of the screen based on location and time
go-sct
# For the command make
gnumake
# Color picker
Expand Down
18 changes: 18 additions & 0 deletions nixos/redshift.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# System configuration for redshift

{ pkgs, ... }:

{
# Without this package, redshift-gtk doesn't have an icon.
environment.systemPackages = [ pkgs.hicolor-icon-theme ];

# Start GeoClue2 daemon
services.geoclue2.enable = true;

# Enable location with GeoClue2
services.geoclue2.appConfig.redshift = {
isAllowed = true;
isSystem = false;
};
location.provider = "geoclue2";
}

0 comments on commit c9966fa

Please sign in to comment.