mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-11 16:49:22 +08:00
init aarch64 support
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
nixos =
|
||||
{
|
||||
model.arch = "aarch64";
|
||||
system =
|
||||
{
|
||||
fileSystems =
|
||||
{
|
||||
mount.btrfs."/dev/disk/by-partlabel/r2s-root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
|
||||
swap = [ "/nix/swap/swap" ];
|
||||
};
|
||||
network = {};
|
||||
};
|
||||
services =
|
||||
{
|
||||
sshd = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# inputs = { lib, topInputs, ...}; nixpkgs = { march, cuda, nixRoot, nixos };
|
||||
# inputs = { lib, topInputs, ...}; nixpkgs = { march, cuda, nixRoot, nixos, arch };
|
||||
{ inputs, nixpkgs }:
|
||||
let
|
||||
platformConfig =
|
||||
if nixpkgs.march == null then { system = "x86_64-linux"; }
|
||||
if nixpkgs.march == null then { system = "${nixpkgs.arch or "x86_64"}-linux"; }
|
||||
else
|
||||
{
|
||||
${if nixpkgs.nixos then "hostPlatform" else "localSystem"} =
|
||||
{ system = "x86_64-linux"; gcc = { arch = nixpkgs.march; tune = nixpkgs.march; }; };
|
||||
{ system = "${nixpkgs.arch or "x86_64"}-linux"; gcc = { arch = nixpkgs.march; tune = nixpkgs.march; }; };
|
||||
};
|
||||
cudaConfig = inputs.lib.optionalAttrs (nixpkgs.cuda != null)
|
||||
(
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
let
|
||||
singles = [ "nas" "pc" "vps4" "vps6" "one" "srv3" ];
|
||||
cluster = { srv1 = 3; srv2 = 2; };
|
||||
arch.r2s = "aarch64";
|
||||
deviceModules = builtins.listToAttrs
|
||||
(
|
||||
(builtins.map
|
||||
@@ -28,7 +27,7 @@ let
|
||||
in builtins.mapAttrs
|
||||
(n: v: inputs.nixpkgs.lib.nixosSystem
|
||||
{
|
||||
system = "${arch.${n} or "x86_64"}-linux";
|
||||
system = null;
|
||||
specialArgs = { topInputs = inputs; inherit localLib; };
|
||||
modules = localLib.mkModules v;
|
||||
})
|
||||
|
||||
@@ -3,6 +3,7 @@ inputs:
|
||||
options.nixos.model = let inherit (inputs.lib) mkOption types; in
|
||||
{
|
||||
hostname = mkOption { type = types.nonEmptyStr; };
|
||||
arch = mkOption { type = types.nonEmptyStr; default = "x86_64"; };
|
||||
type = mkOption { type = types.enum [ "minimal" "desktop" "server" ]; default = "minimal"; };
|
||||
private = mkOption { type = types.bool; default = false; };
|
||||
cluster = mkOption
|
||||
|
||||
@@ -16,7 +16,10 @@ inputs:
|
||||
config = let inherit (inputs.config.nixos.system) nixpkgs; in
|
||||
{
|
||||
nixpkgs = inputs.localLib.buildNixpkgsConfig
|
||||
{ inherit inputs; nixpkgs = nixpkgs // { nixRoot = null; nixos = true; }; };
|
||||
{
|
||||
inherit inputs;
|
||||
nixpkgs = nixpkgs // { nixRoot = null; nixos = true; inherit (inputs.config.nixos.model) arch; };
|
||||
};
|
||||
boot.kernelPatches = inputs.lib.mkIf (nixpkgs.march != null)
|
||||
[{
|
||||
name = "native kernel";
|
||||
|
||||
Reference in New Issue
Block a user