From 7634e8f78b111c6d7e66df905f4d52f54f910f3d Mon Sep 17 00:00:00 2001 From: Alexandre Date: Fri, 29 May 2026 18:38:49 +0200 Subject: [PATCH] Added hwconfig --- dendritic/flake.lock | 98 +++++++++++++++++++ dendritic/modules/features/home-manager.nix | 5 + .../modules/hosts/framework/configuration.nix | 15 ++- dendritic/modules/hosts/framework/default.nix | 11 +++ .../modules/hosts/framework/hardware.nix | 41 ++++++++ 5 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 dendritic/flake.lock create mode 100644 dendritic/modules/hosts/framework/default.nix create mode 100755 dendritic/modules/hosts/framework/hardware.nix diff --git a/dendritic/flake.lock b/dendritic/flake.lock new file mode 100644 index 0000000..ef1b05e --- /dev/null +++ b/dendritic/flake.lock @@ -0,0 +1,98 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1779969295, + "narHash": "sha256-HwIJ3tOcwSMiV75L7KqJXciXR9UfT+d7rwOZMX7cTnA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "61e2c9659324181e0f0ed911958c536333b1d4f6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "import-tree": { + "locked": { + "lastModified": 1778781969, + "narHash": "sha256-Jjuz5CmSkur8KvLDoGa+vylEp+RkQtv4mt/qcMznpH0=", + "owner": "vic", + "repo": "import-tree", + "rev": "d321337efd0f23a9eb14a42adb7b2c29313ab274", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1779560665, + "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "home-manager": "home-manager", + "import-tree": "import-tree", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/dendritic/modules/features/home-manager.nix b/dendritic/modules/features/home-manager.nix index 8f116e9..7d77f57 100644 --- a/dendritic/modules/features/home-manager.nix +++ b/dendritic/modules/features/home-manager.nix @@ -11,5 +11,10 @@ useGlobalPkgs = true; useUserPackages = true; }; + + home = { + + stateVersion = "25.11"; + }; }; } diff --git a/dendritic/modules/hosts/framework/configuration.nix b/dendritic/modules/hosts/framework/configuration.nix index 4167db5..1d39e85 100644 --- a/dendritic/modules/hosts/framework/configuration.nix +++ b/dendritic/modules/hosts/framework/configuration.nix @@ -1,9 +1,12 @@ -{ self, inputs, ... }: - { + self, + inputs, + ... +}: { + flake.nixosConfigurations.framework = inputs.nixpkgs.lib.nixosSystem { modules = [ - self.nixosModules.frameworkModule + self.nixosModules.frameworkHardware self.nixosModules.homeManager ]; }; @@ -31,6 +34,12 @@ alex = self.homeModules.alexModule; }; }; + + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + }; + }; }; } diff --git a/dendritic/modules/hosts/framework/default.nix b/dendritic/modules/hosts/framework/default.nix new file mode 100644 index 0000000..b421893 --- /dev/null +++ b/dendritic/modules/hosts/framework/default.nix @@ -0,0 +1,11 @@ +{ + self, + inputs, + ... +}: { + flake.nixosConfigurations.framework = inputs.nixpkgs.lib.nixosSystem { + modules = [ + self.nixosModules.frameworkModule + ]; + }; +} diff --git a/dendritic/modules/hosts/framework/hardware.nix b/dendritic/modules/hosts/framework/hardware.nix new file mode 100755 index 0000000..ccdd93d --- /dev/null +++ b/dendritic/modules/hosts/framework/hardware.nix @@ -0,0 +1,41 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + flake.nixosModules.frameworkHardware = { pkgs, ... } : { + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +}