2023-06-28 20:25:04 -06:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixos-hardware = { url = github:NixOS/nixos-hardware; };
|
|
|
|
|
2023-06-28 20:26:30 -06:00
|
|
|
nixpkgs = { url = github:NixOS/nixpkgs/nixos-unstable; };
|
2023-06-28 20:25:04 -06:00
|
|
|
|
|
|
|
home-manager = {
|
|
|
|
url = github:nix-community/home-manager;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
nix = {
|
2023-07-28 10:02:12 -06:00
|
|
|
url = github:IvanMalison/nix/my2.15.1;
|
2023-06-28 20:25:04 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
flake-utils = {
|
|
|
|
url = github:numtide/flake-utils;
|
|
|
|
inputs.systems.follows = "systems";
|
|
|
|
};
|
|
|
|
|
|
|
|
systems = { url = github:nix-systems/default; };
|
|
|
|
|
|
|
|
git-ignore-nix = {
|
|
|
|
url = github:hercules-ci/gitignore.nix;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-07-26 13:14:00 -06:00
|
|
|
nixos-wsl = { url = github:nix-community/NixOS-WSL; };
|
2023-06-28 20:25:04 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = inputs@{
|
2023-06-29 01:11:43 -06:00
|
|
|
self, nixpkgs, nixos-hardware, home-manager, nix, ...
|
2023-06-28 20:25:04 -06:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
mkConfig =
|
|
|
|
args@
|
|
|
|
{ system ? "x86_64-linux"
|
|
|
|
, baseModules ? []
|
|
|
|
, modules ? []
|
|
|
|
, specialArgs ? {}
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
nixpkgs.lib.nixosSystem (args // {
|
|
|
|
inherit system;
|
|
|
|
modules = baseModules ++ modules;
|
|
|
|
specialArgs = { inherit inputs; } // specialArgs;
|
2023-08-19 22:54:14 -06:00
|
|
|
makeEnable = (import ../make-enable.nix) nixpkgs.lib;
|
2023-06-28 20:25:04 -06:00
|
|
|
});
|
2023-06-28 21:30:23 -06:00
|
|
|
machinesPath = ../machines;
|
|
|
|
machineFilenames = builtins.attrNames (builtins.readDir machinesPath);
|
2023-06-28 20:25:04 -06:00
|
|
|
machineNameFromFilename = filename: builtins.head (builtins.split "\\." filename);
|
|
|
|
mkConfigurationParams = filename: {
|
|
|
|
name = machineNameFromFilename filename;
|
|
|
|
value = {
|
2023-07-26 13:14:00 -06:00
|
|
|
modules = [ (machinesPath + ("/" + filename)) ];
|
2023-06-28 20:25:04 -06:00
|
|
|
};
|
|
|
|
};
|
|
|
|
defaultConfigurationParams =
|
|
|
|
builtins.listToAttrs (map mkConfigurationParams machineFilenames);
|
|
|
|
customParams = {
|
|
|
|
biskcomp = {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
};
|
|
|
|
air-gapped-pi = {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
nixosConfigurations = builtins.mapAttrs (machineName: params:
|
|
|
|
let machineParams =
|
|
|
|
if builtins.hasAttr machineName customParams
|
|
|
|
then (builtins.getAttr machineName customParams)
|
|
|
|
else {};
|
|
|
|
in mkConfig (params // machineParams)
|
|
|
|
) defaultConfigurationParams;
|
|
|
|
};
|
|
|
|
}
|