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

108 lines
2.9 KiB
Nix
Raw Normal View History

{
2024-02-08 20:53:22 +01:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
# nixpkgs.follows = "nixpkgs-unstable";
2024-02-08 20:53:22 +01:00
# required for home-manager modules
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
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"
# 6.11.0
# "git+https://forgejo.www.stefanjunker.de/steveej/nixos-x13s.git?branch=remaintain&rev=6b9efe77ca80653354981c720af3c4241ac71490"
# 6.12.0-rc6
# "git+https://forgejo.www.stefanjunker.de/steveej/nixos-x13s.git?branch=remaintain&rev=bd580ee9c35fcb8a720122d5bb2f903f1b7395ee"
# "git+https://forgejo.www.stefanjunker.de/steveej/nixos-x13s.git?branch=remaintain&rev=1286d20be2321a1a2d27f5d09257ebaf54ce0630"
#"/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";
mycelium.inputs.nixpkgs.follows = "nixpkgs";
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";
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
};
}