General: code cleanup; Khanda: replace Intel driver
This commit is contained in:
parent
6111416364
commit
9a15ed6ff1
|
@ -207,11 +207,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733482664,
|
||||
"narHash": "sha256-ZD+h1fwvZs+Xvg46lzTWveAqyDe18h9m7wZnTIJfFZ4=",
|
||||
"lastModified": 1733572789,
|
||||
"narHash": "sha256-zjO6m5BqxXIyjrnUziAzk4+T4VleqjstNudSqWcpsHI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "e38d3dd1d355a003cc63e8fe6ff66ef2257509ed",
|
||||
"rev": "c7ffc9727d115e433fd884a62dc164b587ff651d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -10,7 +10,7 @@ let
|
|||
cfg = config.${namespace}.apps.writing;
|
||||
|
||||
compile-manuscript = pkgs.writeShellScriptBin "compile-manuscript" (
|
||||
builtins.readFile ../../../../bin/compile-manuscript.sh
|
||||
builtins.readFile (lib.snowfall.fs.get-file "bin/compile-manuscript.sh")
|
||||
);
|
||||
in
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ let
|
|||
cfg = config.${namespace}.services.jellyfin;
|
||||
|
||||
jellyfin-audio-save = pkgs.unstable.jellyfin.overrideAttrs (
|
||||
finalAttrs: prevAttrs: { patches = [ ./jellyfin-audio-save-position.patch ]; }
|
||||
_finalAttrs: _prevAttrs: { patches = [ ./jellyfin-audio-save-position.patch ]; }
|
||||
);
|
||||
in
|
||||
{
|
||||
|
|
|
@ -43,18 +43,12 @@ in
|
|||
xxd
|
||||
];
|
||||
};
|
||||
|
||||
powerManagement.enable = lib.mkEnableOption "Enables power management, e.g. for laptops.";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
# Install base packages
|
||||
environment.systemPackages = cfg.corePackages ++ cfg.packages;
|
||||
|
||||
# Configure power management via power-profiles-daemon
|
||||
# https://gitlab.freedesktop.org/upower/power-profiles-daemon
|
||||
services.power-profiles-daemon.enable = cfg.powerManagement.enable;
|
||||
|
||||
services = {
|
||||
# Automatically set the timezone based on location
|
||||
automatic-timezoned.enable = true;
|
||||
|
|
|
@ -57,7 +57,7 @@ in
|
|||
})
|
||||
|
||||
(lib.mkIf cfg.intel.enable {
|
||||
services.xserver.videoDrivers = [ "intel" ];
|
||||
services.xserver.videoDrivers = [ "modesetting" ];
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
|
|
|
@ -13,7 +13,7 @@ let
|
|||
cfg = config.${namespace};
|
||||
|
||||
nixos-operations-script = pkgs.writeShellScriptBin "nixos-operations-script" (
|
||||
builtins.readFile ../../../../bin/nixos-operations-script.sh
|
||||
builtins.readFile (lib.snowfall.fs.get-file "bin/nixos-operations-script.sh")
|
||||
);
|
||||
in
|
||||
{
|
||||
|
|
35
modules/nixos/system/power/default.nix
Normal file
35
modules/nixos/system/power/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Power management options
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.${namespace};
|
||||
|
||||
ppd-patched = pkgs.power-profiles-daemon.overrideAttrs (
|
||||
_finalAttrs: _prevAttrs: {
|
||||
patches = [ ./power-profiles-daemon.patch ];
|
||||
mesonFlags = [
|
||||
"-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
||||
"-Dgtk_doc=true"
|
||||
"-Dpylint=disabled"
|
||||
"-Dzshcomp=${placeholder "out"}/share/zsh/site-functions"
|
||||
"-Dtests=false" # Disable built-in tests, since they'll fail due to the patch
|
||||
];
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
options.${namespace}.powerManagement.enable =
|
||||
lib.mkEnableOption "Enables power management, e.g. for laptops.";
|
||||
|
||||
# Configure power management via power-profiles-daemon
|
||||
# https://gitlab.freedesktop.org/upower/power-profiles-daemon
|
||||
config.services.power-profiles-daemon = lib.mkIf cfg.powerManagement.enable {
|
||||
enable = true;
|
||||
package = ppd-patched;
|
||||
};
|
||||
}
|
26
modules/nixos/system/power/power-profiles-daemon.patch
Normal file
26
modules/nixos/system/power/power-profiles-daemon.patch
Normal file
|
@ -0,0 +1,26 @@
|
|||
diff --git a/src/ppd-driver-amd-pstate.c b/src/ppd-driver-amd-pstate.c
|
||||
index 55635b0..0ed87ab 100644
|
||||
--- a/src/ppd-driver-amd-pstate.c
|
||||
+++ b/src/ppd-driver-amd-pstate.c
|
||||
@@ -175,7 +175,7 @@ profile_to_epp_pref (PpdProfile profile, gboolean battery)
|
||||
case PPD_PROFILE_POWER_SAVER:
|
||||
return "power";
|
||||
case PPD_PROFILE_BALANCED:
|
||||
- return battery ? "balance_power" : "balance_performance";
|
||||
+ return "balance_performance";
|
||||
case PPD_PROFILE_PERFORMANCE:
|
||||
return "performance";
|
||||
}
|
||||
diff --git a/src/ppd-driver-intel-pstate.c b/src/ppd-driver-intel-pstate.c
|
||||
index 90a5d17..4eaca2e 100644
|
||||
--- a/src/ppd-driver-intel-pstate.c
|
||||
+++ b/src/ppd-driver-intel-pstate.c
|
||||
@@ -300,7 +300,7 @@ profile_to_epp_pref (PpdProfile profile, gboolean battery)
|
||||
case PPD_PROFILE_POWER_SAVER:
|
||||
return "power";
|
||||
case PPD_PROFILE_BALANCED:
|
||||
- return battery ? "balance_power" : "balance_performance";
|
||||
+ return "balance_performance";
|
||||
case PPD_PROFILE_PERFORMANCE:
|
||||
return "performance";
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ namespace, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
home-manager.users.root = {
|
||||
imports = [ ../common/home-manager/zsh.nix ];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ channels, inputs, ... }:
|
||||
|
||||
final: prev:
|
||||
final: _prev:
|
||||
|
||||
{
|
||||
unstable = import inputs.nixpkgs-unstable {
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
{ stdenv, pkgs }:
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
pkgs,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "freight-pro-fonts";
|
||||
|
@ -6,7 +10,7 @@ stdenv.mkDerivation rec {
|
|||
nativeBuildInputs = [ pkgs.unzip ];
|
||||
buildInputs = [ pkgs.unzip ];
|
||||
|
||||
src = ../../modules/nixos/secrets/Freight-20240828T164047Z-001.zip;
|
||||
src = lib.snowfall.fs.get-file "modules/nixos/secrets/Freight-20240828T164047Z-001.zip";
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
|
||||
programs = {
|
||||
beautysh.enable = true;
|
||||
deadnix = {
|
||||
enable = true;
|
||||
no-lambda-pattern-names = true;
|
||||
};
|
||||
nixfmt = {
|
||||
enable = true;
|
||||
package = pkgs.nixfmt-rfc-style;
|
||||
|
@ -12,4 +16,8 @@
|
|||
prettier.enable = true;
|
||||
yamlfmt.enable = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
on-unmatched = "info";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue