clamav, fix turning tv off on dell
This commit is contained in:
@@ -24,12 +24,12 @@ in
|
|||||||
};
|
};
|
||||||
services.displayManager.sddm.enable = !config.services.xserver.displayManager.gdm.enable;
|
services.displayManager.sddm.enable = !config.services.xserver.displayManager.gdm.enable;
|
||||||
|
|
||||||
nix.settings = {
|
#nix.settings = {
|
||||||
substituters = [ "https://hyprland.cachix.org" ];
|
# substituters = [ "https://hyprland.cachix.org" ];
|
||||||
trusted-public-keys = [
|
# trusted-public-keys = [
|
||||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
# "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||||
];
|
# ];
|
||||||
};
|
#};
|
||||||
|
|
||||||
xdg.portal.enable = true;
|
xdg.portal.enable = true;
|
||||||
xdg.portal.extraPortals = lib.mkDefault [
|
xdg.portal.extraPortals = lib.mkDefault [
|
||||||
|
|||||||
@@ -11,9 +11,11 @@ let
|
|||||||
'';
|
'';
|
||||||
tvOff = pkgs.writeShellScriptBin "tvOff" ''
|
tvOff = pkgs.writeShellScriptBin "tvOff" ''
|
||||||
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
|
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
|
||||||
|
${cec} -C --skip-info
|
||||||
${cec} --tv --skip-info
|
${cec} --tv --skip-info
|
||||||
${cec} --skip-info --user-control-pressed ui-cmd=power-on-function --to TV
|
${cec} --standby --skip-info --to TV
|
||||||
echo "Turning TV on!"
|
echo "Turning TV off!"
|
||||||
|
${pkgs.coreutils}/bin/sleep 2
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
@@ -24,15 +26,14 @@ in
|
|||||||
];
|
];
|
||||||
# after suspend, do `cec-ctl -A | grep cec0 | wc -l`, if >0, do `cec-ctl --standby --to TV`
|
# after suspend, do `cec-ctl -A | grep cec0 | wc -l`, if >0, do `cec-ctl --standby --to TV`
|
||||||
# similar on wakeup, if present send `cec-ctl --user-control-pressed ui-cmd=power-on-function --to TV`
|
# similar on wakeup, if present send `cec-ctl --user-control-pressed ui-cmd=power-on-function --to TV`
|
||||||
# doesn't work on dell for some reason (KDE)
|
|
||||||
environment.etc."systemd/system-sleep/sleep-turn-tv-off-on.sh".source =
|
environment.etc."systemd/system-sleep/sleep-turn-tv-off-on.sh".source =
|
||||||
pkgs.writeShellScript "post-sleep-turn-tv-off.sh" ''
|
pkgs.writeShellScript "post-sleep-turn-tv-off.sh" ''
|
||||||
case $1/$2 in
|
case $1/$2 in
|
||||||
pre/*)
|
pre/*)
|
||||||
${tvOff}
|
${tvOff}/bin/tvOff
|
||||||
;;
|
;;
|
||||||
post/*)
|
post/*)
|
||||||
${tvOn}
|
${tvOn}/bin/tvOn
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
'';
|
'';
|
||||||
|
|||||||
51
modules/services/clamav.nix
Normal file
51
modules/services/clamav.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.custom.services.clamav;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.custom.services.clamav = {
|
||||||
|
enable = lib.mkEnableOption "Enables clamav";
|
||||||
|
scanDirectories = lib.mkOption {
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
default = [
|
||||||
|
"/home"
|
||||||
|
"/var/lib"
|
||||||
|
"/tmp"
|
||||||
|
"/etc"
|
||||||
|
"/var/tmp"
|
||||||
|
];
|
||||||
|
description = "Directories to scan with clamscan.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.clamav = {
|
||||||
|
scanner.enable = true;
|
||||||
|
scanner.scanDirectories = cfg.scanDirectories;
|
||||||
|
updater.enable = true;
|
||||||
|
daemon = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
ExcludePath = [
|
||||||
|
"^/proc"
|
||||||
|
"^/dev"
|
||||||
|
"^/sys"
|
||||||
|
"^/var/lib/docker"
|
||||||
|
"^/var/lib/samba/private"
|
||||||
|
"^/var/lib/samba/winbindd_privileged/pipe"
|
||||||
|
"^/var/lib/postfix/queue/"
|
||||||
|
"^/var/lib/docker/overlay2"
|
||||||
|
"^/var/lib/docker/volumes/backingFsBlockDev"
|
||||||
|
"^/tmp/tmux-.*"
|
||||||
|
"^/tmp/dotnet-diagnostic-.*"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
./adam-site.nix
|
./adam-site.nix
|
||||||
./adguard.nix
|
./adguard.nix
|
||||||
./caldav.nix
|
./caldav.nix
|
||||||
|
./clamav.nix
|
||||||
./dnsmasq.nix
|
./dnsmasq.nix
|
||||||
./ente.nix
|
./ente.nix
|
||||||
./fileshelter.nix
|
./fileshelter.nix
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ buildNpmPackage rec {
|
|||||||
(fetchGit {
|
(fetchGit {
|
||||||
url = "git@github.com:oberprofis/ente.git";
|
url = "git@github.com:oberprofis/ente.git";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
rev = "cb63e1e20fd9fde401fa9d3f09b36c572b17ff34";
|
rev = "fe6eb090e513fc2aaac15274dbd94792b3e41052";
|
||||||
})
|
})
|
||||||
}/website/tracker-site";
|
}/website/tracker-site";
|
||||||
npmDepsHash = "sha256-fYTRhIU+8pdIm3wC5wJRcDUhgN3d+mmvfmVzuu0pjLQ=";
|
npmDepsHash = "sha256-fYTRhIU+8pdIm3wC5wJRcDUhgN3d+mmvfmVzuu0pjLQ=";
|
||||||
|
|||||||
@@ -133,6 +133,18 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
basePath = "/data/synced";
|
basePath = "/data/synced";
|
||||||
};
|
};
|
||||||
|
clamav = {
|
||||||
|
enable = true;
|
||||||
|
scanDirectories = [
|
||||||
|
"/data/vmail"
|
||||||
|
"/1tbssd/kop-fileshare"
|
||||||
|
"/home"
|
||||||
|
"/var/lib"
|
||||||
|
"/tmp"
|
||||||
|
"/etc"
|
||||||
|
"/var/tmp"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
nftables.enable = true;
|
nftables.enable = true;
|
||||||
cli-tools.enable = true;
|
cli-tools.enable = true;
|
||||||
|
|||||||
@@ -35,6 +35,11 @@
|
|||||||
shared.enable = true;
|
shared.enable = true;
|
||||||
plasma.enable = true;
|
plasma.enable = true;
|
||||||
sddm.enable = true;
|
sddm.enable = true;
|
||||||
|
stylix = {
|
||||||
|
enable = true;
|
||||||
|
base16Scheme = import ../../modules/themes/ina.nix;
|
||||||
|
image = ../../wallpaper/ina.jpg;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user