diff --git a/common/hardware/tlp.nix b/common/hardware/tlp.nix index 729fddc..81c7fd9 100644 --- a/common/hardware/tlp.nix +++ b/common/hardware/tlp.nix @@ -1,9 +1,9 @@ -{ pkgs, config, lib, ... }: +{ pkgs, config, lib, system, ... }: let cfg = config.grimmShared; inherit (lib) optionals optional optionalString concatLines getExe; inherit (config.boot.kernelPackages) x86_energy_perf_policy cpupower; - enable_perf_policy = (lib.elem builtins.currentSystem x86_energy_perf_policy.meta.platforms); + enable_perf_policy = (lib.elem system x86_energy_perf_policy.meta.platforms); powersave = with pkgs; writeShellScriptBin "powersave-mode" (concatLines ([ "${getExe cpupower} frequency-set -g powersave -u 2000000" # clock speed diff --git a/fake_flake.nix b/fake_flake.nix index ac4f5c4..8d2b2d9 100644 --- a/fake_flake.nix +++ b/fake_flake.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: +{ pkgs, lib, config, system, ... }: let nivSources = import ./nix/sources.nix; asGithubRef = src: "github:${src.owner}/${src.repo}/${src.rev}"; @@ -18,7 +18,7 @@ in (builtins.getFlake (asGithubRef nivSources.chaotic)).nixosModules.default # fixme: ideally we'd not rely on the flake syntax to load the module ]; - nixpkgs.hostPlatform = "x86_64-linux"; + nixpkgs.hostPlatform = system; system.nixos = { distroId = "lixos"; @@ -26,15 +26,14 @@ in }; environment.sessionVariables = with config.system.nixos; { - distro = "${distroName} ${version} (${codeName}) ${builtins.currentSystem}"; -# NIXPKGS_ALLOW_UNFREE = "1"; + distro = "${distroName} ${version} (${codeName}) ${system}"; }; nixpkgs.pkgs = let src = nivSources.nixpkgs; config = { allowUnfree = true; }; - unpatched = import src { inherit config; }; + unpatched = import src { inherit config system; }; inherit (unpatched) applyPatches fetchpatch; in import @@ -48,6 +47,10 @@ in final: prev: { agenix = final.callPackage "${nivSources.agenix}/pkgs/agenix.nix" { }; } ); + _module.args = { + system = "x86_64-linux"; + }; + nix.settings.extra-substituters = [ "https://cache.lix.systems" "https://nyx.chaotic.cx/"