From 00455d06e4a80341ddd43f9b3b33c0a723a08a38 Mon Sep 17 00:00:00 2001 From: Joinemm Date: Tue, 25 Jun 2024 12:07:49 +0300 Subject: [PATCH] Update to NixOS 24.05 --- flake.lock | 182 ++++++++++++++++------------------- home-modules/gtk.nix | 2 +- home-modules/neovim.nix | 5 +- hosts/x1/configuration.nix | 26 +++-- hosts/zeus/configuration.nix | 93 +++++++++--------- modules/gaming.nix | 7 +- modules/gui.nix | 24 ++--- modules/laptop.nix | 79 +++++++-------- modules/nix.nix | 1 + 9 files changed, 194 insertions(+), 225 deletions(-) diff --git a/flake.lock b/flake.lock index 3af0892..d196096 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1710519883, - "narHash": "sha256-IS9lf3pQp3kaT8tcw+Pys1inpRK7rJQp9RDvNpCNLys=", + "lastModified": 1719260840, + "narHash": "sha256-q2pun4pwYFkD7ML1Hcnq+K29RrqX5olrcYITjB8HsEI=", "owner": "joinemm", "repo": "bin", - "rev": "fe996f26303a8bdae50832db4b490220cf8166e9", + "rev": "ad4ac105978e1727683c96d214a6d4677560b3a9", "type": "github" }, "original": { @@ -30,11 +30,11 @@ ] }, "locked": { - "lastModified": 1711099426, - "narHash": "sha256-HzpgM/wc3aqpnHJJ2oDqPBkNsqWbW0WfWUO8lKu8nGk=", + "lastModified": 1717408969, + "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", "owner": "numtide", "repo": "devshell", - "rev": "2d45b54ca4a183f2fdcf4b19c895b64fbf620ee8", + "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", "type": "github" }, "original": { @@ -50,11 +50,11 @@ ] }, "locked": { - "lastModified": 1712612224, - "narHash": "sha256-Tv4C8OSPVmm4LbpJGLFSODyvJy6DqrisEGPCQdNVOeY=", + "lastModified": 1719236180, + "narHash": "sha256-VZAfBk2Lo8hQy/NQ4XVSpTICT0ownXBUi1QvGfdlxaM=", "owner": "nix-community", "repo": "disko", - "rev": "79eab0e82cb126bf4ac170f44af82479f0895ab5", + "rev": "dd4d1663ccf7fbdb32361b9afe9e71206584cd4c", "type": "github" }, "original": { @@ -98,11 +98,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -119,11 +119,11 @@ ] }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -168,21 +168,30 @@ "type": "github" } }, - "flake-utils_3": { + "git-hooks": { "inputs": { - "systems": "systems_3" + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1718879355, + "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "cachix", + "repo": "git-hooks.nix", "type": "github" } }, @@ -190,7 +199,7 @@ "inputs": { "nixpkgs": [ "nixvim", - "pre-commit-hooks", + "git-hooks", "nixpkgs" ] }, @@ -215,11 +224,11 @@ ] }, "locked": { - "lastModified": 1712645849, - "narHash": "sha256-67v20E0gH7nvAaMsah2oRIocnxGO25fATUyzQHIywxQ=", + "lastModified": 1719180626, + "narHash": "sha256-vZAzm5KQpR6RGple1dzmSJw5kPivES2heCFM+ZWkt0I=", "owner": "nix-community", "repo": "home-manager", - "rev": "40a99619da804a78a0b166e5c6911108c059c3a8", + "rev": "6b1f90a8ff92e81638ae6eb48cd62349c3e387bb", "type": "github" }, "original": { @@ -236,11 +245,11 @@ ] }, "locked": { - "lastModified": 1711763326, - "narHash": "sha256-sXcesZWKXFlEQ8oyGHnfk4xc9f2Ip0X/+YZOq3sKviI=", + "lastModified": 1719128254, + "narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "36524adc31566655f2f4d55ad6b875fb5c1a4083", + "rev": "50581970f37f06a4719001735828519925ef8310", "type": "github" }, "original": { @@ -257,11 +266,11 @@ ] }, "locked": { - "lastModified": 1712884330, - "narHash": "sha256-xYTrM82HEy1E1tGysT3CfNLgTKym9TUMciOPJrPkPaA=", + "lastModified": 1719105588, + "narHash": "sha256-BXyXbrbsU90S0T4ruNx0q26ITfJCeXk5Qix6KVVKQLw=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "e3f09d077b360802d5b744befd2a0803fb9aae18", + "rev": "e952ecaae2066e0b942921684437da3d9f4f056d", "type": "github" }, "original": { @@ -277,11 +286,11 @@ ] }, "locked": { - "lastModified": 1712459390, - "narHash": "sha256-e12bNDottaGoBgd0AdH/bQvk854xunlWAdZwr/oHO1c=", + "lastModified": 1719111455, + "narHash": "sha256-rnIxHx+fLpydjMQsbpZ21kblUr/lMqSaAtMA4+qMMEE=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "4676d72d872459e1e3a248d049609f110c570e9a", + "rev": "4293f532d0107dfb7e6f8b34a0421dc8111320e6", "type": "github" }, "original": { @@ -292,11 +301,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1712566108, - "narHash": "sha256-c9nT2ZODGqobISP41kUwCQ84Srwg7a/1TmPFQuol2/8=", + "lastModified": 1719145664, + "narHash": "sha256-+0bBlerLxsHUJcKPDWZM1wL3V9bzCFjz+VyRTG8fnUA=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "1e3b3a35b7083f4152f5a516798cf9b21e686465", + "rev": "c3e48cbd88414f583ff08804eb57b0da4c194f9e", "type": "github" }, "original": { @@ -307,11 +316,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712791164, - "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "lastModified": 1719075281, + "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", "type": "github" }, "original": { @@ -323,20 +332,14 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", - "type": "github" + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" } }, "nixvim": { @@ -344,6 +347,7 @@ "devshell": "devshell", "flake-compat": "flake-compat", "flake-parts": "flake-parts_2", + "git-hooks": "git-hooks", "home-manager": [ "home-manager" ], @@ -351,14 +355,14 @@ "nixpkgs": [ "nixpkgs" ], - "pre-commit-hooks": "pre-commit-hooks" + "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1712655539, - "narHash": "sha256-Wpr4lWndkYRgs27Yl5ALJQ7n4PdDjT+Mq+8xAz2q1CY=", + "lastModified": 1719228487, + "narHash": "sha256-eJUcZAjOcGAoh97ZRsy+ls8IkHPMpDuh0IpRKSmoWs4=", "owner": "nix-community", "repo": "nixvim", - "rev": "512ac70ec96ee774867f5a6ae494b12f0d4ddcb9", + "rev": "66c8592b31845cb0a1335ecc31ea40e89bed1a38", "type": "github" }, "original": { @@ -367,34 +371,6 @@ "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", - "gitignore": "gitignore", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712579741, - "narHash": "sha256-igpsH+pa6yFwYOdah3cFciCk8gw+ytniG9quf5f/q84=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "70f504012f0a132ac33e56988e1028d88a48855c", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "bin": "bin", @@ -405,7 +381,7 @@ "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixvim": "nixvim", - "treefmt-nix": "treefmt-nix" + "treefmt-nix": "treefmt-nix_2" } }, "systems": { @@ -438,33 +414,39 @@ "type": "github" } }, - "systems_3": { + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1718522839, + "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "numtide", + "repo": "treefmt-nix", "type": "github" } }, - "treefmt-nix": { + "treefmt-nix_2": { "inputs": { "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1711963903, - "narHash": "sha256-N3QDhoaX+paWXHbEXZapqd1r95mdshxToGowtjtYkGI=", + "lastModified": 1719243788, + "narHash": "sha256-9T9mSY35EZSM1KAwb7K9zwQ78qTlLjosZgtUGnw4rn4=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "49dc4a92b02b8e68798abd99184f228243b6e3ac", + "rev": "065a23edceff48f948816b795ea8cc6c0dee7cdf", "type": "github" }, "original": { diff --git a/home-modules/gtk.nix b/home-modules/gtk.nix index 49e887a..752c78c 100644 --- a/home-modules/gtk.nix +++ b/home-modules/gtk.nix @@ -2,7 +2,7 @@ home = { pointerCursor = { package = pkgs.phinger-cursors; - name = "phinger-cursors-light"; + name = "phinger-cursors-dark"; size = 24; x11.enable = true; gtk.enable = true; diff --git a/home-modules/neovim.nix b/home-modules/neovim.nix index f575510..f46628e 100644 --- a/home-modules/neovim.nix +++ b/home-modules/neovim.nix @@ -87,8 +87,7 @@ } { # this is here because it needs insert mode - action = "vim.lsp.buf.signature_help"; - lua = true; + action.__raw = "vim.lsp.buf.signature_help"; key = ""; mode = "i"; } @@ -312,7 +311,7 @@ }; }; servers = { - nil_ls = { + nil-ls = { enable = true; settings.formatting.command = ["alejandra"]; }; diff --git a/hosts/x1/configuration.nix b/hosts/x1/configuration.nix index 02c70bb..8133b46 100644 --- a/hosts/x1/configuration.nix +++ b/hosts/x1/configuration.nix @@ -39,24 +39,20 @@ hostId = "c08d7d71"; }; - hardware = { - opengl = { - extraPackages = with pkgs; [ - intel-compute-runtime - intel-media-driver - ]; - }; + hardware.graphics = { + extraPackages = with pkgs; [ + intel-compute-runtime + intel-media-driver + ]; }; services = { - syncthing = { - settings.folders = { - "code".enable = true; - "notes".enable = true; - "pictures".enable = true; - "work".enable = true; - "documents".enable = true; - }; + syncthing.settings.folders = { + "code".enable = true; + "notes".enable = true; + "pictures".enable = true; + "work".enable = true; + "documents".enable = true; }; tailscale.enable = true; diff --git a/hosts/zeus/configuration.nix b/hosts/zeus/configuration.nix index 29086e7..1ab449b 100644 --- a/hosts/zeus/configuration.nix +++ b/hosts/zeus/configuration.nix @@ -41,57 +41,54 @@ }; services = { - syncthing = { - settings.folders = { - "camera".enable = true; - "code".enable = true; - "documents".enable = true; - "mobile-downloads".enable = true; - "mobile-screenshots".enable = true; - "notes".enable = true; - "pictures".enable = true; - "videos".enable = true; - "work".enable = true; - }; + syncthing.settings.folders = { + "camera".enable = true; + "code".enable = true; + "documents".enable = true; + "mobile-downloads".enable = true; + "mobile-screenshots".enable = true; + "notes".enable = true; + "pictures".enable = true; + "videos".enable = true; + "work".enable = true; + }; + + xserver = { + deviceSection = '' + Option "VariableRefresh" "true" + ''; + xrandrHeads = [ + { + output = "DisplayPort-0"; + primary = true; + monitorConfig = '' + Modeline "3440x1440_144.00" 1086.75 3440 3744 4128 4816 1440 1443 1453 1568 -hsync +vsync + Option "PreferredMode" "3440x1440_144.00" + ''; + } + { + # LG TV that should be off by default + output = "HDMI-A-0"; + monitorConfig = '' + Option "Enable" "false" + Option "RightOf" "DisplayPort-0" + ''; + } + ]; }; - }; - services.xserver = { - videoDrivers = ["amdgpu"]; - deviceSection = '' - Option "VariableRefresh" "true" + # for keyboard config using via + udev.extraRules = '' + KERNEL=="hidraw*", ATTRS{idVendor}=="6582", ATTRS{idProduct}=="075c", MODE="0666", GROUP="plugdev" ''; - xrandrHeads = [ - { - output = "DisplayPort-0"; - primary = true; - monitorConfig = '' - Modeline "3440x1440_144.00" 1086.75 3440 3744 4128 4816 1440 1443 1453 1568 -hsync +vsync - Option "PreferredMode" "3440x1440_144.00" - ''; - } - ]; }; - services.udev.extraRules = '' - KERNEL=="hidraw*", ATTRS{idVendor}=="6582", ATTRS{idProduct}=="075c", MODE="0666", GROUP="plugdev" - ''; - - # Configure GPU - # Early KMS isn't helpful - # hardware.amdgpu.loadInInitrd = false; - - # https://gitlab.freedesktop.org/drm/amd/-/issues/1974 - # systemd.services.amdgpu-overclock = { - # description = "Overclock AMD GPU"; - # after = ["suspend.target" "multi-user.target" "systemd-user-sessions.service"]; - # wantedBy = ["sleep.target" "multi-user.target"]; - # wants = ["modprobe@amdgpu.service"]; - # script = '' - # echo 'high' > /sys/class/drm/card0/device/power_dpm_force_performance_level - # ''; - # serviceConfig.Type = "oneshot"; - # }; - # # https://wiki.archlinux.org/title/AMDGPU#Boot_parameter - # boot.kernelParams = ["amdgpu.ppfeaturemask=0xfff7ffff"]; + hardware.amdgpu = { + initrd.enable = true; + amdvlk = { + enable = true; + support32Bit.enable = true; + supportExperimental.enable = true; + }; + }; } diff --git a/modules/gaming.nix b/modules/gaming.nix index 98bd806..7705e1c 100644 --- a/modules/gaming.nix +++ b/modules/gaming.nix @@ -23,12 +23,11 @@ }; hardware = { - opengl = { + graphics = { enable = true; - driSupport = true; - driSupport32Bit = true; + enable32Bit = true; - # Add opengl/vulkan support + # Add vulkan support extraPackages = with pkgs; [ libva ]; diff --git a/modules/gui.nix b/modules/gui.nix index 2384088..806216b 100644 --- a/modules/gui.nix +++ b/modules/gui.nix @@ -10,22 +10,26 @@ config.common.default = "*"; }; - # login automatically to my user - # this is fine because the hard drive is encrypted anyway - services.getty = { - autologinUser = user; - helpLine = ""; - }; - # use X11 keyboard settings in tty console.useXkbConfig = true; services = { gnome.gnome-keyring.enable = true; - # compositor + # login automatically to my user + # this is fine because the hard drive is encrypted anyway + getty = { + autologinUser = user; + helpLine = ""; + }; + picom.enable = true; + libinput = { + enable = true; + mouse.accelProfile = "flat"; + }; + # use X11 xserver = { enable = true; @@ -40,10 +44,6 @@ # use startx as a display manager displayManager.startx.enable = true; - libinput = { - enable = true; - mouse.accelProfile = "flat"; - }; }; }; diff --git a/modules/laptop.nix b/modules/laptop.nix index ba216a6..1c64070 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -6,20 +6,6 @@ acpi ]; - services.xserver = { - # caps lock is super - xkb.options = "caps:super"; - - # touchpad - libinput = { - enable = true; - touchpad = { - tapping = true; - disableWhileTyping = true; - }; - }; - }; - # use S3 sleep mode boot.kernelParams = ["mem_sleep_default=deep"]; @@ -29,20 +15,6 @@ powertop.enable = true; }; - services.upower = { - enable = true; - percentageLow = 10; - percentageCritical = 5; - percentageAction = 2; - # zfs doesn't support Hibernation - criticalPowerAction = "HybridSleep"; - }; - - # Enable the auto-cpufreq daemon - services.auto-cpufreq.enable = true; - # Enable thermald, the temperature management daemon - services.thermald.enable = true; - # turn off wifi without sudo security.sudo.extraRules = [ { @@ -56,20 +28,43 @@ } ]; - # screen locker service - services.physlock = { - enable = true; - allowAnyUser = true; - }; + services = { + xserver.xkb.options = "caps:super"; - # lock screen automatically after inactivity - services.xserver.xautolock = let - cmd = "/run/wrappers/physlock -d"; - in { - enable = true; - locker = cmd; - nowlocker = cmd; - time = 5; - killtime = 15; + libinput.touchpad = { + tapping = true; + disableWhileTyping = true; + }; + + upower = { + enable = true; + percentageLow = 10; + percentageCritical = 5; + percentageAction = 2; + # zfs doesn't support Hibernation + criticalPowerAction = "HybridSleep"; + }; + + # Enable the auto-cpufreq daemon + auto-cpufreq.enable = true; + # Enable thermald, the temperature management daemon + thermald.enable = true; + + # screen locker service + physlock = { + enable = true; + allowAnyUser = true; + }; + + # lock screen automatically after inactivity + xserver.xautolock = let + cmd = "/run/wrappers/physlock -dm"; + in { + enable = true; + locker = cmd; + nowlocker = cmd; + time = 5; + killtime = 15; + }; }; } diff --git a/modules/nix.nix b/modules/nix.nix index 86c2043..280cec7 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -23,6 +23,7 @@ trusted-users = ["root" "@wheel"]; experimental-features = ["nix-command" "flakes"]; + max-jobs = 2; auto-optimise-store = true; builders-use-substitutes = true; keep-derivations = true;