全局启用native,但排除个别包极其依赖

This commit is contained in:
2023-06-14 00:35:11 +08:00
parent 14d793b47e
commit fbc3dbeaf2
5 changed files with 46 additions and 44 deletions

View File

@@ -120,32 +120,6 @@
./modules/virtualisation/waydroid.nix
./modules/home/root.nix
./modules/home/chn.nix
({ pkgs, ...}@inputs:
{
config.environment.systemPackages =
[
( inputs.inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
modules = [({ pkgs, ... }@inputs:
{
config.nixpkgs =
{
hostPlatform =
{ system = "x86_64-linux"; gcc = { arch = "alderlake"; tune = "alderlake"; }; };
config.allowUnfree = true;
};
config.nixpkgs.overlays = [( final: prev: rec
{
optimizeWithFlags = pkg: flags: pkg.overrideAttrs (old:
{ NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags; });
hello = optimizeWithFlags prev.hello [ "-frecord-gcc-switches" ];
} )];
})];
} ).pkgs.hello
];
})
];
};

View File

@@ -2,7 +2,7 @@
{
config =
{
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.hostPlatform = inputs.lib.mkDefault "x86_64-linux";
nix =
{
settings =

View File

@@ -1,21 +1,10 @@
inputs:
{ pkgs, ... }@inputs:
{
config =
{
boot =
{
kernelPackages = ( inputs.inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
modules =
[{
nixpkgs =
{
hostPlatform = { system = "x86_64-linux"; gcc = { arch = "alderlake"; tune = "alderlake"; }; };
config.allowUnfree = true;
};
}];
} ).pkgs.linuxPackages_xanmod_latest;
kernelPackages = inputs.pkgs.linuxPackages_xanmod_latest;
initrd.availableKernelModules =
[
"ahci" "i915" "intel_cstate" "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" "nvme" "sr_mod"

View File

@@ -1 +1,11 @@
{ config.nix.settings.system-features = [ "gccarch-alderlake" ]; }
{
config =
{
nix.settings.system-features = [ "gccarch-alderlake" ];
nixpkgs =
{
hostPlatform = { system = "x86_64-linux"; gcc = { arch = "alderlake"; tune = "alderlake"; }; };
config.allowUnfree = true;
};
};
}

View File

@@ -3,10 +3,39 @@
config =
{
environment.systemPackages = [ inputs.config.nur.repos.ataraxiasjel.proton-ge ];
programs =
programs = let generic-pkgs = (inputs.inputs.nixpkgs.lib.nixosSystem
{
anime-game-launcher.enable = true;
honkers-railway-launcher.enable = true;
system = "x86_64-linux";
specialArgs = { inputs = inputs.inputs; };
modules =
[
inputs.inputs.aagl.nixosModules.default
({ pkgs, ...}@inputs:
{
config.nixpkgs =
{
config.allowUnfree = true;
overlays =
[( final: prev:
{
anime-game-launcher = inputs.inputs.aagl.packages.x86_64-linux.anime-game-launcher;
honkers-railway-launcher = inputs.inputs.aagl.packages.x86_64-linux.honkers-railway-launcher;
} )];
};
})
];
}).pkgs;
in {
anime-game-launcher =
{
enable = true;
package = generic-pkgs.anime-game-launcher;
};
honkers-railway-launcher =
{
enable = true;
package = generic-pkgs.honkers-railway-launcher;
};
steam.enable = true;
};
};