New configuration initial commit

This commit is contained in:
EsVagy42 2025-04-13 15:27:48 +00:00
commit f44f0550cd
17 changed files with 3211 additions and 0 deletions

View file

@ -0,0 +1,33 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }:
{
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
];
systemd.services.limitbat0 = let bat0_charge_limit = 80;
in {
enable = true;
description = "Limit battry charge to 80%";
unitConfig = { After = "multi-user.target"; };
serviceConfig = {
Type = "oneshot";
ExecStart = "/bin/sh -c 'echo ${
toString bat0_charge_limit
} > /sys/class/power_supply/BAT0/charge_control_end_threshold'";
};
wantedBy = [ "multi-user.target" ];
};
swapDevices = [{
device = "/var/lib/swapfile";
size = 16 * 1024;
}];
boot.initrd.systemd.enable = true;
}