Sorry for what might be a dumb question, but I was wondering about the correct way to use flakes. I have the following flake.nix
file:
{
description = "A simple NixOS flake";
inputs = {
# Nixpkgs repos
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # "github:NixOS/nixpkgs/nixos-24.05"
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small";
# NixOS Hardware repo
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Home Manager repo
home-manager = {
#url = "github:nix-community/home-manager/release-24.05";
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
# Secure boot repo
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
# VPN confinement repo
vpn-confinement = {
url = "github:Maroka-chan/VPN-Confinement";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nixarr repo (test)
#nixarr.url = "github:rasmus-kirk/nixarr";
};
outputs = inputs@{
nixpkgs,
home-manager,
lanzaboote,
agenix,
#vpn-confinement, # works
#nixarr,
...
}: {
nixosConfigurations = {
homeserver = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/server/configuration.nix
# Start lanzaboote configuration
lanzaboote.nixosModules.lanzaboote
({ pkgs, lib, ... }: {
environment.systemPackages = with pkgs; [
pkgs.sbctl
];
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
})
# Start Agenix configuration
agenix.nixosModules.default
# Start Home Manager configuration
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.server = import ./modules/home/defaults.nix;
};
}
#vpn-confinement.nixosModules.default
#nixarr.nixosModules.default
];
};
};
};
}
Is this the correct way to use them? As you can probably see, I used the lanzaboote
flake provided on their quick start-guide over at GitHub and baked it into my personal flake; however, looking over at MicroVM’s GitHub repo, and the complexity of their flake, I am having doubts on whether the way I’ve written my flake is correct or not.
If it isn’t the correct way, can someone chip in on the correct way of using flakes?