use flake-utils-plus
This commit is contained in:
parent
6098357ec2
commit
2d2d3ee72d
37
flake.lock
generated
37
flake.lock
generated
@ -21,6 +21,21 @@
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1629481132,
|
||||
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ipmihddtemp": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@ -78,7 +93,8 @@
|
||||
"ipmihddtemp": "ipmihddtemp",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"simple-nixos-mailserver": "simple-nixos-mailserver"
|
||||
"simple-nixos-mailserver": "simple-nixos-mailserver",
|
||||
"utils": "utils_2"
|
||||
}
|
||||
},
|
||||
"simple-nixos-mailserver": {
|
||||
@ -117,6 +133,25 @@
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils_2": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1630860118,
|
||||
"narHash": "sha256-JwLcC/zRR6ypk4/Ks7plWBvThYoLhURaH2zvjuWVmyA=",
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "flake-utils-plus",
|
||||
"rev": "813281281363ec45af155c8d2ceb7c5132d4de45",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"ref": "1.3.0",
|
||||
"repo": "flake-utils-plus",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
50
flake.nix
50
flake.nix
@ -2,6 +2,7 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "flake:nixpkgs/nixos-21.05";
|
||||
nixpkgs-unstable.url = "flake:nixpkgs/nixos-unstable";
|
||||
utils.url = "github:gytis-ivaskevicius/flake-utils-plus/1.3.0";
|
||||
simple-nixos-mailserver = {
|
||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-21.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@ -16,33 +17,32 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, simple-nixos-mailserver, dogetipbot-telegram, ipmihddtemp }: {
|
||||
nixosConfigurations.loutreos = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
({ pkgs, ... }: {
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${nixpkgs}"
|
||||
];
|
||||
})
|
||||
nixpkgs.nixosModules.notDetected
|
||||
"${nixpkgs-unstable}/nixos/modules/services/audio/navidrome.nix"
|
||||
simple-nixos-mailserver.nixosModule
|
||||
dogetipbot-telegram.nixosModule
|
||||
ipmihddtemp.nixosModule
|
||||
./systems/LoutreOS/configuration.nix
|
||||
];
|
||||
};
|
||||
outputs = inputs@{ self, utils, nixpkgs, nixpkgs-unstable, simple-nixos-mailserver, dogetipbot-telegram, ipmihddtemp }: utils.lib.mkFlake {
|
||||
|
||||
nixosConfigurations.paul-fixe = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
inherit self inputs;
|
||||
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
|
||||
hostDefaults.modules = [
|
||||
nixpkgs.nixosModules.notDetected
|
||||
{
|
||||
nix.generateRegistryFromInputs = true;
|
||||
nix.linkInputs = true;
|
||||
nix.generateNixPathFromInputs = true;
|
||||
}
|
||||
];
|
||||
|
||||
hosts.loutreos.modules = [
|
||||
"${nixpkgs-unstable}/nixos/modules/services/audio/navidrome.nix"
|
||||
simple-nixos-mailserver.nixosModule
|
||||
dogetipbot-telegram.nixosModule
|
||||
ipmihddtemp.nixosModule
|
||||
./systems/LoutreOS/configuration.nix
|
||||
];
|
||||
|
||||
hosts.paul-fixe = {
|
||||
channelName = "nixpkgs-unstable";
|
||||
modules = [
|
||||
({ pkgs, ... }: {
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${nixpkgs-unstable}"
|
||||
];
|
||||
})
|
||||
nixpkgs-unstable.nixosModules.notDetected
|
||||
./systems/PC-Fixe/configuration.nix
|
||||
];
|
||||
};
|
||||
|
@ -1,42 +0,0 @@
|
||||
import math
|
||||
import subprocess
|
||||
import time
|
||||
from pySMART import DeviceList
|
||||
|
||||
MIN_FAN_SPEED = 30
|
||||
MAX_FAN_SPEED = 100
|
||||
|
||||
MIN_HDD_TEMP = 30
|
||||
MAX_HDD_TEMP = 50
|
||||
|
||||
devlist = DeviceList()
|
||||
|
||||
# Put fans in full speed mode
|
||||
subprocess.run(["ipmitool", "raw", "0x30", "0x45", "0x01", "0x01"])
|
||||
|
||||
while True:
|
||||
for device in devlist:
|
||||
device.update()
|
||||
|
||||
# Linear fan speed between MIN_FAN_SPEED and MAX_FAN_SPEED
|
||||
fan_speed = max(
|
||||
min(
|
||||
math.ceil(
|
||||
MIN_FAN_SPEED
|
||||
+ (
|
||||
(MAX_FAN_SPEED - MIN_FAN_SPEED)
|
||||
* (
|
||||
(max([x.temperature for x in devlist]) - MIN_HDD_TEMP)
|
||||
/ (MAX_HDD_TEMP - MIN_HDD_TEMP)
|
||||
)
|
||||
)
|
||||
),
|
||||
MAX_FAN_SPEED,
|
||||
),
|
||||
MIN_FAN_SPEED,
|
||||
)
|
||||
|
||||
subprocess.run(["ipmitool", "raw", "0x30", "0x70", "0x66", "0x01", "0x00", hex(fan_speed)])
|
||||
|
||||
time.sleep(10)
|
||||
|
@ -4,13 +4,6 @@
|
||||
|
||||
time.timeZone = "Europe/Paris";
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixUnstable;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Editeurs
|
||||
(neovim.override {
|
||||
|
Loading…
Reference in New Issue
Block a user