2022-06-23 02:57:41 -04:00
|
|
|
{ config, lib, pkgs, inputs, ... }@attrs:
|
|
|
|
with lib;
|
|
|
|
{
|
2022-07-02 02:44:43 -04:00
|
|
|
config = mkMerge [
|
|
|
|
(mkIf pkgs.stdenv.isLinux
|
|
|
|
{
|
|
|
|
zramSwap = mkIf config.nathan.services.zramSwap
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
algorithm = "lz4";
|
|
|
|
memoryPercent = 25;
|
|
|
|
};
|
|
|
|
nix = mkIf config.nathan.config.nix.autoGC {
|
|
|
|
autoOptimiseStore = true;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
(mkIf config.nathan.config.harden (import "${inputs.nixpkgs}/nixos/modules/profiles/hardened.nix" attrs))
|
|
|
|
(mkIf ((! config.nathan.config.harden) && config.nathan.config.isDesktop) {
|
|
|
|
# Use the zen kernel with muqss turned on
|
|
|
|
boot.kernelPackages =
|
|
|
|
let
|
|
|
|
linuxZenWMuQSS = pkgs.linuxPackagesFor (pkgs.linuxPackages_zen.kernel.override {
|
|
|
|
structuredExtraConfig = with lib.kernel; {
|
|
|
|
SCHED_MUQSS = yes;
|
|
|
|
};
|
|
|
|
ignoreConfigErrors = true;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
in
|
|
|
|
linuxZenWMuQSS;
|
|
|
|
})
|
|
|
|
(mkIf
|
|
|
|
(config.nathan.config.nix.autoUpdate && pkgs.stdenv.isLinux)
|
|
|
|
{
|
|
|
|
# Auto update daily at 2 am
|
|
|
|
system.autoUpgrade = {
|
2022-06-23 02:57:41 -04:00
|
|
|
enable = true;
|
2022-07-02 02:44:43 -04:00
|
|
|
allowReboot = true;
|
|
|
|
# Update from the flake
|
|
|
|
flake = "github:nathans-flakes/system";
|
|
|
|
# Attempt to update daily at 2AM
|
|
|
|
dates = "2:00";
|
2022-06-23 02:57:41 -04:00
|
|
|
};
|
2022-07-02 02:44:43 -04:00
|
|
|
})
|
|
|
|
];
|
2022-06-23 02:57:41 -04:00
|
|
|
}
|