feat: add hosts/aijiro config
My portable desktop machine.
This commit is contained in:
parent
327b113a07
commit
79acd090f4
30
hosts/aijiro/README.org
Normal file
30
hosts/aijiro/README.org
Normal file
|
@ -0,0 +1,30 @@
|
|||
#+TITLE: Aijiro
|
||||
#+DATE: September 3, 2021
|
||||
|
||||
* Overview
|
||||
...
|
||||
|
||||
* Specs
|
||||
+ Intel i5-6400
|
||||
+ 8GB
|
||||
|
||||
* Installation
|
||||
** Set up root file system
|
||||
#+BEGIN_SRC sh
|
||||
parted /dev/sda -- mklabel gpt
|
||||
parted /dev/sda -- mkpart ESP fat32 1MiB 512MiB
|
||||
parted /dev/sda -- mkpart primary linux-swap 512MiB 8.5GiB
|
||||
parted /dev/sda -- mkpart primary 8.5GiB 100%
|
||||
parted /dev/sda -- set 1 boot on
|
||||
mkfs.fat -F32 -n BOOT /dev/sda1
|
||||
mkswap -L swap /dev/sda2
|
||||
mkfs.ext4 -L nixos /dev/sda3
|
||||
#+END_SRC
|
||||
|
||||
** Mount drives
|
||||
#+BEGIN_SRC sh
|
||||
mount /dev/sda3 /mnt
|
||||
mkdir -p /mnt/boot
|
||||
mount /dev/sda1 /mnt/boot
|
||||
swapon /dev/sda2
|
||||
#+END_SRC
|
86
hosts/aijiro/default.nix
Normal file
86
hosts/aijiro/default.nix
Normal file
|
@ -0,0 +1,86 @@
|
|||
# Shiro -- my laptop
|
||||
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../home.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
## Modules
|
||||
modules = {
|
||||
desktop = {
|
||||
bspwm.enable = true;
|
||||
apps = {
|
||||
discord.enable = true;
|
||||
rofi.enable = true;
|
||||
# godot.enable = true;
|
||||
};
|
||||
browsers = {
|
||||
default = "brave";
|
||||
brave.enable = true;
|
||||
# firefox.enable = true;
|
||||
# qutebrowser.enable = true;
|
||||
};
|
||||
gaming = {
|
||||
# steam.enable = true;
|
||||
# emulators.enable = true;
|
||||
# emulators.psx.enable = true;
|
||||
};
|
||||
media = {
|
||||
daw.enable = true;
|
||||
documents.enable = true;
|
||||
graphics.enable = true;
|
||||
mpv.enable = true;
|
||||
recording.enable = true;
|
||||
spotify.enable = true;
|
||||
};
|
||||
term = {
|
||||
default = "xst";
|
||||
st.enable = true;
|
||||
};
|
||||
vm = {
|
||||
qemu.enable = true;
|
||||
};
|
||||
};
|
||||
dev = {
|
||||
node.enable = true;
|
||||
rust.enable = true;
|
||||
python.enable = true;
|
||||
};
|
||||
editors = {
|
||||
default = "nvim";
|
||||
emacs.enable = true;
|
||||
vim.enable = true;
|
||||
};
|
||||
shell = {
|
||||
# adl.enable = true;
|
||||
vaultwarden.enable = true;
|
||||
direnv.enable = true;
|
||||
git.enable = true;
|
||||
gnupg.enable = true;
|
||||
tmux.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
services = {
|
||||
ssh.enable = true;
|
||||
docker.enable = true;
|
||||
# Needed occasionally to help the parental units with PC problems
|
||||
# teamviewer.enable = true;
|
||||
};
|
||||
theme.active = "alucard";
|
||||
};
|
||||
|
||||
|
||||
## Local config
|
||||
programs.ssh.startAgent = true;
|
||||
services.openssh.startWhenNeeded = true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
# The global useDHCP flag is deprecated, therefore explicitly set to false
|
||||
# here. Per-interface useDHCP will be mandatory in the future, so this
|
||||
# generated config replicates the default behaviour.
|
||||
networking.useDHCP = false;
|
||||
|
||||
time.timeZone = "Europe/Copenhagen";
|
||||
}
|
57
hosts/aijiro/hardware-configuration.nix
Normal file
57
hosts/aijiro/hardware-configuration.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{ config, lib, pkgs, inputs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "nvme" ];
|
||||
initrd.kernelModules = [ "dm-snapshot" ];
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
extraModulePackages = [ ];
|
||||
kernelParams = [
|
||||
# HACK Disables fixes for spectre, meltdown, L1TF and a number of CPU
|
||||
# vulnerabilities. Don't copy this blindly! And especially not for
|
||||
# mission critical or server/headless builds exposed to the world.
|
||||
"mitigations=off"
|
||||
];
|
||||
|
||||
# Refuse ICMP echo requests on my desktop/laptop; nobody has any business
|
||||
# pinging them, unlike my servers.
|
||||
kernel.sysctl."net.ipv4.icmp_echo_ignore_broadcasts" = 1;
|
||||
};
|
||||
|
||||
# Modules
|
||||
modules.hardware = {
|
||||
audio.enable = true;
|
||||
fs = {
|
||||
enable = true;
|
||||
ssd.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# CPU
|
||||
nix.maxJobs = lib.mkDefault 4;
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
# performance gives better battery life/perf than ondemand on sandy bridge and
|
||||
# newer because of intel pstates.
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
# Without this wpa_supplicant may fail to auto-discover wireless interfaces at
|
||||
# startup (and must be restarted).
|
||||
networking.wireless.interfaces = [ "wlp3s0" ];
|
||||
|
||||
# Storage
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
swapDevices = [ { device = "/dev/disk/by-label/swap"; }];
|
||||
}
|
Loading…
Reference in a new issue