From f86275f33165c0e5997ba2bbae03756f5403196f Mon Sep 17 00:00:00 2001 From: benstrb Date: Sat, 28 Mar 2026 00:04:05 +0100 Subject: [PATCH] progress --- modules/hosts/desktop/boot.nix | 13 +++++++++++++ modules/hosts/desktop/flake-parts.nix | 1 + modules/hosts/desktop/hardware.nix | 19 +++++++++++++++++++ modules/hosts/desktop/users/benDesktop.nix | 7 +++++++ modules/nix/flake-parts/lib.nix | 21 +++++++++++++++++++++ 5 files changed, 61 insertions(+) create mode 100644 modules/hosts/desktop/boot.nix create mode 100644 modules/hosts/desktop/flake-parts.nix create mode 100644 modules/hosts/desktop/hardware.nix create mode 100644 modules/hosts/desktop/users/benDesktop.nix create mode 100644 modules/nix/flake-parts/lib.nix diff --git a/modules/hosts/desktop/boot.nix b/modules/hosts/desktop/boot.nix new file mode 100644 index 0000000..d534ef6 --- /dev/null +++ b/modules/hosts/desktop/boot.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + flake.modules.nixos.desktop = { + boot = { + kernelPackages = pkgs.linuxPackages_6_12; + kernelParams = ["nvidia-drm.modeset=1"]; + + loader.grub = { + enable = true; + device = "/dev/disk/by-id/ata-KINGSTON_SKC300S37A60G_50026B7239039148"; + }; + }; + }; +} diff --git a/modules/hosts/desktop/flake-parts.nix b/modules/hosts/desktop/flake-parts.nix new file mode 100644 index 0000000..4e75add --- /dev/null +++ b/modules/hosts/desktop/flake-parts.nix @@ -0,0 +1 @@ +{inputs, ...}: {flake.nixosConfigurations = inputs.self.lib.mkNixos "x86_64-linux" "desktop";} diff --git a/modules/hosts/desktop/hardware.nix b/modules/hosts/desktop/hardware.nix new file mode 100644 index 0000000..5c5726d --- /dev/null +++ b/modules/hosts/desktop/hardware.nix @@ -0,0 +1,19 @@ +{config, ...}: { + flake.modules.nixos.desktop = { + nixpkgs.hostPlatform = "x86_64-linux"; + + hardware = { + graphics = { + enable = true; + enable32Bit = true; + }; + }; + + nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + open = false; + package = config.boot.kernelPackages.nvidiaPackages.production; + }; + }; +} diff --git a/modules/hosts/desktop/users/benDesktop.nix b/modules/hosts/desktop/users/benDesktop.nix new file mode 100644 index 0000000..fe2cad2 --- /dev/null +++ b/modules/hosts/desktop/users/benDesktop.nix @@ -0,0 +1,7 @@ +{self, ...}: { + flake.modules.nixos.desktop = { + imports = [ + self.factory.benDesktop + ]; + }; +} diff --git a/modules/nix/flake-parts/lib.nix b/modules/nix/flake-parts/lib.nix new file mode 100644 index 0000000..3708d7c --- /dev/null +++ b/modules/nix/flake-parts/lib.nix @@ -0,0 +1,21 @@ +{ + inputs, + lib, + ... +}: { + options.flake.lib = lib.mkOption { + type = lib.types.attrsOf lib.types.unspecified; + default = {}; + }; + + config.flake.lib = { + mkNixos = system: name: { + ${name} = inputs.nixpkgs.lib.nixosSystem { + modules = [ + inputs.self.modules.nixos.${name} + {nixpkgs.hostPlatform = lib.mkDefault system;} + ]; + }; + }; + }; +}