mirror of
https://codeberg.org/privacy1st/nixos-anywhere-example
synced 2024-11-23 22:19:33 +01:00
62 lines
2.1 KiB
Nix
62 lines
2.1 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 = [
|
|
disko.nixosModules.disko
|
|
|
|
# Generate hardware configuration on target system and add it here.
|
|
# See README.md for details.
|
|
./hardware-configs/yodaHP.nix
|
|
|
|
# Select disko disk layout configuration.
|
|
#./disk-configs/simple-efi.nix
|
|
./disk-configs/luks-btrfs.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.disk1.device = "/dev/disk/by-id/nvme-SAMSUNG_MZVLW128HEGR-000H1_S33ZNX0J129742"; }
|
|
|
|
{
|
|
# The host yodaHP did not boot after installation when using grub.
|
|
#boot.loader.grub = {
|
|
# # No need to set devices, disko will add all devices that have a EF02 partition to the list already.
|
|
# # devices = [];
|
|
# efiSupport = true;
|
|
# efiInstallAsRemovable = true;
|
|
#};
|
|
|
|
# Alternative to grub.
|
|
# This worked with yodaHP host.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
services.openssh.enable = true;
|
|
users.users.root.openssh.authorizedKeys.keys = [
|
|
(builtins.readFile ./nitrokey.pub)
|
|
];
|
|
|
|
system.stateVersion = "23.05";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|