templates/system/flake.nix

59 lines
1.5 KiB
Nix
Raw Normal View History

{
description = "A system flake with various options for bootstrapping a complete Aux install.";
inputs = {
# Import Auxolotl libs
auxlib.url = "https://git.auxolotl.org/auxolotl/labs/archive/main.tar.gz?dir=lib";
# Import the desired Nixpkgs repo. Defaults to unstable.
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# SecureBoot support
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.0";
};
outputs =
inputs@{
self,
nixpkgs,
lanzaboote,
auxlib,
...
}:
let
forAllSystems =
function:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
] (system: function nixpkgs.legacyPackages.${system});
baseModules = [
./modules/autoimport.nix
lanzaboote.nixosModules.lanzaboote
];
system = "x86_64-linux";
hostName = builtins.abort "You need to fill in your hostName"; # Set this variable equal to your hostName
in
{
nixosConfigurations."myHost" = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
};
system = "x86_64-linux";
modules = baseModules ++ [
./host/configuration.nix
{
networking.hostName = hostName;
nixpkgs.hostPlatform = system;
}
];
};
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
};
}