From 64fce536078d202d476226d025f578483dda6fb9 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 6 Oct 2025 17:02:16 -0500 Subject: [PATCH] an attempt at adding nixbook like configs --- flake.nix | 12 ++ systems/nixbook/configuration.nix | 237 ++++++++++++++++++++++++++++++ systems/nixbook/pkgs.nix | 96 ++++++++++++ systems/syl/configuration.nix | 4 +- 4 files changed, 347 insertions(+), 2 deletions(-) create mode 100644 systems/nixbook/configuration.nix create mode 100644 systems/nixbook/pkgs.nix diff --git a/flake.nix b/flake.nix index 947a4c2..d41db6d 100644 --- a/flake.nix +++ b/flake.nix @@ -115,6 +115,18 @@ # ]; # }; nixosConfigurations = { + nixbook = lib.nixosSystem { + inherit system; + pkgs = pkgsForSystem; + specialArgs = { + stable = stable; + inherit inputs; + }; + modules = [ + (pkgsForSystem + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix") + ./systems/nixbook/configuration.nix + ]; + }; syl = lib.nixosSystem { inherit system; pkgs = pkgsForSystem; diff --git a/systems/nixbook/configuration.nix b/systems/nixbook/configuration.nix new file mode 100644 index 0000000..41409eb --- /dev/null +++ b/systems/nixbook/configuration.nix @@ -0,0 +1,237 @@ +{ lib, config, pkgs, callPackage, inputs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ../../pkgs/base-packages.nix + ./pkgs.nix + ../../modules/base.nix + ]; + networking.hostName = "nixbook"; + + boot.initrd.kernelModules = [ "i915" ]; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.acpilight.enable = lib.mkDefault true; + networking.interfaces.wlp170s0.useDHCP = true; + networking.useDHCP = false; + hardware.uinput.enable = true; + hardware.bluetooth.enable = true; + + # Use the systemd-boot EFI boot loader. + boot = { + kernelPackages = pkgs.linuxPackages_zen; + kernelParams = [ "mem_sleep_default=deep" "nvme.noacpi=1" ]; + }; + boot.supportedFilesystems = [ "ntfs" ]; + + services = { + desktopManager.cosmic.enable = true; + }; + + programs.nix-ld.enable = true; + security.pam.services.kwallet = { + name = "kwallet"; + enableKwallet = true; + }; + + systemd = { + oomd = { + enable = true; + enableRootSlice = true; + enableUserSlices = true; + enableSystemSlice = true; + }; + settings.Manager = { + DefaultIOAccounting = true; + DefaultIPAccounting = true; + DefaultTimeoutStopSec = "10s"; + DefaultTimeoutStartSec = "10s"; + }; + }; + fonts.packages = with pkgs; [ + nerd-fonts.victor-mono + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + liberation_ttf + mplus-outline-fonts.githubRelease + dina-font + proggyfonts + ]; + + security.pam.services = { + sddm.enableKwallet = true; + greetd.enableKwallet = true; + }; + + services.displayManager.cosmic-greeter = { + enable = true; + }; + + xdg.portal = { + enable = true; + extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ]; + }; + + services.avahi = { + enable = true; + nssmdns4 = true; + }; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + wireplumber.enable = true; + }; + + # Needed for some pipewire progs and other gtk apps + programs.dconf.enable = true; + + environment.variables = { + SAL_USE_VCLPLUGIN = "kf5"; + EDITOR = "emacsclient -t -a"; + VISUAL = "emacsclient -c -a"; + QT_LOGGING_RULES = "js=true; kwin_*.debug=true"; + # GTK_USE_PORTAL = "1"; + # Fixing Qt apps in other environments + # Thought I needed this but apparently they are working fine without it. + # QT_XCB_GL_INTEGRATION = "xcb_egl"; + # QT_QPA_PLATFORM_PLUGIN_PATH = "${pkgs.qt5.qtbase.bin}/lib/qt-${pkgs.qt5.qtbase.qtCompatVersion}/plugins/platforms"; + NIXOS_OZONE_WL = "1"; + _JAVA_AWT_WM_NONEREPARENTING = "1"; + # DISABLE_QT5_COMPAT = "0"; + GDK_BACKEND = "wayland"; + ANKI_WAYLAND = "1"; + WLR_DRM_NO_ATOMIC = "1"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_QPA_PLATFORM = "wayland"; + # QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + # QT_QPA_PLATFORMTHEME = "qt5ct"; + MOZ_ENABLE_WAYLAND = "1"; + MOZ_DBUS_REMOTE = "1"; + WLR_BACKEND = "vulkan"; + WLR_RENDERER = "vulkan"; + XDG_SESSION_TYPE = "wayland"; + # Remember that this causes issues in some games use "unset SDL_VIDEODRIVER &&" + SDL_VIDEODRIVER = "wayland"; + CLUTTER_BACKEND = "wayland"; + WLR_NO_HARDWARE_CURSORS = "1"; + }; + + programs.partition-manager.enable = true; + programs.kdeconnect.enable = true; + + # Turn on flatpak + services.flatpak.enable = true; + + # Configure keymap in X11 + services.xserver.xkb.layout = "us"; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = + [ pkgs.gutenprint pkgs.gutenprintBin pkgs.cnijfilter2 ]; + + services.usbmuxd.enable = true; + services.fstrim.enable = true; + + virtualisation.libvirtd = { + enable = true; + qemu = { + runAsRoot = false; + ovmf = { + enable = true; + packages = [ + pkgs.OVMFFull.fd + pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd + ]; + }; + swtpm.enable = true; + }; + }; + services.samba-wsdd.enable = true; + services.samba = { + enable = true; + shares = { + public = { + path = "/home/abbie"; + "read only" = false; + browsable = true; + "guest ok" = true; + comment = "Share"; + }; + }; + }; + + # nixpkgs.config.packageOverrides = pkgs: { + # vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + # }; + + services.xserver.videoDrivers = [ "intel" ]; + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + libvdpau-va-gl + ]; + }; + + systemd.services.display-manager = { + wants = [ + "systemd-user-sessions.service" + "multi-user.target" + "network-online.target" + ]; + after = [ + "systemd-user-sessions.service" + "multi-user.target" + "network-online.target" + ]; + }; + + # Enable touchpad support (enabled default in most desktopManager). + services.xserver.libinput.enable = true; + services.xserver.dpi = 144; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.chris = { + isNormalUser = true; + extraGroups = [ "adbusers" "wheel" "networkmanager" "input" "uinput" "dialout" ]; + }; + + services.fwupd.enable = true; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.11"; # Did you read the comment? + +} diff --git a/systems/nixbook/pkgs.nix b/systems/nixbook/pkgs.nix new file mode 100644 index 0000000..da319e8 --- /dev/null +++ b/systems/nixbook/pkgs.nix @@ -0,0 +1,96 @@ +{ pkgs, lib, config, ... }: + +{ + environment.systemPackages = with pkgs; [ + exfat + exfatprogs + zellij + wget + killall + gnumake + smartmontools + git + p7zip + zip + gzip + usbutils + binutils + eza + nushell + yt-dlp + bat + rsync + jq + ripgrep + fd + socat + ffmpeg-full + imagemagick + libheif + trash-cli + htop + btop + nvtopPackages.full + bc + sysstat + procs + pandoc + samba + pinentry + pinentry-qt + caffeine-ng + hunspell + hunspellDicts.en_US-large + openssh + openssl + kdePackages.ark + kdePackages.breeze + kdePackages.dolphin + xdg-utils + kdePackages.kio-fuse + kdePackages.kio-extras + kdePackages.ffmpegthumbs + kdePackages.kdegraphics-thumbnailers + kdePackages.kdesdk-thumbnailers + kdePackages.okular + scribus + brightnessctl + mpc-cli + ungoogled-chromium + brave + kdePackages.kwallet-pam + aria2 + kdePackages.kwallet + nerd-fonts.victor-mono + kdePackages.plasma-browser-integration + glxinfo + vulkan-tools + wayland-utils + nextcloud-client + papirus-icon-theme + phinger-cursors + kdePackages.kde-cli-tools + gzip + virt-viewer + inkscape + libreoffice-qt6-fresh + vlc + any-nix-shell + wtype + xdotool + bluez-tools + lxappearance + mediainfo + libmediainfo + rubberband + texlive.combined.scheme-full + pamixer + playerctl + gimp + power-profiles-daemon + python3 + kdePackages.plasma-sdk + wireguard-tools + cosmic-settings + ]; +} diff --git a/systems/syl/configuration.nix b/systems/syl/configuration.nix index a141e6f..b2c255f 100644 --- a/systems/syl/configuration.nix +++ b/systems/syl/configuration.nix @@ -18,8 +18,8 @@ hardware.acpilight.enable = lib.mkDefault true; networking.interfaces.wlp170s0.useDHCP = true; - networking.wireless.iwd.enable = true; - networking.networkmanager.wifi.backend = "iwd"; + # networking.wireless.iwd.enable = true; + # networking.networkmanager.wifi.backend = "iwd"; hardware.uinput.enable = true; hardware.bluetooth.enable = true;