From 650bcbb2de41612efe2501967f1bc423a85477b2 Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Thu, 13 Jun 2024 13:08:31 +0200 Subject: [PATCH] Add nixos-hardware --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 ++++- hosts/default.nix | 6 ++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index 4428b59..816b544 100644 --- a/flake.lock +++ b/flake.lock @@ -187,6 +187,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1718265846, + "narHash": "sha256-h4MnTID6ciFxtTvtl+ibXMKaG6iLMezCtUvKIfFG7r0=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "d75003136c0fc94ee60e51806c2801ff572d06a6", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1717952948, @@ -300,6 +316,7 @@ "home-manager": "home-manager", "krops": "krops", "nix-pre-commit-hooks": "nix-pre-commit-hooks", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgsMaster": "nixpkgsMaster", "nur": "nur", diff --git a/flake.nix b/flake.nix index 0fa2c4c..fa2976f 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,8 @@ nix-pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; nix-pre-commit-hooks.url = "github:cachix/git-hooks.nix/master"; + nixos-hardware.url = "github:nixos/nixos-hardware/master"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgsMaster.url = "github:NixOS/nixpkgs/master"; @@ -133,6 +135,7 @@ nixosConfigurations = nixpkgs.lib.mapAttrs (hostname: { system + , extraModules ? [ ] , targetHost ? hostname , nixpkgs ? inputs.nixpkgs }: nixpkgs.lib.nixosSystem rec { @@ -169,7 +172,7 @@ home-manager.nixosModules.home-manager inputs.sops-nix.nixosModules.sops inputs.disko.nixosModules.disko - ]; + ] ++ extraModules; }) (import ./hosts inputs); }; diff --git a/hosts/default.nix b/hosts/default.nix index b6751aa..27f156e 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,7 @@ { ... }@inputs: +let + hardware = inputs.nixos-hardware.nixosModules; +in { aluminium = { targetHost = "192.168.0.1"; @@ -30,5 +33,8 @@ copper = { system = "x86_64-linux"; targetHost = "copper.lan.bw.jalr.de"; + extraModules = [ + hardware.framework-16-7040-amd + ]; }; }