nixos-anywhere #4
5 changed files with 74 additions and 13 deletions
|
@ -5,6 +5,10 @@ Currently, only one physical server (named jefke) is implemented.
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
|
### NEW
|
||||||
|
|
||||||
|
`nix run github:numtide/nixos-anywhere -- --flake .#hypervisor root@jefke.hyp`
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
Before a NixOS definition can be deployed, some prerequite preparational steps must be performed.
|
Before a NixOS definition can be deployed, some prerequite preparational steps must be performed.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
imports = [ ./hardware-configuration.nix ];
|
imports = [ ./hardware-configuration.nix ./disk-config.nix ];
|
||||||
|
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
|
|
55
disk-config.nix
Normal file
55
disk-config.nix
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
# Running system:
|
||||||
|
|
||||||
|
# NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||||
|
# nvme0n1 259:0 0 465,8G 0 disk
|
||||||
|
# ├─nvme0n1p1 259:1 0 512M 0 part /boot
|
||||||
|
# ├─nvme0n1p2 259:2 0 456,5G 0 part /nix/store
|
||||||
|
# │ /
|
||||||
|
# └─nvme0n1p3 259:3 0 8,8G 0 part [SWAP]
|
||||||
|
|
||||||
|
# Filesystem 1K-blocks Used Available Use% Mounted on
|
||||||
|
# devtmpfs 809892 0 809892 0% /dev
|
||||||
|
# tmpfs 8098920 0 8098920 0% /dev/shm
|
||||||
|
# tmpfs 4049460 3988 4045472 1% /run
|
||||||
|
# tmpfs 8098920 456 8098464 1% /run/wrappers
|
||||||
|
# /dev/nvme0n1p2 469995160 17597168 428450100 4% /
|
||||||
|
# /dev/nvme0n1p1 523248 119660 403588 23% /boot
|
||||||
|
# tmpfs 1619784 0 1619784 0% /run/user/0
|
||||||
|
|
||||||
|
# Disk name: nvme0n1
|
||||||
|
# disko template: simple-efi
|
||||||
|
# https://raw.githubusercontent.com/nix-community/disko/master/example/simple-efi.nix
|
||||||
|
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
vdb = {
|
||||||
|
device = "/dev/nvme0n1";
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
type = "EF00";
|
||||||
|
size = "500M";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||||
deploy-rs.url = "github:serokell/deploy-rs";
|
deploy-rs.url = "github:serokell/deploy-rs";
|
||||||
|
disko.url = "github:nix-community/disko";
|
||||||
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, deploy-rs, ... }:
|
outputs = { self, nixpkgs, deploy-rs, disko, ... }:
|
||||||
let system = "x86_64-linux";
|
let system = "x86_64-linux";
|
||||||
in {
|
in {
|
||||||
|
|
||||||
|
@ -14,7 +16,7 @@
|
||||||
|
|
||||||
nixosConfigurations.hypervisor = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.hypervisor = nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [ ./configuration.nix ];
|
modules = [ disko.nixosModules.disko ./configuration.nix ];
|
||||||
};
|
};
|
||||||
|
|
||||||
deploy = {
|
deploy = {
|
||||||
|
|
|
@ -7,18 +7,18 @@
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
# fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/b78f591c-c9b6-4dae-9837-56716d38990b";
|
# device = "/dev/disk/by-uuid/b78f591c-c9b6-4dae-9837-56716d38990b";
|
||||||
fsType = "ext4";
|
# fsType = "ext4";
|
||||||
};
|
# };
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
# fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/6936-84C2";
|
# device = "/dev/disk/by-uuid/6936-84C2";
|
||||||
fsType = "vfat";
|
# fsType = "vfat";
|
||||||
};
|
# };
|
||||||
|
|
||||||
swapDevices =
|
# swapDevices =
|
||||||
[{ device = "/dev/disk/by-uuid/79fbd322-e58d-4e45-8969-06ef494cefea"; }];
|
# [{ device = "/dev/disk/by-uuid/79fbd322-e58d-4e45-8969-06ef494cefea"; }];
|
||||||
|
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue