From f0a869d49bd9bb02c20150abd343cef721246b57 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 4 Dec 2024 23:00:57 +0100 Subject: [PATCH] treewide: misc optimizations for xps --- flake.lock | 68 +++++++++++++++++++++++++------- flake.nix | 13 +++++- home/config/xdg/default.nix | 18 ++++----- hosts/common/default.nix | 1 + hosts/common/services/logind.nix | 6 +++ hosts/xps16/configuration.nix | 2 +- hosts/xps16/home/default.nix | 4 +- 7 files changed, 85 insertions(+), 27 deletions(-) create mode 100644 hosts/common/services/logind.nix diff --git a/flake.lock b/flake.lock index cbfef0a..d0a782a 100644 --- a/flake.lock +++ b/flake.lock @@ -76,11 +76,11 @@ ] }, "locked": { - "lastModified": 1732466619, - "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=", + "lastModified": 1733050161, + "narHash": "sha256-lYnT+EYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20=", "owner": "nix-community", "repo": "home-manager", - "rev": "f3111f62a23451114433888902a55cf0692b408d", + "rev": "62d536255879be574ebfe9b87c4ac194febf47c5", "type": "github" }, "original": { @@ -158,11 +158,11 @@ ] }, "locked": { - "lastModified": 1732758830, - "narHash": "sha256-bmMRjp4U3RDvLuwOWXMTHitMBMrmmpzP4x0dckJMZD4=", + "lastModified": 1733277378, + "narHash": "sha256-jPhKF6d2UXBr2nkJIFuUjVXdo6kEwLuIMK3RyJeA60s=", "owner": "infinidoge", "repo": "nix-minecraft", - "rev": "09c3d43938e7b535ecada974759e9ed84ee91235", + "rev": "ea8246bb2a70d33b5d332667a57da75e95c89af9", "type": "github" }, "original": { @@ -171,13 +171,29 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1733217105, + "narHash": "sha256-fc6jTzIwCIVWTX50FtW6AZpuukuQWSEbPiyg6ZRGWFY=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "cceee0a31d2f01bcc98b2fbd591327c06a4ea4f9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1732350895, - "narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=", + "lastModified": 1733261153, + "narHash": "sha256-eq51hyiaIwtWo19fPEeE0Zr2s83DYMKJoukNLgGGpek=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3", + "rev": "b681065d0919f7eb5309a93cea2cfa84dec9aa88", "type": "github" }, "original": { @@ -188,11 +204,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1732837521, - "narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=", + "lastModified": 1733341920, + "narHash": "sha256-VO+J0b7eo9eIEpfUsfmdVbNvumKvkZcpbu/j4qIhNWY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370", + "rev": "4bdc7d1d4503e0ab509cd8edb7b701802075fefd", "type": "github" }, "original": { @@ -202,6 +218,26 @@ "type": "github" } }, + "osuchan": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1684092181, + "narHash": "sha256-Oi6G8Jx2RkEMi3UndtAnZw61hfgKGEe7l/ILdB9ump4=", + "ref": "refs/heads/master", + "rev": "028ed8774d1cf4650fc15253146cf14451eb608c", + "revCount": 43, + "type": "git", + "url": "file:///home/h7x4/git/osuchan-line-bot" + }, + "original": { + "type": "git", + "url": "file:///home/h7x4/git/osuchan-line-bot" + } + }, "root": { "inputs": { "dotfiles": "dotfiles", @@ -209,8 +245,10 @@ "matrix-synapse-next": "matrix-synapse-next", "maunium-stickerpicker": "maunium-stickerpicker", "minecraft": "minecraft", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", + "osuchan": "osuchan", "sops-nix": "sops-nix", "vscode-server": "vscode-server" } @@ -222,11 +260,11 @@ ] }, "locked": { - "lastModified": 1732575825, - "narHash": "sha256-xtt95+c7OUMoqZf4OvA/7AemiH3aVuWHQbErYQoPwFk=", + "lastModified": 1733128155, + "narHash": "sha256-m6/qwJAJYcidGMEdLqjKzRIjapK4nUfMq7rDCTmZajc=", "owner": "Mic92", "repo": "sops-nix", - "rev": "3433ea14fbd9e6671d0ff0dd45ed15ee4c156ffa", + "rev": "c6134b6fff6bda95a1ac872a2a9d5f32e3c37856", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 182424a..31d4830 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + dotfiles = { url = "git+https://git.pvv.ntnu.no/oysteikt/dotfiles?ref=master"; flake = false; @@ -57,6 +59,7 @@ nixpkgs, nixpkgs-unstable, home-manager, + nixos-hardware, dotfiles, matrix-synapse-next, @@ -199,7 +202,15 @@ }]; }; kasei = nixSys "kasei" { }; - xps16 = nixSys "xps16" { }; + xps16 = nixSys "xps16" { + modules = [ + nixos-hardware.nixosModules.common-hidpi + nixos-hardware.nixosModules.common-pc-laptop + nixos-hardware.nixosModules.common-pc-laptop-ssd + nixos-hardware.nixosModules.common-cpu-intel + nixos-hardware.nixosModules.common-gpu-intel + ]; + }; europa = nixSys "europa" { }; tsuki = nixSys "tsuki" { modules = [ diff --git a/home/config/xdg/default.nix b/home/config/xdg/default.nix index 0432fa3..e148ac8 100644 --- a/home/config/xdg/default.nix +++ b/home/config/xdg/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, ... }: { imports = [ ./mimetypes.nix @@ -8,14 +8,14 @@ enable = true; userDirs = { enable = true; - desktop = "${config.home.homeDirectory}/Desktop"; - documents = "${config.home.homeDirectory}/documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/music"; - pictures = "${config.home.homeDirectory}/pictures"; - publicShare = "${config.home.homeDirectory}/public"; - templates = "${config.home.homeDirectory}/templates"; - videos = "${config.home.homeDirectory}/videos"; + desktop = lib.mkDefault "${config.home.homeDirectory}/Desktop"; + documents = lib.mkDefault "${config.home.homeDirectory}/documents"; + download = lib.mkDefault "${config.home.homeDirectory}/Downloads"; + music = lib.mkDefault "${config.home.homeDirectory}/music"; + pictures = lib.mkDefault "${config.home.homeDirectory}/pictures"; + publicShare = lib.mkDefault "${config.home.homeDirectory}/public"; + templates = lib.mkDefault "${config.home.homeDirectory}/templates"; + videos = lib.mkDefault "${config.home.homeDirectory}/videos"; }; }; } diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 5aaa67e..7e46451 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -17,6 +17,7 @@ in { ./services/irqbalance.nix ./services/journald.nix ./services/libinput.nix + ./services/logind.nix ./services/openssh.nix ./services/pcscd.nix ./services/pipewire.nix diff --git a/hosts/common/services/logind.nix b/hosts/common/services/logind.nix new file mode 100644 index 0000000..507f721 --- /dev/null +++ b/hosts/common/services/logind.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + services.logind = { + powerKeyLongPress = "poweroff"; + }; +} diff --git a/hosts/xps16/configuration.nix b/hosts/xps16/configuration.nix index 4109756..14b2592 100644 --- a/hosts/xps16/configuration.nix +++ b/hosts/xps16/configuration.nix @@ -65,7 +65,7 @@ services = { xserver.upscaleDefaultCursor = true; xserver.dpi = 192; - tailscale.enable = true; + libinput.touchpad.accelSpeed = "0.5"; }; environment.systemPackages = [ diff --git a/hosts/xps16/home/default.nix b/hosts/xps16/home/default.nix index 564e9fd..7359e63 100644 --- a/hosts/xps16/home/default.nix +++ b/hosts/xps16/home/default.nix @@ -1,4 +1,6 @@ -{ ... }: +{ config, ... }: { home.stateVersion = "24.11"; + + programs.waybar.settings.mainBar.output = [ "eDP-1" ]; }