feat: set up 'eetion-02' raspberry pi host
This commit is contained in:
86
hosts/eetion-02/default.nix
Normal file
86
hosts/eetion-02/default.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
# Raspberry Pi 3
|
||||
# See <https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi_3>
|
||||
|
||||
let
|
||||
username = "h";
|
||||
hostName = "eetion-02";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./hard.nix
|
||||
../../modules/ssh/hardened-openssh.nix
|
||||
];
|
||||
|
||||
ssh = {
|
||||
inherit username;
|
||||
publicHostname = "eetion-02";
|
||||
authorizedHosts = [
|
||||
"andromache"
|
||||
"astyanax"
|
||||
];
|
||||
};
|
||||
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"console=ttyS1,115200n8"
|
||||
];
|
||||
|
||||
kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||
|
||||
loader = {
|
||||
grub.enable = false;
|
||||
generic-extlinux-compatible.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
networking = {
|
||||
inherit hostName;
|
||||
networkmanager.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
users.users = {
|
||||
root.hashedPassword = "!";
|
||||
${username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
};
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
harden = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
git
|
||||
];
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
trusted-users = [
|
||||
"root"
|
||||
"@wheel"
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
24
hosts/eetion-02/hard.nix
Normal file
24
hosts/eetion-02/hard.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [ ];
|
||||
initrd.kernelModules = [ ];
|
||||
kernelModules = [ ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/NIXOS_SD";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
}
|
||||
1
hosts/eetion-02/system.nix
Normal file
1
hosts/eetion-02/system.nix
Normal file
@@ -0,0 +1 @@
|
||||
"aarch64-linux"
|
||||
Reference in New Issue
Block a user