chore: run formatter

This commit is contained in:
2025-09-27 22:27:55 +05:00
parent 23ddc84bfc
commit 307b866cc6
44 changed files with 230 additions and 228 deletions

View File

@@ -1,5 +1,3 @@
{ ... }:
{
imports = [ ./host-spec.nix ];
{...}: {
imports = [./host-spec.nix];
}

View File

@@ -1,5 +1,9 @@
# Specifications For Differentiating Hosts
{ config, lib, ... }: {
{
config,
lib,
...
}: {
options.hostSpec = {
username = lib.mkOption {
type = lib.types.str;
@@ -14,7 +18,7 @@
description = "The email of the user";
};
networking = lib.mkOption {
default = { };
default = {};
type = lib.types.attrsOf lib.types.anything;
description = "An attribute set of networking information";
};
@@ -68,8 +72,7 @@
scaling = lib.mkOption {
type = lib.types.str;
default = "1";
description =
"Used to indicate what scaling to use. Floating point number";
description = "Used to indicate what scaling to use. Floating point number";
};
font = lib.mkOption {
type = lib.types.str;

View File

@@ -1,5 +1,3 @@
{ ... }:
{
imports = [ ./yubikey-touch-detector.nix ];
{...}: {
imports = [./yubikey-touch-detector.nix];
}

View File

@@ -1,11 +1,15 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.yubikey-touch-detector;
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.yubikey-touch-detector;
in {
options.services.yubikey-touch-detector = {
enable = mkEnableOption
enable =
mkEnableOption
"a tool to detect when your YubiKey is waiting for a touch";
package = mkOption {
@@ -22,7 +26,7 @@ in {
extraArgs = mkOption {
type = types.listOf types.str;
default = [ "--libnotify" ];
default = ["--libnotify"];
defaultText = literalExpression ''[ "--libnotify" ]'';
description = ''
Extra arguments to pass to the tool. The arguments are not escaped.
@@ -31,20 +35,19 @@ in {
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
home.packages = [cfg.package];
# Service description licensed under ISC
# See https://github.com/maximbaz/yubikey-touch-detector/blob/c9fdff7163361d6323e2de0449026710cacbc08a/LICENSE
# Author: Maxim Baz
systemd.user.sockets.yubikey-touch-detector = mkIf cfg.socket.enable {
Unit.Description =
"Unix socket activation for YubiKey touch detector service";
Unit.Description = "Unix socket activation for YubiKey touch detector service";
Socket = {
ListenFIFO = "%t/yubikey-touch-detector.sock";
RemoveOnStop = true;
SocketMode = "0660";
};
Install.WantedBy = [ "sockets.target" ];
Install.WantedBy = ["sockets.target"];
};
# Same license thing for the description here
@@ -52,19 +55,19 @@ in {
Unit = {
Description = "Detects when your YubiKey is waiting for a touch";
Requires =
optionals cfg.socket.enable [ "yubikey-touch-detector.socket" ];
optionals cfg.socket.enable ["yubikey-touch-detector.socket"];
};
Service = {
ExecStart = "${cfg.package}/bin/yubikey-touch-detector ${
concatStringsSep " " cfg.extraArgs
}";
Environment = [ "PATH=${lib.makeBinPath [ pkgs.gnupg ]}" ];
concatStringsSep " " cfg.extraArgs
}";
Environment = ["PATH=${lib.makeBinPath [pkgs.gnupg]}"];
Restart = "on-failure";
RestartSec = "1sec";
};
Install.Also =
optionals cfg.socket.enable [ "yubikey-touch-detector.socket" ];
Install.WantedBy = [ "default.target" ];
optionals cfg.socket.enable ["yubikey-touch-detector.socket"];
Install.WantedBy = ["default.target"];
};
};
}