nixbsd-config/flake.nix

66 lines
1.5 KiB
Nix
Raw Normal View History

2024-03-04 01:30:20 +00:00
{
inputs = {
nixpkgs.url = "github:rhelmot/nixpkgs/freebsd-staging";
utils.url = "github:numtide/flake-utils";
2024-03-11 18:38:30 +00:00
nix = {
url = "github:rhelmot/nix/freebsd-staging";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-regression.follows = "nixpkgs";
};
2024-03-04 01:30:20 +00:00
nixbsd = {
url = "github:nixos-bsd/nixbsd";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "utils";
2024-03-11 18:38:30 +00:00
inputs.nix.follows = "nix";
};
attic = {
url = "github:nixos-bsd/attic";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils";
inputs.nix.follows = "nix";
inputs.nixpkgs-stable.follows = "nixpkgs";
2024-03-04 01:30:20 +00:00
};
};
outputs =
{
nixpkgs,
nixbsd,
utils,
2024-03-11 18:38:30 +00:00
attic,
2024-03-04 01:30:20 +00:00
...
2024-03-11 18:38:30 +00:00
}@inputs:
2024-03-04 01:30:20 +00:00
let
baseDir = ./system;
2024-03-11 18:38:30 +00:00
makeSystem =
module:
nixbsd.lib.nixbsdSystem {
modules = [ module ];
specialArgs = {
inherit inputs;
};
};
2024-03-04 01:30:20 +00:00
in
{
nixosConfigurations = nixpkgs.lib.mapAttrs (name: _: makeSystem (baseDir + "/${name}")) (
builtins.readDir baseDir
);
}
//
utils.lib.eachSystem
[
"aarch64-linux"
"x86_64-linux"
"x86_64-freebsd"
]
(
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
formatter = pkgs.nixfmt-rfc-style;
}
);
}