Skip to content

Commit

Permalink
aarch64 installer
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Sep 11, 2024
1 parent 145ae49 commit 2f7ecb0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 30 deletions.
4 changes: 2 additions & 2 deletions disk-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
};
};
SWAP = {
size = "32G";
size = "130G";
content = {
type = "mdraid";
name = "swap";
Expand Down Expand Up @@ -57,7 +57,7 @@
};
};
SWAP = {
size = "32G";
size = "130G";
content = {
type = "mdraid";
name = "swap";
Expand Down
34 changes: 20 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@
};
};

mkNixosConfiguration = {
system ? "x86_64-linux",
hostname,
username,
args ? {},
modules,
}: let
specialArgs = argDefaults // {inherit hostname username;} // args;
in
mkNixosConfiguration =
{ system ? "x86_64-linux"
, hostname
, username
, args ? { }
, modules
,
}:
let
specialArgs = argDefaults // { inherit hostname username; } // args;
in
nixpkgs.lib.nixosSystem {
inherit system specialArgs;
modules =
Expand All @@ -80,14 +82,18 @@
]
++ modules;
};
in {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
in
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
formatter.aarch64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
formatter.aarch64-darwin = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;

nixosConfigurations.robot = mkNixosConfiguration {
hostname = "robot";
system = "aarch64-linux";
username = "sakhib";
modules = [
./amd.nix
# ./amd.nix
disko.nixosModules.disko
./robot.nix
./linux.nix
Expand All @@ -102,9 +108,9 @@
remoteBuild = true;
nodes = {
robot = {
hostname = "95.216.248.236";
hostname = "65.109.74.214";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.robot;
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.robot;
};
};
};
Expand Down
15 changes: 7 additions & 8 deletions hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
lib,
modulesPath,
...
{ lib
, modulesPath
, ...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];

boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "sd_mod" "nvme"];
boot.initrd.kernelModules = [];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "nvme" ];
boot.initrd.kernelModules = [ ];
boot.extraModulePackages = [ ];

networking.useNetworkd = true;
networking.useDHCP = false;
Expand All @@ -22,5 +21,5 @@
networkConfig.IPv6AcceptRA = "no";
};

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}
11 changes: 5 additions & 6 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
pkgs ? let
{ pkgs ? let
lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
nixpkgs = fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
};
in
import nixpkgs {overlays = [];},
...
import nixpkgs { overlays = [ ]; }
, ...
}: {
default = pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes repl-flake";
NIX_CONFIG = "extra-experimental-features = nix-command flakes";
nativeBuildInputs = with pkgs; [
nix
nil
Expand All @@ -19,4 +18,4 @@
just
];
};
}
}

0 comments on commit 2f7ecb0

Please sign in to comment.