nixos-anywhere-example/flake.nix

40 lines
1.4 KiB
Nix
Raw Normal View History

2023-08-08 19:48:43 +02:00
{
2023-08-14 17:15:42 +02:00
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2023-08-08 19:48:43 +02:00
2023-08-14 17:15:42 +02:00
inputs.disko.url = "github:nix-community/disko";
2023-08-08 19:48:43 +02:00
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere";
inputs.nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, disko, nixos-anywhere, ... }@attrs: {
packages."x86_64-linux".makeDiskImageTest = disko.lib.lib.makeDiskImage {
nixosConfig = self.nixosConfigurations.mysystem;
};
packages."x86_64-linux".makeDiskScriptTest = disko.lib.lib.makeDiskImageScript {
nixosConfig = self.nixosConfigurations.mysystem;
};
nixosConfigurations.mysystem = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
(nixpkgs.outPath + "/nixos/modules/installer/scan/not-detected.nix")
disko.nixosModules.disko
./disk-configs/simple-efi.nix # choose your favorite disk layout here
2023-08-15 13:29:21 +02:00
#./disk-configs/zfs.nix # choose your favorite disk layout here
2023-08-08 19:48:43 +02:00
{
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
2023-08-15 13:29:21 +02:00
boot.swraid.enable = true;
2023-08-14 17:15:42 +02:00
# Alternative to grub
#boot.loader.systemd-boot.enable = true;
# when installing toggle this
#boot.loader.efi.canTouchEfiVariables = false;
2023-08-08 19:48:43 +02:00
}
];
};
};
}