feat: add modprobed-db service
This commit is contained in:
parent
428980743c
commit
4daf75938f
@ -64,6 +64,7 @@ in
|
||||
home-manager.users.${defaultUser} = {
|
||||
ataraxia.defaults.role = "desktop";
|
||||
ataraxia.theme.catppuccin.enable = true;
|
||||
ataraxia.services.modprobed-db.enable = true;
|
||||
|
||||
persist.state.directories = [
|
||||
".config/sops/age"
|
||||
|
46
modules/home/services/modprobed-db.nix
Normal file
46
modules/home/services/modprobed-db.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkPackageOption mkIf;
|
||||
cfg = config.ataraxia.services.modprobed-db;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
ataraxia.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 = {
|
||||
Unit = {
|
||||
Description = "modprobed-db service to scan and store new kernel modules";
|
||||
Wants = [ "modprobed-db.timer" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/modprobed-db storesilent";
|
||||
Type = "simple";
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
timers.modprobed-db = {
|
||||
Unit.PartOf = [ "modprobed-db.service" ];
|
||||
Timer = {
|
||||
Persistent = true;
|
||||
OnUnitActiveSec = "1h";
|
||||
};
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
persist.state.directories = [
|
||||
".config/modprobed-db"
|
||||
];
|
||||
};
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
inputs: _final: prev:
|
||||
inputs: final: prev:
|
||||
let
|
||||
inherit inputs;
|
||||
inherit (prev.hostPlatform) system;
|
||||
unstable = import inputs.nixpkgs-unstable {
|
||||
config = {
|
||||
@ -47,6 +46,7 @@ in
|
||||
|
||||
# Move modprobed config to subdir. Easier to use with impermanence
|
||||
modprobed-db = prev.modprobed-db.overrideAttrs (oa: {
|
||||
nativeBuildInputs = [ prev.makeWrapper ] ++ oa.nativeBuildInputs or [ ];
|
||||
postPatch =
|
||||
(oa.postPatch or "")
|
||||
+ ''
|
||||
@ -55,6 +55,22 @@ in
|
||||
substituteInPlace ./common/modprobed-db.skel \
|
||||
--replace-fail "/.config" "/.config/modprobed-db"
|
||||
'';
|
||||
postInstall =
|
||||
(oa.postInstall or "")
|
||||
+ ''
|
||||
wrapProgram $out/bin/modprobed-db \
|
||||
--set PATH ${
|
||||
with final;
|
||||
lib.makeBinPath [
|
||||
gawk
|
||||
getent
|
||||
coreutils
|
||||
gnugrep
|
||||
gnused
|
||||
kmod
|
||||
]
|
||||
}
|
||||
'';
|
||||
});
|
||||
|
||||
pass-secret-service = prev.pass-secret-service.overrideAttrs (_: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user