nixos-config/templates/basic-nix-module-flake/nix/flake/default.nix

27 lines
732 B
Nix
Raw Normal View History

{ lib, inputs, ... }: {
2025-01-29 04:48:19 +00:00
flake = { nixosModules.default = ../modules; };
perSystem = { lib, pkgs, system, ... }: {
formatter = pkgs.treefmt;
devShells.default = import ../../shell.nix { inherit pkgs; };
# Just make sure it actually compiles with a very minimal NixOS
# configuration.
2025-01-29 04:48:19 +00:00
checks.nixos-module-test = let
nixosSystem = args:
import "${inputs.nixpkgs}/nixos/lib/eval-config.nix" args;
in nixosSystem {
modules = [
({ modulesPath, ... }: {
imports = [ "${modulesPath}/profiles/minimal.nix" ];
2025-01-29 04:48:19 +00:00
nixpkgs.hostPlatform = system;
boot.loader.grub.enable = false;
fileSystems."/".device = "nodev";
})
];
};
};
}