Skip to content

Commit

Permalink
power profiles daemon now only activates for nix-lappy hosts
Browse files Browse the repository at this point in the history
Fixed bug w/ xorgScale.nix if xrandrScale is not set in an options.nix
file

Added debug trace option to flake install command executed in install.sh
  • Loading branch information
jwyuen committed Jul 4, 2024
1 parent ed4a9f4 commit f57e7de
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 18 deletions.
15 changes: 0 additions & 15 deletions dots/.config/bspwm/scripts/system.ini

This file was deleted.

2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fi
sed -i "/^\s*host[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$host_name\"/" ./flake.nix

echo "using the following host name: $host_name"
if sudo nixos-rebuild switch --flake .#"$host_name"; then
if sudo nixos-rebuild switch --flake .#"$host_name" --show-trace; then
echo "-----"
echo "$PROJECT_NAME Has Been Installed!"
fi
Expand Down
2 changes: 2 additions & 0 deletions nix-config/hosts/nix-deskstar/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ in {
# Enable SyncThing
syncthing = true;

# Power profiles daemon
powerprofiles = false;
}
2 changes: 2 additions & 0 deletions nix-config/hosts/nix-lappy/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ in {
# Xorg scaling
xrandrScale = "0.8x0.8";

# Power profiles daemon
powerprofiles = true;
}
3 changes: 3 additions & 0 deletions nix-config/hosts/nix-vm/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,7 @@ in {
# Enable SyncThing
syncthing = true;

# Power profiles daemon
powerprofiles = false;
}

1 change: 1 addition & 0 deletions nix-config/system/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
./opengl.nix
./packages.nix
./polkit.nix
./power-profiles-daemon.nix
./services.nix
./syncthing.nix
./vm.nix
Expand Down
6 changes: 6 additions & 0 deletions nix-config/system/power-profiles-daemon.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ config, lib, host, ... }:

let inherit (import ../hosts/${host}/options.nix) powerprofiles; in
lib.mkIf (powerprofiles == true) {
services.power-profiles-daemon.enable = true;
}
1 change: 0 additions & 1 deletion nix-config/system/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
hardware.bluetooth.powerOnBoot = false; # powers up the default Bluetooth controller on boot
services.blueman.enable = true;

services.power-profiles-daemon.enable = true;
services.gnome.gnome-keyring.enable=true;
security.pam.services.sddm.enableGnomeKeyring = true;
#security.pam.services.login.enableGnomeKeyring = true;
Expand Down
2 changes: 1 addition & 1 deletion nix-config/system/xorgScale.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ config, lib, host, ... }:

let inherit (import ../hosts/${host}/options.nix) xrandrScale; in
lib.mkIf ("${xrandrScale}" != null && "${host}" == "nix-lappy") {
lib.mkIf ("${host}" == "nix-lappy" && "${xrandrScale}" != null) {
services.xserver.displayManager.sessionCommands = ''
xrandr --output eDP-1 --scale ${xrandrScale} --mode 2880x1800
'';
Expand Down

0 comments on commit f57e7de

Please sign in to comment.