rename systems -> hosts. Per host program specifications for user programs

This commit is contained in:
ringofstorms 2024-04-01 18:44:16 -05:00
parent ef0f74aae3
commit 2bea94afc4
23 changed files with 52 additions and 27 deletions

View file

@ -0,0 +1,86 @@
{ config, lib, pkgs, settings, ... } @ args:
{
imports =
[
# TODO revisit
(settings.hostsDir + "/_common/components/todo_neovim.nix")
# Common components this machine uses
(settings.hostsDir + "/_common/components/systemd_boot.nix")
(settings.hostsDir + "/_common/components/ssh.nix")
(settings.hostsDir + "/_common/components/caps_to_escape_in_tty.nix")
(settings.hostsDir + "/_common/components/font_jetbrainsmono.nix")
(settings.hostsDir + "/_common/components/home_manager.nix")
(settings.hostsDir + "/_common/components/gnome_wayland.nix")
# Users this machine has
(settings.usersDir + "/root/configuration.nix")
(settings.usersDir + "/josh/configuration.nix")
# Our custom stuff
./stupid-keyboard.nix
];
# machine specific configuration
# ==============================
hardware.enableAllFirmware = true;
# Connectivity
networking.networkmanager.enable = true;
hardware.bluetooth.enable = true;
environment.shellAliases = {
wifi = "nmtui";
};
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
environment.systemPackages = with pkgs; [
# [Laptop] Battery status
acpi
];
environment.shellAliases = {
battery = "acpi";
};
# [Laptop] screens with brightness settings
programs.light.enable = true;
console = {
# We want to be able to read the screen so use a 32 sized font on this tiny panel
font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
};
# ========
# FINGERPRINTS for the sensor on GPD P3 do not work on linux yet: todo find the source of this again online for tracking...
# Attempting to get fingerprint scanner to work... having issues though, no device detected with all methods
# services.fprintd = {
# enable = true;
# tod = {
# enable = true;
# driver = pkgs.libfprint-2-tod1-elan;
# };
# };
# TODO evaluate if any of this kernal/hardware stuff is actually needed for our pocket. This is a hodge podge of shit from online
# The GPD Pocket3 uses a tablet OLED display, that is mounted rotated 90° counter-clockwise.
# This requires cusotm kernal params.
boot.kernelParams = [
"video=DSI-1:panel_orientation=right_side_up"
"fbcon=rotate:1"
"mem_sleep_default=s2idel"
];
boot.kernelModules = [ "btusb" ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "thunderbolt" ];
services.xserver.videoDrivers = [ "intel" ];
hardware.opengl = {
enable = true;
driSupport = true;
};
hardware.opengl.extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
];
# Stuff from https://github.com/NixOS/nixos-hardware/blob/9a763a7acc4cfbb8603bb0231fec3eda864f81c0/gpd/pocket-3/default.nix
services.fstrim.enable = true;
services.xserver.libinput.enable = true;
services.tlp.enable = lib.mkDefault ((lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|| !config.services.power-profiles-daemon.enable);
}

View file

@ -0,0 +1,41 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3A6C-BF60";
fsType = "vfat";
# umask=0077 ensures that only the owner (root) can read, write, or execute files on the EFI partition, while all other users are denied all permissions
options = [ "umask=0077" ];
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/e740e27d-13bf-468c-a5c6-fa06fe4ac3cd";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/91682eed-a01c-482d-8000-bd1222d4952a"; }
];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp175s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,34 @@
# This nix file is just a fix for a really stupid lay-outed keyboard I bought that I
# only use with the gpd pocket 3. Probably not relevant to anyone else
#
# Keyboard in question: https://www.walmart.com/ip/R-Go-Split-Ergonomic-Keyboard-QWERTY-US-Black-Wired-USB-Keyboard-Spilt-Wired-Windows-Linux/452297950
# R-Go Split Break Keyboard (maybe the walmart one is a fake since their real site does not have the same layout)
# https://www.r-go-tools.com/ergonomic-keyboard/r-go-split-break/
{ ... }:
let
rgo_keyboard_vid = "0911";
rgo_keyboard_pid = "2188";
rgo_hub_vid = "05e3";
rgo_hub_pid = "0608";
in
{
services.keyd = {
enable = true;
# `keyd monitor` to get new keys to remap
keyboards = {
rgo_sino_keyboard = {
ids = [ "0911:2188" "05e3:0608" ];
settings = {
main = {
# Backslash is in place of the enter key's normal position, so setting it to enter
"\\" = "enter";
# This keyboard has a strange extra key that outputs < and > characters. It has the
# backslash key printed on it though, conveniently, so we will just map this to backslash
# since it does not affect how I use left shift (which it takes half the space of)
"102nd" = "\\";
};
};
};
};
};
}