From 6c37e1820660e92fa5665263140645921a2f0d81 Mon Sep 17 00:00:00 2001 From: Sam Rolfe Date: Thu, 12 Feb 2026 20:17:50 +1100 Subject: [PATCH] Add sidecar (prebuilt) package + install --- hosts/sam-4screen-desktop/configuration.nix | 137 +++++++++++++++++--- pkgs/sidecar-bin.nix | 31 +++++ 2 files changed, 151 insertions(+), 17 deletions(-) create mode 100644 pkgs/sidecar-bin.nix diff --git a/hosts/sam-4screen-desktop/configuration.nix b/hosts/sam-4screen-desktop/configuration.nix index 2f4ab4e..6d4b611 100644 --- a/hosts/sam-4screen-desktop/configuration.nix +++ b/hosts/sam-4screen-desktop/configuration.nix @@ -6,6 +6,7 @@ # Stop nouveau from binding the NVIDIA GPU boot.blacklistedKernelModules = [ "nouveau" ]; boot.kernelParams = [ + "nvidia.NVreg_PreserveVideoMemoryAllocations=1" "intel_iommu=off" "dev_mem_signed_off=1" "modprobe.blacklist=nouveau" @@ -13,6 +14,11 @@ ]; +boot.extraModprobeConfig = '' + options nvidia_modeset vblank_sem_control=0 +''; + + imports = [ ./hardware-configuration.nix ]; @@ -204,12 +210,83 @@ PermitRootLogin = "no"; # --- # Mounts # --- - fileSystems."/data" = { - device = "/dev/disk/by-uuid/27febd74-20aa-4a3a-92c1-6fdd1ad7e88e"; - fsType = "ext4"; - options = [ "nofail" "x-systemd.device-timeout=1s" ]; - }; + # fileSystems."/data" = { + # device = "/dev/disk/by-uuid/27febd74-20aa-4a3a-92c1-6fdd1ad7e88e"; + # fsType = "ext4"; + # options = [ "nofail" "x-systemd.device-timeout=1s" ]; + # }; +fileSystems."/mnt/integral300" = { + device = "/dev/disk/by-uuid/27febd74-20aa-4a3a-92c1-6fdd1ad7e88e"; + fsType = "ext4"; + options = [ + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=30s" + ]; +}; +fileSystems."/mnt/backup" = { + device = "/dev/disk/by-uuid/0806B92006B90FA4"; + fsType = "ntfs3"; + options = [ + "ro" + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=30s" + "uid=1000" + "gid=100" + "umask=022" + ]; +}; + +fileSystems."/mnt/tempbackup" = { + device = "/dev/disk/by-uuid/4f9c4bd5-fea5-408f-9370-731fc095da3f"; + fsType = "ext4"; + options = [ + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=30s" + ]; +}; + +fileSystems."/mnt/xpsystemdrive" = { + device = "/dev/disk/by-uuid/82c994f1-9adb-49e4-ba1e-5b6e5ccbd49b"; + fsType = "ext4"; + options = [ + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=30s" + ]; +}; + +fileSystems."/mnt/smartdrive" = { + device = "/dev/disk/by-uuid/819c3228-c1af-4d8e-b507-2ad11b20cbef"; + fsType = "ext4"; + options = [ + "nofail" + "noauto" + "x-systemd.automount" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=30s" + ]; +}; + + +systemd.tmpfiles.rules = lib.mkAfter [ + "d /mnt/integral300 0755 root root -" + "d /mnt/backup 0755 root root -" + "d /mnt/tempbackup 0755 root root -" + "d /mnt/xpsystemdrive 0755 root root -" + "d /mnt/smartdrive 0755 root root -" +]; # --- # Niri + login (greetd) # --- @@ -236,15 +313,33 @@ PermitRootLogin = "no"; ]; }; - # Minimal system packages needed for the session and core usability - environment.systemPackages = with pkgs; [ - swappy + +fonts.packages = with pkgs; [ + nerd-fonts.symbols-only font-awesome nerd-fonts.jetbrains-mono - spotify - vlc - telegram-desktop - flameshot +]; + + # Minimal system packages needed for the session and core usability + environment.systemPackages = with pkgs; [ + (pkgs.callPackage ../../pkgs/sidecar-bin.nix { }) + tmux + brave + vorta + borgbackup + libreoffice-fresh + filezilla + nushell + zed-editor + brave + swappy + nerd-fonts.symbols-only + font-awesome + nerd-fonts.jetbrains-mono + spotify + vlc + telegram-desktop + flameshot waybar firefox google-chrome @@ -262,11 +357,19 @@ services.tailscale.enable = true; # NVIDIA (simple, first-boot stable config; PRIME tuning later) # --- services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia.modesetting.enable = true; - hardware.nvidia.nvidiaSettings = true; - hardware.nvidia.nvidiaPersistenced = true; -hardware.nvidia.open = false; - # --- + +hardware.nvidia = { + modesetting.enable = true; + nvidiaSettings = true; + nvidiaPersistenced = true; + open = false; + + # Helps resume by preserving VRAM allocations: + powerManagement.enable = true; +}; + + + # --- # NixOS release compatibility # --- system.stateVersion = "24.05"; diff --git a/pkgs/sidecar-bin.nix b/pkgs/sidecar-bin.nix new file mode 100644 index 0000000..343509e --- /dev/null +++ b/pkgs/sidecar-bin.nix @@ -0,0 +1,31 @@ +{ lib, stdenvNoCC, fetchurl }: + +stdenvNoCC.mkDerivation { + pname = "sidecar"; + version = "0.71.1"; + + src = fetchurl { + url = + "https://github.com/marcus/sidecar/releases/download/v0.71.1/sidecar_0.71.1_linux_amd64.tar.gz"; + sha256 = lib.fakeSha256; + }; + + dontUnpack = false; + + unpackPhase = '' + tar -xzf "$src" + ''; + + installPhase = '' + mkdir -p "$out/bin" + install -m0755 sidecar "$out/bin/sidecar" + ''; + + meta = with lib; { + description = "Sidecar terminal dashboard for monitoring AI coding agents"; + homepage = "https://github.com/marcus/sidecar"; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + mainProgram = "sidecar"; + }; +}