chore: cleanup and refactor

This commit is contained in:
steveej 2024-08-22 14:33:00 +02:00
parent a105680d8b
commit a21c2f544c
8 changed files with 35 additions and 460 deletions

View file

@ -34,24 +34,31 @@
nixpkgs,
...
}: let
targetPlatform = "aarch64-linux";
buildPlatform = "x86_64-linux";
nativeSystem = "aarch64-linux";
nodeName = "steveej-x13s";
pkgs = nixpkgs.legacyPackages.${nativeSystem};
pkgsCross = import self.inputs.nixpkgs {
system = "x86_64-linux";
crossSystem = {
config = "aarch64-unknown-linux-gnu";
};
};
repoFlake = get-flake ../../../..;
mkNixosConfiguration = {
nodeName,
extraModules ? [],
...
} @ attrs:
mkNixosConfiguration = {extraModules ? [], ...} @ attrs:
nixpkgs.lib.nixosSystem (
nixpkgs.lib.attrsets.recursiveUpdate
attrs
{
specialArgs =
(import ./default.nix {
system = targetPlatform;
inherit nodeName repoFlake;
system = nativeSystem;
inherit nodeName;
inherit repoFlake;
repoFlakeWithSystem = repoFlake.lib.withSystem;
nodeFlake = self;
})
.meta
@ -60,7 +67,13 @@
modules =
[
# repoFlake.nixosModules.hardware-x13s
./configuration.nix
# flake registry
{
nixpkgs.overlays = builtins.attrValues self.overlays;
nix.registry.nixpkgs.flake = nixpkgs;
}
]
++ extraModules;
}
@ -70,30 +83,21 @@
inherit mkNixosConfiguration;
};
nixosConfigurations = let
nodeName = "steveej-x13s";
in {
overlays = {};
nixosConfigurations = {
native = mkNixosConfiguration {
inherit nodeName;
system = targetPlatform;
extraModules = [
./configuration.nix
];
system = nativeSystem;
};
cross = mkNixosConfiguration {
inherit nodeName;
extraModules = [
./configuration.nix
{
nixpkgs.buildPlatform.system = buildPlatform;
nixpkgs.hostPlatform.system = targetPlatform;
nixpkgs.buildPlatform.system = "x86_64-linux";
nixpkgs.hostPlatform.system = nativeSystem;
}
];
};
};
packages.${targetPlatform} = {
};
};
}