From a900acf90d7b58a0956f3f5fc61dd94a8fee1c12 Mon Sep 17 00:00:00 2001 From: jimjam4real Date: Sun, 22 Sep 2024 14:46:51 -0400 Subject: [PATCH] Add my Pinebook into the mix --- flake.nix | 16 ++++++++++ home-manager/jimbo_pinebook.nix | 35 +++++++++++++++++++++ nixos/hardware/extlinux.nix | 7 +++++ nixos/hardware/machines/desktop.nix | 1 - nixos/hardware/machines/lenovo.nix | 1 - nixos/hardware/machines/pinebook.nix | 34 ++++++++++++++++++++ nixos/hardware/machines/server.nix | 4 +-- nixos/hardware/opengl.nix | 1 - nixos/hardware/systemdboot.nix | 2 +- nixos/pinebook.nix | 47 ++++++++++++++++++++++++++++ 10 files changed, 142 insertions(+), 6 deletions(-) create mode 100644 home-manager/jimbo_pinebook.nix create mode 100644 nixos/hardware/extlinux.nix create mode 100644 nixos/hardware/machines/pinebook.nix create mode 100644 nixos/pinebook.nix diff --git a/flake.nix b/flake.nix index 9bd7d0a..d8554d3 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,7 @@ nur, nixos-mailserver, blender-bin, + nixos-hardware, home-manager, ... } @inputs: let @@ -59,6 +60,13 @@ nixos-mailserver.nixosModule ]; }; + JimPine = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + ./nixos/pinebook.nix + nixos-hardware.nixosModules.pine64-pinebook-pro + ]; + }; JimLenovo = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs;}; modules = [ @@ -85,6 +93,14 @@ ./home-manager/jimbo_server.nix ]; }; + "jimbo@JimPine" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.aarch64-linux; + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + ./home-manager/jimbo_pinebook.nix + nur.nixosModules.nur + ]; + }; "jimbo@JimLenovo" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; extraSpecialArgs = {inherit inputs outputs;}; diff --git a/home-manager/jimbo_pinebook.nix b/home-manager/jimbo_pinebook.nix new file mode 100644 index 0000000..ac6774a --- /dev/null +++ b/home-manager/jimbo_pinebook.nix @@ -0,0 +1,35 @@ +{ + imports = [ + # Common modules + ./home.nix + ./users/jimbo.nix + ./tuiapps/git.nix + + # GUI Apps + ./misc/guifiles.nix + ./sway/sway.nix + ./sway/swaylock.nix + ./guiapps/gtk.nix + ./guiapps/foot.nix + ./guiapps/librewolf.nix + ./guiapps/mangohud.nix + ./guiapps/mpv.nix + ./guiapps/pcmanfm-qt.nix + ./guiapps/rofi.nix + ./guiapps/swappy.nix + ./guiapps/easyeffects.nix + ./tuiapps/ncmpcpp.nix + + # Misc apps and tools + ./misc/useful.nix + ./misc/avtools.nix + ./misc/filemanager.nix + ./misc/remotedesktop.nix + ./misc/variables.nix + + # Services + ./services/gnome-keyring.nix + ./services/mako.nix + ./services/udiskie.nix + ]; +} diff --git a/nixos/hardware/extlinux.nix b/nixos/hardware/extlinux.nix new file mode 100644 index 0000000..01b0299 --- /dev/null +++ b/nixos/hardware/extlinux.nix @@ -0,0 +1,7 @@ +{ + # For ARM machines + boot.loader = { + generic-extlinux-compatible.enable = true; + grub.enable = false; + }; +} diff --git a/nixos/hardware/machines/desktop.nix b/nixos/hardware/machines/desktop.nix index c3441f8..af20536 100644 --- a/nixos/hardware/machines/desktop.nix +++ b/nixos/hardware/machines/desktop.nix @@ -1,4 +1,3 @@ -# This file was initially made by 'nixos-generate-config', try not to edit too much { config, lib, pkgs, modulesPath, ... }: let # Set common boot paramaters commonKernelParams = [ diff --git a/nixos/hardware/machines/lenovo.nix b/nixos/hardware/machines/lenovo.nix index 5748e92..0da9832 100644 --- a/nixos/hardware/machines/lenovo.nix +++ b/nixos/hardware/machines/lenovo.nix @@ -1,4 +1,3 @@ -# This file was initially made by 'nixos-generate-config', try not to edit too much { config, lib, pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") diff --git a/nixos/hardware/machines/pinebook.nix b/nixos/hardware/machines/pinebook.nix new file mode 100644 index 0000000..2c63c98 --- /dev/null +++ b/nixos/hardware/machines/pinebook.nix @@ -0,0 +1,34 @@ +{ config, outputs, lib, pkgs, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot = { + initrd = { + availableKernelModules = [ ]; + kernelModules = [ ]; + }; + blacklistedKernelModules = [ + "pcspkr" + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/25738e24-385e-4bcf-bff5-d0e6274003b6"; + fsType = "btrfs"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/01D2-E962"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/95c43e5a-b53d-41fd-99a3-54181510070e"; } + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/nixos/hardware/machines/server.nix b/nixos/hardware/machines/server.nix index ee97bd4..2c1f544 100644 --- a/nixos/hardware/machines/server.nix +++ b/nixos/hardware/machines/server.nix @@ -104,7 +104,7 @@ networking.useDHCP = lib.mkDefault true; # Hardware settings - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; boot.swraid.enable = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/nixos/hardware/opengl.nix b/nixos/hardware/opengl.nix index 3290147..a68615f 100644 --- a/nixos/hardware/opengl.nix +++ b/nixos/hardware/opengl.nix @@ -2,7 +2,6 @@ # Enable OpenGL hardware.opengl = { enable = true; - driSupport = true; driSupport32Bit = true; extraPackages = with pkgs; [ vulkan-loader diff --git a/nixos/hardware/systemdboot.nix b/nixos/hardware/systemdboot.nix index 8bdedc7..31fd278 100644 --- a/nixos/hardware/systemdboot.nix +++ b/nixos/hardware/systemdboot.nix @@ -1,5 +1,5 @@ { - # For UEFI Machines + # For UEFI machines boot.loader.systemd-boot = { enable = true; netbootxyz.enable = true; diff --git a/nixos/pinebook.nix b/nixos/pinebook.nix new file mode 100644 index 0000000..acd76f1 --- /dev/null +++ b/nixos/pinebook.nix @@ -0,0 +1,47 @@ +{ lib, ...}: { + imports = [ + # Base configs + ./base.nix + + # Import users and groups + ./users/jimbo.nix + ./users/groups.nix + + # Desktop only + ./desktop/misc.nix + ./desktop/sway.nix + ./desktop/greetd-sway.nix + ./desktop/printing.nix + ./desktop/pipewire.nix + ./desktop/bluetooth.nix + ./desktop/firewall.nix + ./desktop/fonts.nix + ./desktop/qt.nix + + # Laptop/Portable only + ./hardware/wireless.nix + + # Modules + ./modules/security.nix + ./modules/legacy.nix + + # Hardware + ./hardware/machines/pinebook.nix + ./hardware/extlinux.nix + ./hardware/opengl.nix + + # Services + ./services/openssh.nix + ./services/udev.nix + ./services/mpd.nix + ]; + + # Disable 32 bit graphics + hardware.opengl.driSupport32Bit = lib.mkForce false; + + # Set hostname + networking.hostName = "JimPine"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "24.05"; +}