Added duo configuration to Bellerophon
This commit is contained in:
53
hosts/Bellerophon/duo-configuration.nix
Normal file
53
hosts/Bellerophon/duo-configuration.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
{pkgs, ...}: let
|
||||
# Clone the repository
|
||||
duoRepo = builtins.fetchGit {
|
||||
url = "https://github.com/alesya-h/zenbook-duo-2024-ux8406ma-linux";
|
||||
# Specify a specific commit or branch if needed
|
||||
# rev = "main"; # Uncomment this line to specify a branch or commit
|
||||
};
|
||||
|
||||
# Path to the duo script
|
||||
duoScript = "${duoRepo}/duo";
|
||||
|
||||
# Modify the shebang and create a new script
|
||||
modifiedDuoScript = pkgs.writeShellScript "modified-duo" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
cd "$(dirname "$(realpath "$0")")"
|
||||
${builtins.readFile duoScript}
|
||||
'';
|
||||
in {
|
||||
systemd.user.services.watchBacklight = {
|
||||
description = "synchronize screen brightness";
|
||||
wantedBy = ["default.target"];
|
||||
path = [pkgs.inotify-tools];
|
||||
serviceConfig = {
|
||||
ExecStart = "${modifiedDuoScript} watch-backlight";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.watchDisplays = {
|
||||
description = "set screens on keyboard event";
|
||||
wantedBy = ["default.target"];
|
||||
after = ["graphical-session.target"];
|
||||
path = [pkgs.gnome-monitor-config pkgs.usbutils pkgs.inotify-tools];
|
||||
serviceConfig = {
|
||||
ExecStart = "${modifiedDuoScript} watch-displays";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.watchRotation = {
|
||||
description = "rotate screens";
|
||||
wantedBy = ["default.target"];
|
||||
after = ["graphical-session.target"];
|
||||
path = [pkgs.gnome-monitor-config pkgs.iio-sensor-proxy];
|
||||
serviceConfig = {
|
||||
ExecStart = "${modifiedDuoScript} watch-rotation";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user