1
0
Fork 0

General: code cleanup; Khanda: replace Intel driver

This commit is contained in:
Aires 2024-12-07 12:07:12 -05:00
parent 6111416364
commit 9a15ed6ff1
12 changed files with 84 additions and 17 deletions

View file

@ -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": {

View file

@ -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
{

View file

@ -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
{

View file

@ -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;

View file

@ -57,7 +57,7 @@ in
})
(lib.mkIf cfg.intel.enable {
services.xserver.videoDrivers = [ "intel" ];
services.xserver.videoDrivers = [ "modesetting" ];
hardware.graphics = {
enable = true;

View file

@ -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
{

View 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;
};
}

View 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";
}

View file

@ -1,4 +1,4 @@
{ namespace, ... }:
{ ... }:
{
home-manager.users.root = {
imports = [ ../common/home-manager/zsh.nix ];

View file

@ -1,6 +1,6 @@
{ channels, inputs, ... }:
final: prev:
final: _prev:
{
unstable = import inputs.nixpkgs-unstable {

View file

@ -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

View file

@ -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";
};
}