mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 01:29:24 +08:00
lib.buildNixpkgsConfig: fix for non-nixos usage
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
let pkgs = import inputs.nixpkgs (localLib.buildNixpkgsConfig
|
||||
{
|
||||
inputs = { inherit (inputs.nixpkgs) lib; topInputs = inputs; };
|
||||
nixpkgs = { march = "haswell"; cuda = null; nixRoot = "/data/gpfs01/jykang/.nix"; };
|
||||
nixpkgs = { march = "haswell"; cuda = null; nixRoot = "/data/gpfs01/jykang/.nix"; nixos = false; };
|
||||
});
|
||||
in pkgs.symlinkJoin
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ let
|
||||
pkgs = import inputs.nixpkgs (localLib.buildNixpkgsConfig
|
||||
{
|
||||
inputs = { inherit (inputs.nixpkgs) lib; topInputs = inputs; };
|
||||
nixpkgs = { march = null; cuda = null; nixRoot = "/public/home/xmuhk/.nix"; };
|
||||
nixpkgs = { march = null; cuda = null; nixRoot = "/public/home/xmuhk/.nix"; nixos = false; };
|
||||
});
|
||||
lumericalLicenseManager =
|
||||
let
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
# inputs = { lib, topInputs, ...}; nixpkgs = { march, cuda, nixRoot };
|
||||
# inputs = { lib, topInputs, ...}; nixpkgs = { march, cuda, nixRoot, nixos };
|
||||
{ inputs, nixpkgs }:
|
||||
let
|
||||
platformConfig =
|
||||
if nixpkgs.march == null then { system = "x86_64-linux"; }
|
||||
else { hostPlatform = { system = "x86_64-linux"; gcc = { arch = nixpkgs.march; tune = nixpkgs.march; }; }; };
|
||||
else
|
||||
{
|
||||
${if nixpkgs.nixos then "hostPlatform" else "localSystem"} =
|
||||
{ system = "x86_64-linux"; gcc = { arch = nixpkgs.march; tune = nixpkgs.march; }; };
|
||||
};
|
||||
cudaConfig = inputs.lib.optionalAttrs (nixpkgs.cuda != null)
|
||||
(
|
||||
{ cudaSupport = true; }
|
||||
@@ -83,7 +87,7 @@ in platformConfig //
|
||||
};
|
||||
packages = name: import inputs.topInputs.${source.${name}.source or source.${name}}
|
||||
{
|
||||
localSystem = platformConfig.hostPlatform or { inherit (platformConfig) system; };
|
||||
localSystem = platformConfig.hostPlatform or platformConfig.localSystem or platformConfig;
|
||||
inherit config;
|
||||
overlays = [(source.${name}.overlay or (_: _: {}))];
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
pkgs = import inputs.nixpkgs (localLib.buildNixpkgsConfig
|
||||
{
|
||||
inputs = { inherit (inputs.nixpkgs) lib; topInputs = inputs; };
|
||||
nixpkgs = { march = null; cuda = null; nixRoot = null; };
|
||||
nixpkgs = { march = null; cuda = null; nixRoot = null; nixos = false; };
|
||||
});
|
||||
hpcstat =
|
||||
let
|
||||
|
||||
@@ -15,7 +15,8 @@ inputs:
|
||||
};
|
||||
config = let inherit (inputs.config.nixos.system) nixpkgs; in
|
||||
{
|
||||
nixpkgs = inputs.localLib.buildNixpkgsConfig { inherit inputs; nixpkgs = nixpkgs // { nixRoot = null; }; };
|
||||
nixpkgs = inputs.localLib.buildNixpkgsConfig
|
||||
{ inherit inputs; nixpkgs = nixpkgs // { nixRoot = null; nixos = true; }; };
|
||||
boot.kernelPatches = inputs.lib.mkIf (nixpkgs.march != null)
|
||||
[{
|
||||
name = "native kernel";
|
||||
|
||||
Reference in New Issue
Block a user