nixos-anywhere-example/template/flake.nix
2023-10-12 12:02:39 +02:00

49 lines
1.6 KiB
Nix

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.disko.url = "github:nix-community/disko";
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
# Select disko disk layout configuration.
./disk-configs/simple-efi.nix
#./disk-configs/zfs.nix
#./disk-configs/luks-lvm.nix
# Change device name match your block device.
# Running `lsblk` on the target machine can help you here.
# Examples: "/dev/nvme0n1", "/dev/sda", "/dev/vda"
{ disko.devices.disk.one.device = "/dev/nvme0n1"; }
{
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
boot.swraid.enable = true;
# Alternative to grub
#boot.loader.systemd-boot.enable = true;
# when installing toggle this
#boot.loader.efi.canTouchEfiVariables = false;
}
];
};
};
}