infra/nix/os/devices/steveej-x13s/flake.nix

94 lines
2.2 KiB
Nix
Raw Normal View History

{
2024-02-08 20:53:22 +01:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
2024-02-08 20:53:22 +01:00
# required for home-manager modules
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2024-02-08 20:53:22 +01:00
nixpkgs-2211.url = "github:nixos/nixpkgs/nixos-22.11";
2024-02-08 20:53:22 +01:00
get-flake.url = "github:ursi/get-flake";
2024-02-08 20:53:22 +01:00
disko.inputs.nixpkgs.follows = "nixpkgs";
2024-02-08 20:53:22 +01:00
mobile-nixos.url = "github:NixOS/mobile-nixos";
mobile-nixos.flake = false;
2024-02-08 20:53:22 +01:00
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-x13s.url = "git+https://codeberg.org/adamcstephens/nixos-x13s?ref=main";
# nixos-x13s.url = "git+https://codeberg.org/adamcstephens/nixos-x13s?ref=refs/tags/2024-02-28";
2024-02-08 20:59:08 +01:00
# nixos-x13s.url = "path:/home/steveej/src/others/nixos-x13s";
# nixos-x13s.inputs.nixpkgs.follows = "nixpkgs";
2024-02-08 20:53:22 +01:00
};
2024-02-08 20:53:22 +01:00
outputs = {
self,
get-flake,
nixpkgs,
...
}: let
targetPlatform = "aarch64-linux";
buildPlatform = "x86_64-linux";
repoFlake = get-flake ../../../..;
2024-02-08 20:53:22 +01:00
mkNixosConfiguration = {
nodeName,
extraModules ? [],
...
} @ attrs:
nixpkgs.lib.nixosSystem (
nixpkgs.lib.attrsets.recursiveUpdate
attrs
{
specialArgs =
(import ./default.nix {
system = targetPlatform;
inherit nodeName repoFlake;
2024-02-08 20:53:22 +01:00
nodeFlake = self;
})
.meta
.nodeSpecialArgs
.${nodeName};
2024-02-08 20:53:22 +01:00
modules =
[
# repoFlake.nixosModules.hardware-x13s
]
++ extraModules;
}
);
in {
lib = {
inherit mkNixosConfiguration;
};
nixosConfigurations = let
nodeName = "steveej-x13s";
in {
native = mkNixosConfiguration {
inherit nodeName;
system = targetPlatform;
extraModules = [
./configuration.nix
];
};
2024-02-08 20:53:22 +01:00
cross = mkNixosConfiguration {
inherit nodeName;
extraModules = [
./configuration.nix
2024-02-08 20:53:22 +01:00
{
nixpkgs.buildPlatform.system = buildPlatform;
nixpkgs.hostPlatform.system = targetPlatform;
}
];
};
};
2024-02-08 20:53:22 +01:00
};
}