feat(router0-dmz0): init bpir3 based router
This commit is contained in:
parent
5ec13b17b7
commit
6a2993b665
20 changed files with 1112 additions and 211 deletions
93
nix/os/devices/router0-dmz0/flake.nix
Normal file
93
nix/os/devices/router0-dmz0/flake.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
inputs = {
|
||||
# nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
||||
nixpkgs-master.url = "github:nixos/nixpkgs/master";
|
||||
|
||||
get-flake.url = "github:ursi/get-flake";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager/master";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
disko.url = "github:nix-community/disko";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
srvos.url = "github:numtide/srvos";
|
||||
srvos.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
bpir3.url = "github:nakato/nixos-bpir3-example";
|
||||
bpir3.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
nixos-nftables-firewall.url = "github:thelegy/nixos-nftables-firewall";
|
||||
nixos-nftables-firewall.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# outputs = _: {};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
get-flake,
|
||||
nixpkgs,
|
||||
bpir3,
|
||||
...
|
||||
} @ attrs: let
|
||||
system = "aarch64-linux";
|
||||
nodeName = "router0-dmz0";
|
||||
|
||||
mkNixosConfiguration = {extraModules ? [], ...} @ attrs:
|
||||
nixpkgs.lib.nixosSystem (
|
||||
nixpkgs.lib.attrsets.recursiveUpdate
|
||||
attrs
|
||||
{
|
||||
specialArgs = {
|
||||
nodeFlake = self;
|
||||
repoFlake = get-flake ../../../..;
|
||||
inherit nodeName;
|
||||
inherit
|
||||
(bpir3.packages.${system})
|
||||
armTrustedFirmwareMT7986
|
||||
;
|
||||
};
|
||||
|
||||
modules =
|
||||
[
|
||||
./configuration.nix
|
||||
|
||||
# flake registry
|
||||
{
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
}
|
||||
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(final: previous: let
|
||||
bpir3Pkgs = previous.callPackage "${bpir3}/pkgs" {};
|
||||
in {
|
||||
inherit
|
||||
(bpir3Pkgs)
|
||||
linuxPackages_bpir3
|
||||
;
|
||||
})
|
||||
];
|
||||
}
|
||||
]
|
||||
++ extraModules;
|
||||
}
|
||||
);
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
native = mkNixosConfiguration {
|
||||
inherit system;
|
||||
};
|
||||
|
||||
cross = mkNixosConfiguration {
|
||||
extraModules = [
|
||||
{
|
||||
nixpkgs.buildPlatform.system = "x86_64-linux";
|
||||
nixpkgs.hostPlatform.system = system;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue