diff --git a/configurations/london/default.nix b/configurations/london/default.nix index a0dc23c..6f5134c 100644 --- a/configurations/london/default.nix +++ b/configurations/london/default.nix @@ -97,4 +97,15 @@ }; }; }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; } diff --git a/flake.lock b/flake.lock index 96e8721..335ac6d 100644 --- a/flake.lock +++ b/flake.lock @@ -52,6 +52,21 @@ "type": "github" } }, + "flake-compat_2": { + "locked": { + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -73,6 +88,28 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -145,6 +182,24 @@ "type": "github" } }, + "flake-utils_5": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flakey-profile": { "locked": { "lastModified": 1712898590, @@ -242,6 +297,25 @@ "type": "github" } }, + "lib-aggregate": { + "inputs": { + "flake-utils": "flake-utils_5", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1725192674, + "narHash": "sha256-xEAVzgkjtdi9b4nl1yHWtiaPqYuvB7pwU9OurXv9Lls=", + "owner": "nix-community", + "repo": "lib-aggregate", + "rev": "3f10d853f98081feec35b736e38da91202a87c3a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "lib-aggregate", + "type": "github" + } + }, "lix": { "flake": false, "locked": { @@ -312,6 +386,49 @@ "url": "https://git.lix.systems/lix-project/lix/archive/2.91.0.tar.gz" } }, + "nix-eval-jobs": { + "inputs": { + "flake-parts": "flake-parts_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1723372011, + "narHash": "sha256-zqenoufFiPfobw74idorZMG8AXG3DnFzbHplt/Nkvrg=", + "owner": "nix-community", + "repo": "nix-eval-jobs", + "rev": "8802412b8747633e9d80639897e4d58fa6290909", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-eval-jobs", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720066371, + "narHash": "sha256-uPlLYH2S0ACj0IcgaK9Lsf4spmJoGejR9DotXiXSBZQ=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "622f829f5fe69310a866c8a6cd07e747c44ef820", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1717794163, @@ -328,6 +445,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1725152544, + "narHash": "sha256-Tm344cnFM9f2YZsgWtJduvhIrvLr3Bi8J4Xc+UZDKYE=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "7f0b9e4fbd91826cb9ce6babbc11c87903191051", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1710695816, @@ -346,11 +478,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1725001927, - "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=", + "lastModified": 1725407940, + "narHash": "sha256-tiN5Rlg/jiY0tyky+soJZoRzLKbPyIdlQ77xVgREDNM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421", + "rev": "6f6c45b5134a8ee2e465164811e451dcb5ad86e3", "type": "github" }, "original": { @@ -378,11 +510,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { @@ -392,6 +524,59 @@ "type": "github" } }, + "nixpkgs-wayland": { + "inputs": { + "flake-compat": "flake-compat_2", + "lib-aggregate": "lib-aggregate", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1725541051, + "narHash": "sha256-ke/qx3H6K789rijVpnDPD6M/BWqqueWMtXD+nGvqZ1k=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "5502df5dcd4157b8195fdf61da29bb560f4bceab", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1723221148, + "narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "154bcb95ad51bc257c2ce4043a725de6ca700ef6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ @@ -429,6 +614,7 @@ "lix-module-unstable": "lix-module-unstable", "nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-unstable": "nixpkgs-unstable", + "nixpkgs-wayland": "nixpkgs-wayland", "sops-nix": "sops-nix" } }, @@ -465,11 +651,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1725201042, - "narHash": "sha256-lj5pxOwidP0W//E7IvyhbhXrnEUW99I07+QpERnzTS4=", + "lastModified": 1725540166, + "narHash": "sha256-htc9rsTMSAY5ek+DB3tpntdD/es0eam2hJgO92bWSys=", "owner": "Mic92", "repo": "sops-nix", - "rev": "5db5921e40ae382d6716dce591ea23b0a39d96f7", + "rev": "d9d781523a1463965cd1e1333a306e70d9feff07", "type": "github" }, "original": { @@ -537,6 +723,43 @@ "repo": "default", "type": "github" } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723303070, + "narHash": "sha256-krGNVA30yptyRonohQ+i9cnK+CfCpedg6z3qzqVJcTs=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "14c092e0326de759e16b37535161b3cb9770cea3", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index de259db..5516518 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,9 @@ }; lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1"; + nixpkgs-wayland = { + url = "github:nix-community/nixpkgs-wayland"; + }; extra-config.url = "git+ssh://forgejo@git.dalaran.fr/dala/nixos-config-extra.git"; }; @@ -48,7 +51,9 @@ lix-module-unstable, lix-module-stable, lanzaboote, - }: + nixpkgs-wayland, + ... + }@inputs: let machines = import ./machines.nix; my = import ./modules; @@ -62,7 +67,7 @@ }; machinesNodes = builtins.mapAttrs ( name: config: - { ... }: + { lib, ... }: { imports = [ ( @@ -73,6 +78,9 @@ (if (config.system == "x86_64-linux") then lanzaboote.nixosModules.lanzaboote else { }) ]; + # FIXME: Dirty hack, fuck Nvidia + nixpkgs.overlays = (if (name == "london") then [ inputs.nixpkgs-wayland.overlay ] else [ ]); + deployment.allowLocalDeployment = config.localDeployment; networking.hostName = name; diff --git a/modules/workstation/desktop.nix b/modules/workstation/desktop.nix index 364e8de..1e3f1ea 100644 --- a/modules/workstation/desktop.nix +++ b/modules/workstation/desktop.nix @@ -35,8 +35,7 @@ in xdgOpenUsePortal = true; wlr.enable = true; extraPortals = with pkgs; [ - xdg-desktop-portal-gnome - xdg-desktop-portal-kde + xdg-desktop-portal-gtk ]; }; } diff --git a/modules/workstation/home-manager/desktop/sway/default.nix b/modules/workstation/home-manager/desktop/sway/default.nix index f3c656d..d23ecd5 100644 --- a/modules/workstation/home-manager/desktop/sway/default.nix +++ b/modules/workstation/home-manager/desktop/sway/default.nix @@ -163,6 +163,7 @@ in before-sleep '${pkgs.swaylock}/bin/swaylock -f' ''; } + { command = "exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; } { command = "${pkgs.nextcloud-client}/bin/nextcloud --background"; } { command = "${pkgs.keepassxc}/bin/keepassxc"; } { @@ -297,7 +298,6 @@ in xwayland = true; extraSessionCommands = '' - ${wlrRendererLine} export WLR_NO_HARDWARE_CURSORS=1 export XDG_CURRENT_DESKTOP=sway export _JAVA_AWT_WM_NONREPARENTING=1 diff --git a/modules/workstation/home-manager/fish.nix b/modules/workstation/home-manager/fish.nix index 1a53069..d98aa39 100644 --- a/modules/workstation/home-manager/fish.nix +++ b/modules/workstation/home-manager/fish.nix @@ -9,7 +9,7 @@ let if config.my.desktop.sway.enable then '' if [ -z $DISPLAY ] && [ "$(tty)" = /dev/tty1 ] - exec ${pkgs.sway}/bin/sway + exec dbus-run-session sway --unsupported-gpu end '' else diff --git a/modules/workstation/home-manager/games.nix b/modules/workstation/home-manager/games.nix index 8c8fa74..bc14214 100644 --- a/modules/workstation/home-manager/games.nix +++ b/modules/workstation/home-manager/games.nix @@ -18,5 +18,7 @@ with lib; }; }; - config = mkIf config.my.games.wine.enable { home.packages = with pkgs; [ wine ]; }; + config = mkIf config.my.games.wine.enable { + home.packages = with pkgs; [ wineWowPackages.waylandFull ]; + }; }