forked from nyanloutre/nixos-config
ajout script ipmihddtemp
This commit is contained in:
parent
458b6a72cd
commit
1383d2574d
3 changed files with 78 additions and 1 deletions
20
flake.nix
20
flake.nix
|
@ -2,10 +2,11 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-nyanloutre-pysmart.url = "github:nyanloutre/nixpkgs/pysmart-init";
|
||||
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-21.05";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, simple-nixos-mailserver }: {
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, simple-nixos-mailserver, nixpkgs-nyanloutre-pysmart }: {
|
||||
nixosConfigurations.loutreos = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
|
@ -18,6 +19,23 @@
|
|||
"${nixpkgs-unstable}/nixos/modules/services/audio/navidrome.nix"
|
||||
simple-nixos-mailserver.nixosModule
|
||||
./systems/LoutreOS/configuration.nix
|
||||
({ pkgs, ... }: {
|
||||
systemd.services.ipmihddtemp = {
|
||||
description = "IPMI HDD temp fan control";
|
||||
wantedBy = ["multi-user.target"];
|
||||
path = with pkgs;[ ipmitool smartmontools ];
|
||||
serviceConfig = {
|
||||
ExecStart = with nixpkgs-nyanloutre-pysmart.legacyPackages.x86_64-linux;
|
||||
let env = python3Packages.python.buildEnv.override {
|
||||
extraLibs = with python3Packages;[ pysmart ];
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
in "${pkgs.writeShellScriptBin "run.sh" ''
|
||||
${env}/bin/python ${pkgs.writeScript "ipmihddtemp.py" "${builtins.readFile ./ipmihddtemp.py}"}
|
||||
''}/bin/run.sh";
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue