diff --git a/home/bolt.nix b/home/bolt.nix index 09f1f19..f935ab2 100644 --- a/home/bolt.nix +++ b/home/bolt.nix @@ -2,6 +2,12 @@ { + nixpkgs.overlays = [ + (self: super: { + kwin-system76-scheduler-integration = pkgs.libsForQt5.callPackage ../system/syspkgs/kwin-system76-scheduler-integration.nix {}; + }) + ]; + home.username = "bolt"; home.homeDirectory = "/home/bolt"; @@ -13,4 +19,23 @@ nicotine-plus ]; + systemd.user.startServices = true; + systemd.user.services."com.system76.Scheduler.dbusproxy" = { + + Unit = { + Description = "the system76 process scheduler kwin dbus proxy"; + # Aliases = [ "com.system76.Scheduler.dbusproxy.service" ]; + Requires = [ "dbus.service" ]; + }; + + Install = { + WantedBy = [ "graphical-session.target" "default.target" ]; + }; + + Service = { + ExecStart = ''${pkgs.kwin-system76-scheduler-integration}/bin/kwin-system76-scheduler-dbus-proxy.sh''; + }; + + }; + } diff --git a/home/home.nix b/home/home.nix index f958404..536480a 100755 --- a/home/home.nix +++ b/home/home.nix @@ -41,9 +41,6 @@ direnv mpv - - vscodium - syncthing zoxide @@ -63,53 +60,47 @@ (callPackage ./homepkgs/culr.nix { }) ]; -# ❯ bat nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium-url-handler.desktop -# nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium.desktop -# ───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -# │ File: nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium-url-handler.desktop -# ───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -# 1 │ [Desktop Entry] -# 2 │ Categories=Utility;TextEditor;Development;IDE -# 3 │ Comment=Code Editing. Redefined. -# 4 │ Exec=codium --open-url %U -# 5 │ GenericName=Text Editor -# 6 │ Icon=code -# 7 │ Keywords=vscode -# 8 │ MimeType=x-scheme-handler/vscode -# 9 │ Name=VSCodium - URL Handler -# 10 │ NoDisplay=true -# 11 │ StartupNotify=true -# 12 │ Type=Application -# 13 │ Version=1.4 -# ───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -# zsh: permission denied: nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium.desktop -# ❯ bat nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium-url-handler.desktop -# nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium.deskt -# ❯ bat nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium.desktop -# ───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -# │ File: nix/store/101r0xh4c4y8hkcwx6vpbvp9d8nyg596-home-manager-path/share/applications/codium.desktop -# ───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -# 1 │ [Desktop Entry] -# 2 │ Actions=new-empty-window -# 3 │ Categories=Utility;TextEditor;Development;IDE -# 4 │ Comment=Code Editing. Redefined. -# 5 │ Exec=codium %F -# 6 │ GenericName=Text Editor -# 7 │ Icon=code -# 8 │ Keywords=vscode -# 9 │ MimeType=text/plain;inode/directory -# 10 │ Name=VSCodium -# 11 │ StartupNotify=true -# 12 │ StartupWMClass=vscodium -# 13 │ Type=Application -# 14 │ Version=1.4 -# 15 │ -# 16 │ [Desktop Action new-empty-window] -# 17 │ Exec=codium --new-window %F -# 18 │ Icon=code -# 19 │ Name=New Empty Window -# ───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -# ❯ + + xdg.enable = true; + + programs.vscode = { + enable = true; + enableExtensionUpdateCheck = false; + enableUpdateCheck = false; + package = pkgs.vscodium; + extensions = []; + mutableExtensionsDir = false; + }; + + xdg.desktopEntries = { + vscodium-url = { + name = "VsCodium"; + genericName = "Text Editor"; + exec = "codium --disable-gpu-sandbox --open-url %U"; + icon = "code"; + comment = "Code Editing. Redefined."; + categories = [ "Utility" "TextEditor" "Development" "IDE" ]; + # keywords = [ "vscode" ]; + mimeType = [ "x-scheme-handler/vscode" ]; + noDisplay = true; + startupNotify = true; + type = "Application"; + }; + vscodium = { + categories = [ "Utility" "TextEditor" "Development" "IDE" ]; + comment = "Code Editing. Redefined."; + exec = "codium --disable-gpu-sandbox %F"; + genericName = "Text Editor"; + icon = "code"; + # keywords = [ "vscode" ]; + mimeType = [ "text/plain" "inode/directory" ]; + name = "VsCodium"; + startupNotify = true; + # startupWMClass = "vscodium"; + type = "Application"; + }; + }; + programs.direnv = { enable = true; nix-direnv = { @@ -277,6 +268,7 @@ alias l=\"ls_culr\" alias la=\"la_culr\" alias p=\"ps_culr\" alias mnt=\"mount | column -t | culr\" +alias kaboom=\"sudo nixos-rebuild switch --upgrade-all -j9 && rm ~/.gtkrc-2.0; home-manager switch && sudo nix-collect-garbage && nix-store --optimise\" fresh "; diff --git a/home/homepkgs/slice.nix b/home/homepkgs/slice.nix deleted file mode 100755 index 9b0117e..0000000 --- a/home/homepkgs/slice.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -}: -stdenv.mkDerivation rec { - pname = "sddm-slice"; - version = "1.5.1"; - - src = fetchFromGitHub { - owner = "EricKotato"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-IWwFsYqoqW3924+pf8L+acIt31aU/mhqakXbT9Q4Bqw="; - }; - - deployPhase = " - cp -r ./* /usr/share/sddm/themes/slice/ - "; - - meta = with lib; { - description = "an sddm theme"; - homepage = "somewhere.else"; - license = licenses.mit; - maintainers = []; - platforms = platforms.all; - }; - -} diff --git a/home/nixpkgs b/home/nixpkgs deleted file mode 120000 index afa8aff..0000000 --- a/home/nixpkgs +++ /dev/null @@ -1 +0,0 @@ -/home/fossil/.config/nixpkgs \ No newline at end of file diff --git a/system/cachix.nix b/system/cachix.nix index 88b2f08..ecd2d39 100755 --- a/system/cachix.nix +++ b/system/cachix.nix @@ -9,5 +9,5 @@ let imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); in { inherit imports; - nix.binaryCaches = ["https://cache.nixos.org/"]; + nix.settings.substituters = ["https://cache.nixos.org/"]; } diff --git a/system/cachix/cuda-maintainers.nix b/system/cachix/cuda-maintainers.nix index be053ee..6d28952 100755 --- a/system/cachix/cuda-maintainers.nix +++ b/system/cachix/cuda-maintainers.nix @@ -1,10 +1,10 @@ { nix = { - binaryCaches = [ + settings.substituters = [ "https://cuda-maintainers.cachix.org" ]; - binaryCachePublicKeys = [ + settings.trusted-public-keys = [ "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" ]; }; diff --git a/system/configuration.nix b/system/configuration.nix index 7611494..616233a 100755 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -28,6 +28,7 @@ keep-outputs = true keep-derivations = true ''; + environment.pathsToLink = [ "/share/zsh" ]; boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.configurationLimit = 2; @@ -98,7 +99,7 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - jack.enable = true; + # jack.enable = true; }; # gtk compatibility @@ -117,6 +118,7 @@ tailscale + home-manager cachix helix @@ -124,13 +126,14 @@ curl - home-manager git zsh nix-index comma + + hackneyed ]; @@ -150,7 +153,7 @@ }; }; - networking.firewall.enable = false; + networking.firewall.enable = true; networking.firewall = { trustedInterfaces = [ "tailscale0" ]; checkReversePath = "loose"; diff --git a/system/quiver.nix b/system/quiver.nix index f152780..eaab01e 100755 --- a/system/quiver.nix +++ b/system/quiver.nix @@ -1,6 +1,14 @@ { config, lib, pkgs, modulesPath, ... }: { + + nixpkgs.overlays = [ + (self: super: { + system76-scheduler = pkgs.callPackage ./syspkgs/system76-scheduler.nix {}; + kwin-system76-scheduler-integration = pkgs.libsForQt5.callPackage ./syspkgs/kwin-system76-scheduler-integration.nix {}; + }) + ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; @@ -9,7 +17,7 @@ boot.initrd.kernelModules = []; boot.kernelModules = [ "kvm-amd" "i2c-dev" ]; boot.extraModulePackages = [ ]; - boot.kernelParams = [ "mitigations=off" "acpi_enforce_resources=lax" ]; + boot.kernelParams = [ "mitigations=off" "acpi_enforce_resources=lax" "preempt=full" ]; boot.loader.efi.canTouchEfiVariables = true; boot.plymouth.enable = true; @@ -22,12 +30,13 @@ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - # dlna services.minidlna = { enable = true; - announceInterval = 120; - friendlyName = "PC"; - mediaDirs = [ "A,/data/Music/Slsk" ]; + settings = { + notify_interval = 120; + friendly_name = "PC"; + media_dir = [ "A,/data/Music/Slsk" ]; + }; }; services.xserver.videoDrivers = [ "nvidia" ]; @@ -36,33 +45,58 @@ hardware.nvidia.powerManagement.enable = true; programs.xwayland.enable = true; - systemd.services.noRgb = { + systemd.services.no-rgb = { wantedBy = [ "multi-user.target" ]; description = "rgb led turn-off-er"; serviceConfig = { Type = "oneshot"; - ExecStart = ''${pkgs.openrgb}/bin/openrgb -c 000000''; + ExecStart = ''${pkgs.openrgb}/bin/openrgb -d "HyperX Fury RGB" -m static -c 000000''; }; }; - services.ananicy = { - enable = true; - package = pkgs.ananicy-cpp; - settings = { - check_freq = 5; + systemd.services."com.system76.Scheduler" = { + wantedBy = [ "multi-user.target" ]; + description = "the system76 process scheduler"; + serviceConfig = { + Type = "dbus"; + ExecStart = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon''; + ExecReload = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon reload''; + BusName = "com.system76.Scheduler"; }; }; + + services.dbus.packages = [ + pkgs.kwin-system76-scheduler-integration + pkgs.system76-scheduler + ]; + + systemd.packages = [ + pkgs.kwin-system76-scheduler-integration + pkgs.system76-scheduler + ]; + + environment.etc = { + "system76-scheduler".source = "${pkgs.system76-scheduler}/etc/system76-scheduler"; + }; + + services.hardware.openrgb = { + enable = true; + motherboard = "amd"; + }; hardware.ckb-next.enable = true; - environment.systemPackages = with pkgs; [ - xdg-desktop-portal-kde - ckb-next - openrgb - wl-clipboard - wl-clipboard-x11 - xclip - ]; + environment.systemPackages = with pkgs; + [ + xdg-desktop-portal-kde + ckb-next + openrgb + wl-clipboard + wl-clipboard-x11 + xclip + system76-scheduler + kwin-system76-scheduler-integration + ]; networking.hostName = "quiver"; # Define your hostname. users.users.bolt = { diff --git a/system/syspkgs/kwin-system76-scheduler-integration.nix b/system/syspkgs/kwin-system76-scheduler-integration.nix new file mode 100644 index 0000000..ea26b5d --- /dev/null +++ b/system/syspkgs/kwin-system76-scheduler-integration.nix @@ -0,0 +1,54 @@ +{ lib, pkgs, stdenv, fetchFromGitHub, dbus, qt5, qtbase, wrapQtAppsHook, kpackage, kcoreaddons, ... }: + +stdenv.mkDerivation rec { + pname = "kwin-system76-scheduler-integration"; + version = "0.1"; + + src = fetchFromGitHub { + owner = "maxiberta"; + repo = pname; + rev = version; + sha256 = "sha256-HX0nK1p97kqt+ZZuECm7Mg9aAXaFDnsJDkbcLUEU+p0="; + }; + + nativeBuildInputs = [ + wrapQtAppsHook + kpackage + ]; + + buildInputs = [ + dbus + qt5.qttools.bin + ]; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + kpackagetool5 --type=KWin/Script -i . -p $out/share/kwin/scripts + + cat < $out/bin/kwin-system76-scheduler-dbus-proxy.sh + #!${pkgs.bash}/bin/bash + DBUS_SERVICE="com.system76.Scheduler" + DBUS_PATH="/com/system76/Scheduler" + DBUS_INTERFACE="com.system76.Scheduler" + DBUS_METHOD="SetForegroundProcess" + echo "starting dbus proxy.." + echo \''$DBUS_SERVICE \''$DBUS_PATH \''$DBUS_INTERFACE \''$DBUS_METHOD + ${pkgs.dbus}/bin/dbus-monitor --session "destination=\''$DBUS_SERVICE,path=\''$DBUS_PATH,interface=\''$DBUS_INTERFACE,member=\''$DBUS_METHOD" | + while true; do + read method call time sender _ dest serial path interface member + read type pid + [ "\''$member" = "member=\''$DBUS_METHOD" ] && ${pkgs.libsForQt5.qt5.qttools.bin}/bin/qdbus --system \''$DBUS_SERVICE \''$DBUS_PATH \''$DBUS_INTERFACE.\''$DBUS_METHOD \''$pid && echo "new foreground process: \''$pid" + done + EOF + + chmod +x $out/bin/kwin-system76-scheduler-dbus-proxy.sh + + runHook postInstall + ''; + + +} diff --git a/system/syspkgs/system76-scheduler.nix b/system/syspkgs/system76-scheduler.nix new file mode 100644 index 0000000..ee80a53 --- /dev/null +++ b/system/syspkgs/system76-scheduler.nix @@ -0,0 +1,34 @@ +{ pkgs, lib, rustPlatform, fetchFromGitHub, ... }: +rustPlatform.buildRustPackage rec { + + pname = "system76-scheduler"; + version = "1.2.2"; + + src = fetchFromGitHub { + owner = "pop-os"; + repo = pname; + rev = version; + sha256 = "sha256-uFFJkuMxqcGj6OQShF0zh/FGwX4/ln1l6NwGonkUsNI="; + }; + + nativeBuildInputs = with pkgs; [ + bcc + ]; + + EXECSNOOP_PATH = "${pkgs.bcc}/bin/execsnoop"; + + cargoSha256 = "sha256-s91T/Ttr7G8sjyf0Mp5suep4IA+l/r4118B+ue33yfQ="; + + postInstall = '' + mkdir -p $out/etc/system76-scheduler/assignments \ + $out/etc/system76-scheduler/exceptions \ + $out/lib/systemd/system \ + $out/etc/dbus-1/system.d + install -Dm0644 data/config.ron $out/etc/system76-scheduler/config.ron + install -Dm0644 data/assignments.ron $out/etc/system76-scheduler/assignments/default.ron + install -Dm0644 data/exceptions.ron $out/etc/system76-scheduler/exceptions/default.ron + # install -Dm0644 data/com.system76.Scheduler.service $out/lib/systemd/system/com.system76.Scheduler.service + install -Dm0644 data/com.system76.Scheduler.conf $out/etc/dbus-1/system.d/com.system76.Scheduler.conf + ''; + +}