Modularize nbfc configuration.
This commit is contained in:
parent
c495ecb824
commit
3bb730988d
3 changed files with 40 additions and 14 deletions
29
modules/nixos/nbfc.nix
Normal file
29
modules/nixos/nbfc.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.nbfc.enable = lib.mkEnableOption "enable nbfc and set it up for my laptop";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.nbfc.enable {
|
||||
# Install nbfc-linux
|
||||
environment.systemPackages = with pkgs; [
|
||||
nbfc-linux
|
||||
];
|
||||
|
||||
# Setup nbfc package
|
||||
systemd.services.nbfc_service = {
|
||||
enable = false;
|
||||
description = "NoteBook FanControl Service";
|
||||
serviceConfig.Type = "simple";
|
||||
path = [pkgs.kmod];
|
||||
|
||||
script = "${pkgs.nbfc-linux}/bin/nbfc_service --config-file '/home/crony/.config/nbfc.json'";
|
||||
|
||||
wantedBy = ["multi-user.target"];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue