mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Merge pull request #475 from genebean/pi-setup
Setup a Pi 3, fix hetznix02
This commit is contained in:
commit
a887a08e6e
6 changed files with 98 additions and 12 deletions
16
INSTALLATION.md
Normal file
16
INSTALLATION.md
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
## Installing on aarch64-linux
|
||||||
|
|
||||||
|
1. set password
|
||||||
|
2. create a temp ubuntu server if this is the first aarch64 host and ssh into it: `ssh -o UserKnownHostsFile=/dev/null root@<ip of temp host>`
|
||||||
|
3. `curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install`
|
||||||
|
4. `. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh`
|
||||||
|
5. Run these commands:
|
||||||
|
```bash
|
||||||
|
read -s SSHPASS
|
||||||
|
export SSHPASS=$SSHPASS
|
||||||
|
export TARGET_HOST=hetznix02
|
||||||
|
export DOTS_BRANCH=pi-setup
|
||||||
|
nix --extra-experimental-features 'flakes nix-command' run github:nix-community/nixos-anywhere -- --env-password --flake github:genebean/dots/${DOTS_BRANCH}#${TARGET_HOST} --target-host nixos@195.201.224.89
|
||||||
|
```
|
||||||
|
6. Delete temp server
|
||||||
|
7.
|
||||||
|
|
@ -159,6 +159,13 @@
|
||||||
inputs.nixos-hardware.nixosModules.dell-xps-13-9360
|
inputs.nixos-hardware.nixosModules.dell-xps-13-9360
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
raspberry = localLib.mkNixosHost {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
hostname = "raspberry";
|
||||||
|
additionalModules = [
|
||||||
|
inputs.nixos-hardware.nixosModules.raspberry-pi-3
|
||||||
|
];
|
||||||
|
};
|
||||||
}; # end nixosConfigurations
|
}; # end nixosConfigurations
|
||||||
|
|
||||||
# Home Manager (only) users
|
# Home Manager (only) users
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk.disk1 = {
|
disk.primary = {
|
||||||
device = lib.mkDefault "/dev/sda";
|
device = lib.mkDefault "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_51838383";
|
||||||
type = "disk";
|
type = "disk";
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
|
|
@ -38,5 +38,26 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
disk.volume1 = {
|
||||||
|
device = lib.mkDefault "/dev/disk/by-id/scsi-0HC_Volume_101886924";
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
nix = {
|
||||||
|
name = "nix";
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = [
|
||||||
|
"defaults"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,23 +10,30 @@
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
|
availableKernelModules = [ "xhci_pci" "virtio_scsi" "sr_mod" ];
|
||||||
kernelModules = [ "nvme" ];
|
kernelModules = [ ];
|
||||||
};
|
};
|
||||||
kernelModules = [ ];
|
kernelModules = [ ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = {
|
fileSystems."/" =
|
||||||
"/boot" = {
|
{ device = "/dev/disk/by-partlabel/disk-primary-root";
|
||||||
device = lib.mkForce "/dev/disk/by-uuid/D005-6C65";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
"/" = {
|
|
||||||
device = lib.mkForce "/dev/sda1";
|
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-partlabel/disk-primary-ESP";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/nix" =
|
||||||
|
{ device = "/dev/disk/by-partlabel/disk-volume1-nix";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
|
|
||||||
31
modules/hosts/nixos/raspberry/default.nix
Normal file
31
modules/hosts/nixos/raspberry/default.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{ inputs, username, ... }: {
|
||||||
|
imports = [
|
||||||
|
# SD card image
|
||||||
|
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
|
||||||
|
networking.wireless = {
|
||||||
|
enable = true;
|
||||||
|
networks = {
|
||||||
|
# Public networks
|
||||||
|
"Gallery Row-GuestWiFi" = {};
|
||||||
|
"LocalTies Guest" = {
|
||||||
|
psk = "DrinkLocal!";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.${username} = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Gene Liverman";
|
||||||
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
linger = true;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFvLaPTfG3r+bcbI6DV4l69UgJjnwmZNCQk79HXyf1Pt gene@rainbow-planet"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIp42X5DZ713+bgbOO+GXROufUFdxWo7NjJbGQ285x3N gene.liverman@ltnglobal.com"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
4
modules/hosts/nixos/raspberry/home-gene.nix
Normal file
4
modules/hosts/nixos/raspberry/home-gene.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{ ... }: {
|
||||||
|
home.stateVersion = "24.11";
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue