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

109 lines
2.6 KiB
Nix
Raw Normal View History

{
2024-02-08 20:53:22 +01:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
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
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
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
2024-02-08 20:53:22 +01:00
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-x13s.url =
# "git+https://forgejo.www.stefanjunker.de/steveej/nixos-x13s.git?branch=remaintain"
"/home/steveej/src/others/nixos-x13s"
#
;
# 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";
mycelium.url = "github:threefoldtech/mycelium";
nix-snapshotter = {
url = "github:yu-re-ka/nix-snapshotter";
# url = "github:pdtpartners/nix-snapshotter";
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
2024-08-22 14:33:00 +02:00
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";
};
};
2024-02-08 20:53:22 +01:00
repoFlake = get-flake ../../../..;
2024-08-22 14:33:00 +02:00
mkNixosConfiguration = {extraModules ? [], ...} @ attrs:
2024-02-08 20:53:22 +01:00
nixpkgs.lib.nixosSystem (
nixpkgs.lib.attrsets.recursiveUpdate
attrs
{
specialArgs =
(import ./default.nix {
2024-08-22 14:33:00 +02:00
system = nativeSystem;
inherit nodeName;
2024-08-22 14:33:00 +02:00
inherit repoFlake;
repoFlakeWithSystem = repoFlake.lib.withSystem;
2024-02-08 20:53:22 +01:00
nodeFlake = self;
})
.meta
.nodeSpecialArgs
.${nodeName};
2024-02-08 20:53:22 +01:00
modules =
[
2024-08-22 14:33:00 +02:00
./configuration.nix
# flake registry
{
nixpkgs.overlays = builtins.attrValues self.overlays;
nix.registry.nixpkgs.flake = nixpkgs;
}
2024-02-08 20:53:22 +01:00
]
++ extraModules;
}
);
in {
lib = {
inherit mkNixosConfiguration;
};
2024-08-22 14:33:00 +02:00
overlays = {};
nixosConfigurations = {
2024-02-08 20:53:22 +01:00
native = mkNixosConfiguration {
2024-08-22 14:33:00 +02:00
system = nativeSystem;
2024-02-08 20:53:22 +01:00
};
2024-02-08 20:53:22 +01:00
cross = mkNixosConfiguration {
extraModules = [
{
2024-08-22 14:33:00 +02:00
nixpkgs.buildPlatform.system = "x86_64-linux";
nixpkgs.hostPlatform.system = nativeSystem;
2024-02-08 20:53:22 +01:00
}
];
};
};
2024-02-08 20:53:22 +01:00
};
}