diff --git a/base.nix b/base.nix index db0c648..8600c7b 100644 --- a/base.nix +++ b/base.nix @@ -157,33 +157,6 @@ }; }; - # Define systemd template unit for reporting status via ntfy - systemd.services = - let - services = [ "nixos-upgrade" ]; - in - { - "notify-push@" = { - environment.SERVICE_ID = "%i"; - path = [ - "/run/wrappers" - "/run/current-system/sw" - ]; - script = '' - curl \ - -H "Title:$(hostname) $SERVICE_ID $(systemctl show --property=Result $SERVICE_ID)" \ - -d "$(journalctl --output cat -n 2 -u $SERVICE_ID)" \ - https://ntfy.vsinerva.fi/service-notifs - ''; - }; - - # Merge attributes for all monitored services - } - // (pkgs.lib.attrsets.genAttrs services (name: { - onFailure = pkgs.lib.mkBefore [ "notify-push@%i.service" ]; - onSuccess = pkgs.lib.mkBefore [ "notify-push@%i.service" ]; - })); - ######################################## Misc. ################################################## nixpkgs.config.allowUnfree = true; @@ -192,15 +165,6 @@ users.mutableUsers = false; # Force all user management to happen throught nix-files - security.pam.loginLimits = [ - { - domain = "*"; - type = "soft"; - item = "nofile"; - value = "8192"; - } - ]; - boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; diff --git a/desktop.nix b/desktop.nix index 3a4f214..6ddc483 100644 --- a/desktop.nix +++ b/desktop.nix @@ -83,6 +83,7 @@ in }; }; + services.pipewire.enable = false; nixpkgs.config.pulseaudio = true; hardware.pulseaudio.enable = true; diff --git a/development.nix b/development.nix index e8a71b1..404f159 100644 --- a/development.nix +++ b/development.nix @@ -3,7 +3,7 @@ let nixvim = import ( builtins.fetchGit { url = "https://github.com/nix-community/nixvim"; - ref = "nixos-24.05"; + ref = "nixos-24.11"; } ); in @@ -87,7 +87,7 @@ in gitsigns.enable = true; lualine = { enable = true; - iconsEnabled = false; + settings.options.iconsEnabled = false; }; markdown-preview.enable = true; nix.enable = true; @@ -95,12 +95,12 @@ in sleuth.enable = true; tmux-navigator = { enable = true; - settings.no_mappings = true; + settings.no_mappings = 1; }; treesitter = { enable = true; folding = true; - indent = true; + settings.indent.enable = true; nixGrammars = true; }; @@ -127,13 +127,13 @@ in clangd.enable = true; cmake.enable = true; dockerls.enable = true; - docker-compose-language-service.enable = true; + docker_compose_language_service.enable = true; eslint.enable = true; html.enable = true; jsonls.enable = true; nixd.enable = true; pylsp.enable = true; - rust-analyzer = { + rust_analyzer = { enable = true; installCargo = true; installRustc = true; diff --git a/hardware-specific/amd-laptop.nix b/hardware-specific/amd-laptop.nix index 1dbcd3b..f29d8a5 100644 --- a/hardware-specific/amd-laptop.nix +++ b/hardware-specific/amd-laptop.nix @@ -4,7 +4,7 @@ environment.systemPackages = with pkgs; [ zenmonitor ]; - hardware.opengl.extraPackages = with pkgs; [ rocmPackages.clr.icd ]; + hardware.graphics.extraPackages = with pkgs; [ rocmPackages.clr.icd ]; boot.initrd.kernelModules = [ "amdgpu" ]; diff --git a/hardware-specific/trackball.nix b/hardware-specific/trackball.nix index 9d2fd38..ba15369 100644 --- a/hardware-specific/trackball.nix +++ b/hardware-specific/trackball.nix @@ -7,18 +7,6 @@ } ]; - disabledModules = [ "services/hardware/libinput.nix" ]; - - nixpkgs.overlays = [ - (final: prev: { - moonlight-qt = prev.moonlight-qt.overrideAttrs (old: { - patches = (old.patches or [ ]) ++ [ ../misc/mouse-accel.patch ]; - }); - }) - ]; - - imports = [ ../misc/libinput.nix ]; - hardware.logitech.wireless = { enable = true; enableGraphical = true; diff --git a/misc/libinput.nix b/misc/libinput.nix deleted file mode 100644 index 4207915..0000000 --- a/misc/libinput.nix +++ /dev/null @@ -1,499 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -with lib; - -let - cfg = config.services.libinput; - - xorgBool = v: if v then "on" else "off"; - - mkConfigForDevice = deviceType: { - dev = mkOption { - type = types.nullOr types.str; - default = null; - example = "/dev/input/event0"; - description = '' - Path for ${deviceType} device. Set to `null` to apply to any - auto-detected ${deviceType}. - ''; - }; - - accelProfile = mkOption { - type = types.enum [ - "flat" - "adaptive" - "custom" - ]; - default = "adaptive"; - example = "flat"; - description = '' - Sets the pointer acceleration profile to the given profile. - Permitted values are `adaptive`, `flat`, `custom`. - Not all devices support this option or all profiles. - If a profile is unsupported, the default profile for this is used. - `flat`: Pointer motion is accelerated by a constant - (device-specific) factor, depending on the current speed. - `adaptive`: Pointer acceleration depends on the input speed. - This is the default profile for most devices. - `custom`: Allows the user to define a custom acceleration function. - To define custom functions use the accelPoints - and accelStep options. - ''; - }; - - accelSpeed = mkOption { - type = types.nullOr types.str; - default = null; - example = "-0.5"; - description = '' - Cursor acceleration (how fast speed increases from minSpeed to maxSpeed). - This only applies to the flat or adaptive profile. - ''; - }; - - accelPointsFallback = mkOption { - type = types.nullOr (types.listOf types.number); - default = null; - example = [ - 0.0 - 1.0 - 2.4 - 2.5 - ]; - description = '' - Sets the points of the fallback acceleration function. The value must be a list of - floating point non-negative numbers. This only applies to the custom profile. - ''; - }; - - accelPointsMotion = mkOption { - type = types.nullOr (types.listOf types.number); - default = null; - example = [ - 0.0 - 1.0 - 2.4 - 2.5 - ]; - description = '' - Sets the points of the (pointer) motion acceleration function. The value must be a - list of floating point non-negative numbers. This only applies to the custom profile. - ''; - }; - - accelPointsScroll = mkOption { - type = types.nullOr (types.listOf types.number); - default = null; - example = [ - 0.0 - 1.0 - 2.4 - 2.5 - ]; - description = '' - Sets the points of the scroll acceleration function. The value must be a list of - floating point non-negative numbers. This only applies to the custom profile. - ''; - }; - - accelStepFallback = mkOption { - type = types.nullOr types.number; - default = null; - example = 0.1; - description = '' - Sets the step between the points of the fallback acceleration function. When a step of - 0.0 is provided, libinput's Fallback acceleration function is used. This only applies - to the custom profile. - ''; - }; - - accelStepMotion = mkOption { - type = types.nullOr types.number; - default = null; - example = 0.1; - description = '' - Sets the step between the points of the (pointer) motion acceleration function. When a - step of 0.0 is provided, libinput's Fallback acceleration function is used. This only - applies to the custom profile. - ''; - }; - - accelStepScroll = mkOption { - type = types.nullOr types.number; - default = null; - example = 0.1; - description = '' - Sets the step between the points of the scroll acceleration function. When a step of - 0.0 is provided, libinput's Fallback acceleration function is used. This only applies - to the custom profile. - ''; - }; - - buttonMapping = mkOption { - type = types.nullOr types.str; - default = null; - example = "1 6 3 4 5 0 7"; - description = '' - Sets the logical button mapping for this device, see XSetPointerMapping(3). The string must - be a space-separated list of button mappings in the order of the logical buttons on the - device, starting with button 1. The default mapping is "1 2 3 ... 32". A mapping of 0 deac‐ - tivates the button. Multiple buttons can have the same mapping. Invalid mapping strings are - discarded and the default mapping is used for all buttons. Buttons not specified in the - user's mapping use the default mapping. See section BUTTON MAPPING for more details. - ''; - }; - - calibrationMatrix = mkOption { - type = types.nullOr types.str; - default = null; - example = "0.5 0 0 0 0.8 0.1 0 0 1"; - description = '' - A string of 9 space-separated floating point numbers. Sets the calibration matrix to the - 3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi). - ''; - }; - - clickMethod = mkOption { - type = types.nullOr ( - types.enum [ - "none" - "buttonareas" - "clickfinger" - ] - ); - default = null; - example = "buttonareas"; - description = '' - Enables a click method. Permitted values are `none`, - `buttonareas`, `clickfinger`. - Not all devices support all methods, if an option is unsupported, - the default click method for this device is used. - ''; - }; - - leftHanded = mkOption { - type = types.bool; - default = false; - description = "Enables left-handed button orientation, i.e. swapping left and right buttons."; - }; - - middleEmulation = mkOption { - type = types.bool; - default = true; - description = '' - Enables middle button emulation. When enabled, pressing the left and right buttons - simultaneously produces a middle mouse button click. - ''; - }; - - naturalScrolling = mkOption { - type = types.bool; - default = false; - description = "Enables or disables natural scrolling behavior."; - }; - - scrollButton = mkOption { - type = types.nullOr types.int; - default = null; - example = 1; - description = '' - Designates a button as scroll button. If the ScrollMethod is button and the button is logically - held down, x/y axis movement is converted into scroll events. - ''; - }; - - scrollMethod = mkOption { - type = types.enum [ - "twofinger" - "edge" - "button" - "none" - ]; - default = "twofinger"; - example = "edge"; - description = '' - Specify the scrolling method: `twofinger`, `edge`, - `button`, or `none` - ''; - }; - - horizontalScrolling = mkOption { - type = types.bool; - default = true; - description = '' - Enables or disables horizontal scrolling. When disabled, this driver will discard any - horizontal scroll events from libinput. This does not disable horizontal scroll events - from libinput; it merely discards the horizontal axis from any scroll events. - ''; - }; - - sendEventsMode = mkOption { - type = types.enum [ - "disabled" - "enabled" - "disabled-on-external-mouse" - ]; - default = "enabled"; - example = "disabled"; - description = '' - Sets the send events mode to `disabled`, `enabled`, - or `disabled-on-external-mouse` - ''; - }; - - tapping = mkOption { - type = types.bool; - default = true; - description = '' - Enables or disables tap-to-click behavior. - ''; - }; - - tappingButtonMap = mkOption { - type = types.nullOr ( - types.enum [ - "lrm" - "lmr" - ] - ); - default = null; - description = '' - Set the button mapping for 1/2/3-finger taps to left/right/middle or left/middle/right, respectively. - ''; - }; - - tappingDragLock = mkOption { - type = types.bool; - default = true; - description = '' - Enables or disables drag lock during tapping behavior. When enabled, a finger up during tap- - and-drag will not immediately release the button. If the finger is set down again within the - timeout, the dragging process continues. - ''; - }; - - transformationMatrix = mkOption { - type = types.nullOr types.str; - default = null; - example = "0.5 0 0 0 0.8 0.1 0 0 1"; - description = '' - A string of 9 space-separated floating point numbers. Sets the transformation matrix to - the 3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi). - ''; - }; - - disableWhileTyping = mkOption { - type = types.bool; - default = false; - description = '' - Disable input method while typing. - ''; - }; - - additionalOptions = mkOption { - type = types.lines; - default = ""; - example = '' - Option "DragLockButtons" "L1 B1 L2 B2" - ''; - description = '' - Additional options for libinput ${deviceType} driver. See - {manpage}`libinput(4)` - for available options."; - ''; - }; - }; - - mkX11ConfigForDevice = deviceType: matchIs: '' - Identifier "libinput ${deviceType} configuration" - MatchDriver "libinput" - MatchIs${matchIs} "${xorgBool true}" - ${optionalString (cfg.${deviceType}.dev != null) ''MatchDevicePath "${cfg.${deviceType}.dev}"''} - Option "AccelProfile" "${cfg.${deviceType}.accelProfile}" - ${optionalString ( - cfg.${deviceType}.accelSpeed != null - ) ''Option "AccelSpeed" "${cfg.${deviceType}.accelSpeed}"''} - ${optionalString (cfg.${deviceType}.accelPointsFallback != null) - ''Option "AccelPointsFallback" "${toString cfg.${deviceType}.accelPointsFallback}"'' - } - ${optionalString (cfg.${deviceType}.accelPointsMotion != null) - ''Option "AccelPointsMotion" "${toString cfg.${deviceType}.accelPointsMotion}"'' - } - ${optionalString (cfg.${deviceType}.accelPointsScroll != null) - ''Option "AccelPointsScroll" "${toString cfg.${deviceType}.accelPointsScroll}"'' - } - ${optionalString (cfg.${deviceType}.accelStepFallback != null) - ''Option "AccelStepFallback" "${toString cfg.${deviceType}.accelStepFallback}"'' - } - ${optionalString (cfg.${deviceType}.accelStepMotion != null) - ''Option "AccelStepMotion" "${toString cfg.${deviceType}.accelStepMotion}"'' - } - ${optionalString (cfg.${deviceType}.accelStepScroll != null) - ''Option "AccelStepScroll" "${toString cfg.${deviceType}.accelStepScroll}"'' - } - ${optionalString (cfg.${deviceType}.buttonMapping != null) - ''Option "ButtonMapping" "${cfg.${deviceType}.buttonMapping}"'' - } - ${optionalString (cfg.${deviceType}.calibrationMatrix != null) - ''Option "CalibrationMatrix" "${cfg.${deviceType}.calibrationMatrix}"'' - } - ${optionalString ( - cfg.${deviceType}.transformationMatrix != null - ) ''Option "TransformationMatrix" "${cfg.${deviceType}.transformationMatrix}"''} - ${optionalString ( - cfg.${deviceType}.clickMethod != null - ) ''Option "ClickMethod" "${cfg.${deviceType}.clickMethod}"''} - Option "LeftHanded" "${xorgBool cfg.${deviceType}.leftHanded}" - Option "MiddleEmulation" "${xorgBool cfg.${deviceType}.middleEmulation}" - Option "NaturalScrolling" "${xorgBool cfg.${deviceType}.naturalScrolling}" - ${optionalString (cfg.${deviceType}.scrollButton != null) - ''Option "ScrollButton" "${toString cfg.${deviceType}.scrollButton}"'' - } - Option "ScrollMethod" "${cfg.${deviceType}.scrollMethod}" - Option "HorizontalScrolling" "${xorgBool cfg.${deviceType}.horizontalScrolling}" - Option "SendEventsMode" "${cfg.${deviceType}.sendEventsMode}" - Option "Tapping" "${xorgBool cfg.${deviceType}.tapping}" - ${optionalString (cfg.${deviceType}.tappingButtonMap != null) - ''Option "TappingButtonMap" "${cfg.${deviceType}.tappingButtonMap}"'' - } - Option "TappingDragLock" "${xorgBool cfg.${deviceType}.tappingDragLock}" - Option "DisableWhileTyping" "${xorgBool cfg.${deviceType}.disableWhileTyping}" - ${cfg.${deviceType}.additionalOptions} - ''; -in -{ - - imports = - (map - ( - option: - mkRenamedOptionModule - ([ - "services" - "xserver" - "libinput" - option - ]) - [ - "services" - "libinput" - "touchpad" - option - ] - ) - [ - "accelProfile" - "accelSpeed" - "buttonMapping" - "calibrationMatrix" - "clickMethod" - "leftHanded" - "middleEmulation" - "naturalScrolling" - "scrollButton" - "scrollMethod" - "horizontalScrolling" - "sendEventsMode" - "tapping" - "tappingButtonMap" - "tappingDragLock" - "transformationMatrix" - "disableWhileTyping" - "additionalOptions" - ] - ) - ++ [ - (mkRenamedOptionModule - [ - "services" - "xserver" - "libinput" - "enable" - ] - [ - "services" - "libinput" - "enable" - ] - ) - (mkRenamedOptionModule - [ - "services" - "xserver" - "libinput" - "mouse" - ] - [ - "services" - "libinput" - "mouse" - ] - ) - (mkRenamedOptionModule - [ - "services" - "xserver" - "libinput" - "touchpad" - ] - [ - "services" - "libinput" - "touchpad" - ] - ) - ]; - - options = { - - services.libinput = { - enable = mkEnableOption "libinput" // { - default = config.services.xserver.enable; - defaultText = lib.literalExpression "config.services.xserver.enable"; - }; - mouse = mkConfigForDevice "mouse"; - touchpad = mkConfigForDevice "touchpad"; - }; - }; - - config = mkIf cfg.enable { - - services.xserver.modules = [ pkgs.xorg.xf86inputlibinput ]; - - environment.systemPackages = [ pkgs.xorg.xf86inputlibinput ]; - - environment.etc = - let - cfgPath = "X11/xorg.conf.d/40-libinput.conf"; - in - { - ${cfgPath} = { - source = pkgs.xorg.xf86inputlibinput.out + "/share/" + cfgPath; - }; - }; - - services.udev.packages = [ pkgs.libinput.out ]; - - services.xserver.inputClassSections = [ - (mkX11ConfigForDevice "mouse" "Pointer") - (mkX11ConfigForDevice "touchpad" "Touchpad") - ]; - - assertions = [ - # already present in synaptics.nix - /* - { - assertion = !config.services.xserver.synaptics.enable; - message = "Synaptics and libinput are incompatible, you cannot enable both (in services.xserver)."; - } - */ - ]; - - }; - -} diff --git a/misc/mouse-accel.patch b/misc/mouse-accel.patch deleted file mode 100644 index fa89fb1..0000000 --- a/misc/mouse-accel.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/app/streaming/input/input.cpp b/app/streaming/input/input.cpp -index fb11938b..5c0eb22e 100644 ---- a/app/streaming/input/input.cpp -+++ b/app/streaming/input/input.cpp -@@ -47,7 +47,7 @@ SdlInputHandler::SdlInputHandler(StreamingPreferences& prefs, int streamWidth, i - // Otherwise, we'll use raw input capture which is straight from the device - // without modification by the OS. - SDL_SetHintWithPriority(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, -- prefs.absoluteMouseMode ? "1" : "0", -+ prefs.absoluteMouseMode ? "1" : "1", - SDL_HINT_OVERRIDE); - - #if !SDL_VERSION_ATLEAST(2, 0, 15) diff --git a/misc/template-configuration.nix b/misc/template-configuration.nix index ba10b6f..0661fe8 100644 --- a/misc/template-configuration.nix +++ b/misc/template-configuration.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: let host = "generic"; - stateVersion = "24.05"; + stateVersion = "24.11"; repo = builtins.fetchGit { url = "https://github.com/VSinerva/nixos-conf.git";