add modprobed-db service
This commit is contained in:
parent
51ea2c741c
commit
2dd6e4fa5f
@ -94,6 +94,7 @@
|
||||
}];
|
||||
};
|
||||
|
||||
services.modprobed-db.enable = true;
|
||||
programs.nix-ld.enable = true;
|
||||
home-manager.users.${config.mainuser} = {
|
||||
home.packages = [
|
||||
@ -114,6 +115,8 @@
|
||||
pkgs.exercism
|
||||
pkgs.packwiz
|
||||
pkgs.streamrip
|
||||
|
||||
pkgs.modprobed-db
|
||||
];
|
||||
xdg.configFile."distrobox/distrobox.conf".text = ''
|
||||
container_always_pull="1"
|
||||
@ -146,6 +149,7 @@
|
||||
".local/share/distrobox"
|
||||
".mitmproxy"
|
||||
".config/exercism"
|
||||
".config/modprobed-db"
|
||||
".config/streamrip"
|
||||
];
|
||||
};
|
||||
|
40
modules/modprobed-db.nix
Normal file
40
modules/modprobed-db.nix
Normal file
@ -0,0 +1,40 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkPackageOption mkIf;
|
||||
|
||||
cfg = config.services.modprobed-db;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.modprobed-db = {
|
||||
enable = mkEnableOption "modprobed-db service to scan and store new kernel modules";
|
||||
package = mkPackageOption pkgs "modprobed-db" { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user = {
|
||||
services.modprobed-db = {
|
||||
description = "modprobed-db service to scan and store new kernel modules";
|
||||
wants = [ "modprobed-db.timer" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/modprobed-db storesilent";
|
||||
ExecStop = "${cfg.package}/bin/modprobed-db storesilent";
|
||||
Type = "simple";
|
||||
};
|
||||
path = builtins.attrValues {
|
||||
inherit (pkgs) gawk getent coreutils gnugrep gnused kmod;
|
||||
};
|
||||
};
|
||||
timers.modprobed-db = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
partOf = [ "modprobed-db.service" ];
|
||||
timerConfig = {
|
||||
Persistent = true;
|
||||
OnUnitActiveSec = "1h";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -37,6 +37,15 @@ with lib; {
|
||||
wine = prev.wineWow64Packages.stagingFull;
|
||||
intel-vaapi-driver = prev.intel-vaapi-driver.override { enableHybridCodec = true; };
|
||||
|
||||
modprobed-db = prev.modprobed-db.overrideAttrs (oa: {
|
||||
postPatch = (oa.postPatch or "") + ''
|
||||
substituteInPlace ./common/modprobed-db.in \
|
||||
--replace-fail "/modprobed-db.conf" "/modprobed-db/modprobed-db.conf"
|
||||
substituteInPlace ./common/modprobed-db.skel \
|
||||
--replace-fail "/.config" "/.config/modprobed-db"
|
||||
'';
|
||||
});
|
||||
|
||||
neatvnc = prev.neatvnc.overrideAttrs (oa: {
|
||||
patches = [ ../patches/neatvnc.patch ] ++ oa.patches or [ ];
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user