From eb06f66f4b4e954c30c1fa2def8021f8b6cf7bd4 Mon Sep 17 00:00:00 2001 From: ringofstorms Date: Mon, 1 Apr 2024 10:45:49 -0500 Subject: [PATCH] update gpd3p --- flake.nix | 32 +---- systems/_common/components/home_manager.nix | 2 +- systems/gpdPocket3/configuration.nix | 125 +++++++------------- systems/gpdPocket3/stupid-keyboard.nix | 3 +- systems/joe/configuration.nix | 3 +- 5 files changed, 47 insertions(+), 118 deletions(-) diff --git a/flake.nix b/flake.nix index b7b0006..394ce90 100644 --- a/flake.nix +++ b/flake.nix @@ -64,7 +64,7 @@ usersDir = ./users; }; in - { + { nixosConfigurations = builtins.foldl' (acc: nixConfig: acc // { @@ -84,36 +84,6 @@ { } nixConfigs; - # nixosConfigurations = { - # gpdPocket3 = nixosSystem { - # system = "x86_64-linux"; - # modules = [ ./systems/_common/configuration.nix ./systems/gpdPocket3/configuration.nix ]; - # specialArgs = inputs // { - # inherit ylib; - # settings = directories // { - # system = { - # # TODO remove these probably not needed anymore with per machine specified here - # hostname = "gpdPocket3"; - # architecture = "x86_64-linux"; - # }; - # }; - # }; - # }; - # joe = nixosSystem { - # system = "x86_64-linux"; - # modules = [ ./systems/_common/configuration.nix ./systems/joe/configuration.nix ]; - # specialArgs = inputs // { - # inherit ylib; - # settings = directories // { - # system = { - # # TODO remove these probably not needed anymore with per machine specified here - # hostname = "joe"; - # architecture = "x86_64-linux"; - # }; - # }; - # }; - # }; - # }; # homeConfigurations = { }; }; } diff --git a/systems/_common/components/home_manager.nix b/systems/_common/components/home_manager.nix index 4a60add..71bba3c 100644 --- a/systems/_common/components/home_manager.nix +++ b/systems/_common/components/home_manager.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, settings, ylib, ... } @ inputs: +{ config, pkgs, settings, ylib, ... } @ inputs: let home-manager = builtins.fetchTarball { url = "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz"; diff --git a/systems/gpdPocket3/configuration.nix b/systems/gpdPocket3/configuration.nix index 450e8ac..69e6185 100644 --- a/systems/gpdPocket3/configuration.nix +++ b/systems/gpdPocket3/configuration.nix @@ -2,34 +2,59 @@ { imports = [ - # Our custom stuff - ./stupid-keyboard.nix + # TODO revisit + (settings.systemsDir + "/_common/components/todo_neovim.nix") + # Common components this machine uses + (settings.systemsDir + "/_common/components/systemd_boot.nix") + (settings.systemsDir + "/_common/components/ssh.nix") + (settings.systemsDir + "/_common/components/caps_to_escape_in_tty.nix") + (settings.systemsDir + "/_common/components/font_jetbrainsmono.nix") + (settings.systemsDir + "/_common/components/home_manager.nix") + (settings.systemsDir + "/_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 ]; - # Use the systemd-boot EFI boot loader. - boot.loader = { - systemd-boot = { - enable = true; - consoleMode = "keep"; - }; - timeout = 5; - efi = { - canTouchEfiVariables = true; - }; - }; - - # We want connectivity + # 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; - # TODO evaluate if any of this kernal/hardware sutff is actually needed for our pocket. This is a hodge podge of shit from online + environment.systemPackages = with pkgs; [ + # [Laptop] Battery status + acpi + ]; + environment.shellAliases = { + battery = "acpi"; + }; + # [Laptop] screens with brightness settings + programs.light.enable = true; + + # ======== + + # 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 = [ @@ -48,75 +73,9 @@ intel-media-driver intel-vaapi-driver ]; - hardware.enableAllFirmware = true; # 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); - - # [Laptop] screens with brightness settings - programs.light.enable = true; - - # I want this globally even for root so doing it outside of home manager - services.xserver.xkbOptions = "caps:escape"; - console = { - earlySetup = true; - packages = with pkgs; [ terminus_font ]; - # We want to be able to read the screen so use a 32 sized font... - font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"; - useXkbConfig = true; # use xkb.options in tty. (caps -> escape) - }; - - # 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; - # }; - # }; - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - services.openssh.settings.PermitRootLogin = "yes"; - - # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ - 22 # sshd - ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - - fonts.packages = with pkgs; [ - (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) - ]; - - services.xserver.enable = true; - services.xserver.displayManager.gdm = { - enable = true; - autoSuspend = false; - }; - services.xserver.desktopManager.gnome.enable = true; - services.gnome.core-utilities.enable = false; - - # List packages installed in system profile. To search, run: - # $ nix search wget - nixpkgs.config.allowUnfree = true; - environment.systemPackages = with pkgs; [ - # [Laptop] Battery status - acpi - # extras, more for my neovim setup TODO move these into a more isolated place for nvim setup? Should be its own flake probably - cargo - rustc - nodejs_21 - python313 - # ripgrep # now in common - nodePackages.cspell - ]; - - # does for all shells. Can use `programs.zsh.shellAliases` for specific ones - environment.shellAliases = { - battery = "acpi"; - wifi = "nmtui"; - }; } diff --git a/systems/gpdPocket3/stupid-keyboard.nix b/systems/gpdPocket3/stupid-keyboard.nix index 2b441ae..d1048ce 100644 --- a/systems/gpdPocket3/stupid-keyboard.nix +++ b/systems/gpdPocket3/stupid-keyboard.nix @@ -4,8 +4,7 @@ # 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/ -{ config, lib, pkgs, ... }: - +{ ... }: let rgo_keyboard_vid = "0911"; rgo_keyboard_pid = "2188"; diff --git a/systems/joe/configuration.nix b/systems/joe/configuration.nix index 00c97a0..9de8e9c 100644 --- a/systems/joe/configuration.nix +++ b/systems/joe/configuration.nix @@ -16,7 +16,8 @@ (settings.usersDir + "/josh/configuration.nix") ]; - # Machine specific configuration + # machine specific configuration + # ============================== hardware.enableAllFirmware = true; # Connectivity networking.networkmanager.enable = true;