diff --git a/flake.lock b/flake.lock index 13eaf13..2b1394f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,15 +3,15 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", "type": "github" }, "original": { - "owner": "edolstra", + "owner": "NixOS", "repo": "flake-compat", "type": "github" } @@ -21,11 +21,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1767609335, - "narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=", + "lastModified": 1775087534, + "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "250481aafeb741edfe23d29195671c19b36b6dca", + "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", "type": "github" }, "original": { @@ -96,11 +96,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1767819389, - "narHash": "sha256-nlxFjeUol1SGFaseQWtHZ+Ibo4Epn+E6NZKg1anTb2o=", + "lastModified": 1775298231, + "narHash": "sha256-mBl1H9IbI8ddKXi0B04SkC7EaAtX0xt4pqapHBm39Ag=", "owner": "NixOS", "repo": "nix", - "rev": "5a65b1f1313dd3b1c36967a11ab998b1b20f642c", + "rev": "553fb35af1bed8f8f4d2185a29a4c7ab21c0882f", "type": "github" }, "original": { @@ -132,11 +132,11 @@ ] }, "locked": { - "lastModified": 1764234087, - "narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=", + "lastModified": 1769813415, + "narHash": "sha256-nnVmNNKBi1YiBNPhKclNYDORoHkuKipoz7EtVnXO50A=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "032a1878682fafe829edfcf5fdfad635a2efe748", + "rev": "8946737ff703382fda7623b9fab071d037e897d5", "type": "github" }, "original": { @@ -147,11 +147,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1767185284, - "narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=", + "lastModified": 1775490113, + "narHash": "sha256-2ZBhDNZZwYkRmefK5XLOusCJHnoeKkoN95hoSGgMxWM=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "40b1a28dce561bea34858287fbb23052c3ee63fe", + "rev": "c775c2772ba56e906cbeb4e0b2db19079ef11ff7", "type": "github" }, "original": { @@ -162,15 +162,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1763948260, - "narHash": "sha256-zZk7fn2ARAqmLwaYTpxBJmj81KIdz11NiWt7ydHHD/M=", - "rev": "1c8ba8d3f7634acac4a2094eef7c32ad9106532c", + "lastModified": 1771903837, + "narHash": "sha256-jEA8WggGKtMFeNeCKq3NK8cLEjJmG6/RLUElYYbBZ0E=", + "rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951", "type": "tarball", - "url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.813095.1c8ba8d3f763/nixexprs.tar.xz" + "url": "https://releases.nixos.org/nixos/25.11/nixos-25.11.6495.e764fc9a4058/nixexprs.tar.xz" }, "original": { "type": "tarball", - "url": "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz" + "url": "https://channels.nixos.org/nixos-25.11/nixexprs.tar.xz" } }, "nixpkgs-23-11": { @@ -191,11 +191,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1765674936, - "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", + "lastModified": 1774748309, + "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", + "rev": "333c4e0545a6da976206c74db8773a1645b5870a", "type": "github" }, "original": { @@ -222,11 +222,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1767767207, - "narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=", + "lastModified": 1775423009, + "narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5912c1772a44e31bf1c63c0390b90501e5026886", + "rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9", "type": "github" }, "original": { @@ -237,11 +237,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1767799921, - "narHash": "sha256-r4GVX+FToWVE2My8VVZH4V0pTIpnu2ZE8/Z4uxGEMBE=", + "lastModified": 1775305101, + "narHash": "sha256-/74n1oQPtKG52Yw41cbToxspxHbYz6O3vi+XEw16Qe8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d351d0653aeb7877273920cd3e823994e7579b0b", + "rev": "36a601196c4ebf49e035270e10b2d103fe39076b", "type": "github" }, "original": { diff --git a/machines/mibook/configuration.nix b/machines/mibook/configuration.nix index b7d1bfa..e518687 100644 --- a/machines/mibook/configuration.nix +++ b/machines/mibook/configuration.nix @@ -20,17 +20,11 @@ useOSProber = true; }; - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; # Configure keymap in X11 - services.xserver = { + services.xserver.xkb = { layout = "de"; - xkbVariant = ""; + variant = ""; }; # Configure console keymap @@ -38,21 +32,22 @@ # Enable CUPS to print documents. services.printing.enable = true; + nixpkgs.config.allowUnfree = true; - # Enable sound with pipewire. - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; + hardware.nvidia.prime = { + sync.enable = true; + + nvidiaBusId = "PCI:01:00:0"; + intelBusId = "PCI:00:2:0"; + }; + + + hardware.nvidia.prime = { + sync.enable = true; + + nvidiaBusId = "PCI:01:00:0"; + intelBusId = "PCI:00:02:0"; }; system = { diff --git a/machines/mibook/disks.nix b/machines/mibook/disks.nix index 6ac41c9..5fd46cf 100644 --- a/machines/mibook/disks.nix +++ b/machines/mibook/disks.nix @@ -9,7 +9,7 @@ { fileSystems."/" = { - device = "/dev/disk/by-uuid/077abdb0-cbc1-4589-b411-25ecc157488f"; + device = "/dev/disk/by-uuid/46e36a07-e75a-480a-a2f1-be103c6a3881"; fsType = "ext4"; }; } diff --git a/machines/mibook/environments.nix b/machines/mibook/environments.nix index d1a2d8e..3ea5812 100644 --- a/machines/mibook/environments.nix +++ b/machines/mibook/environments.nix @@ -5,11 +5,23 @@ let in { my.profiles = { - hyprland.enable = true; + kde-desktop.enable = true; zsh.enable = true; apps = { desktop_apps = true; dev_apps = true; }; + development.enable = true; + docker.enable = true; }; + + my.hardware = { + bluetooth.enable = true; + sound.enable = false; + nvidia.enable = true; + }; + my.services = { + vpn.enable = true; + }; + } diff --git a/machines/mibook/hardware-configuration.nix b/machines/mibook/hardware-configuration.nix index e4303e0..e53a3e4 100644 --- a/machines/mibook/hardware-configuration.nix +++ b/machines/mibook/hardware-configuration.nix @@ -24,7 +24,7 @@ boot.extraModulePackages = [ ]; fileSystems."/" = { - device = "/dev/disk/by-uuid/077abdb0-cbc1-4589-b411-25ecc157488f"; + device = "/dev/disk/by-uuid/46e36a07-e75a-480a-a2f1-be103c6a3881"; fsType = "ext4"; }; diff --git a/modules/environments/development/default.nix b/modules/environments/development/default.nix index 834b529..31205fd 100644 --- a/modules/environments/development/default.nix +++ b/modules/environments/development/default.nix @@ -17,6 +17,7 @@ in users.users.finn.packages = with pkgs; [ google-chrome vscode + zed-editor neovim # jetbrains.idea-ultimate go diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 464ae26..7c06857 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -9,6 +9,7 @@ #./firmware #./graphics #./keychron + ./nvidia #./yubikey ./sound #./thunderbolt diff --git a/modules/hardware/nvidia/default.nix b/modules/hardware/nvidia/default.nix new file mode 100644 index 0000000..b1f459b --- /dev/null +++ b/modules/hardware/nvidia/default.nix @@ -0,0 +1,53 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.my.hardware.nvidia; +in +{ + options.my.hardware.nvidia = with lib; { + enable = mkEnableOption "NVIDIA GPU support"; + }; + + config = lib.mkIf cfg.enable { + # Enable OpenGL + hardware.graphics = { + enable = true; + }; + # Load nvidia driver for Xorg and Wayland + services.xserver.videoDrivers = ["nvidia"]; + hardware.nvidia = { + + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; + + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + open = false; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + }; +}