From 3dda82d830ff0a963ae19a22651dd574f7513685 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Fri, 26 Apr 2024 11:44:59 +0200 Subject: [PATCH] flake input patching :) --- common/laptop_hardware.nix | 2 +- common/security.nix | 3 ++- flake.lock | 24 ++++++++++++------------ flake.nix | 34 +++++++++++++++++++++++++++------- 4 files changed, 42 insertions(+), 21 deletions(-) diff --git a/common/laptop_hardware.nix b/common/laptop_hardware.nix index c553930..3fc7a40 100644 --- a/common/laptop_hardware.nix +++ b/common/laptop_hardware.nix @@ -12,9 +12,9 @@ in usbutils powertop ddcutil - # tlpui ] ++ lib.optionals graphical [ ddcui + tlpui ]; # services.ddccontrol.enable = true; diff --git a/common/security.nix b/common/security.nix index 6f687b7..f06306e 100644 --- a/common/security.nix +++ b/common/security.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, ... }: +{ pkgs, config, lib, inputs, system, ... }: let cfg = config.grimmShared; in @@ -22,6 +22,7 @@ in libsecret vulnix doas-sudo-shim # muscle memory + inputs.agenix.packages.${system}.default ] ++ lib.optionals (tooling.enable && tooling.pass) [ pass (writeShellScriptBin "passw" "pass $@") diff --git a/flake.lock b/flake.lock index cf07479..a22a6c3 100644 --- a/flake.lock +++ b/flake.lock @@ -78,11 +78,11 @@ "yafas": "yafas" }, "locked": { - "lastModified": 1713731828, - "narHash": "sha256-htFugddDpE7ziY/MdxKxD40+JejADwCkN6Ln5D8a0oY=", + "lastModified": 1714043270, + "narHash": "sha256-WTpyfCMHEaGWLKQR0rVTXwxFnGzyC8VYwHYVsOTdf1Q=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "60b608762452d4c17ce620cb1075078827f22108", + "rev": "7705ea7bb501453ffb1f085b4ddbdc606f5463f8", "type": "github" }, "original": { @@ -485,11 +485,11 @@ ] }, "locked": { - "lastModified": 1713748476, - "narHash": "sha256-FB+tCte2nOOLI7i3YvHFZZsFWDjaq+f5nn4wxt6akTQ=", + "lastModified": 1714093995, + "narHash": "sha256-7oYv0EJ2iqL9MZiB7QRE63nHDVMuyTgukgYZDdjL8Kg=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "5dba7fd39730e14f3c54787df23c533dc98e1e0f", + "rev": "a8c2a0e160e1212c67724aa89a823b55d423d157", "type": "github" }, "original": { @@ -544,11 +544,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713714899, - "narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=", + "lastModified": 1714076141, + "narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6143fc5eeb9c4f00163267708e26191d1e918932", + "rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856", "type": "github" }, "original": { @@ -594,11 +594,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1713725259, - "narHash": "sha256-9ZR/Rbx5/Z/JZf5ehVNMoz/s5xjpP0a22tL6qNvLt5E=", + "lastModified": 1713995372, + "narHash": "sha256-fFE3M0vCoiSwCX02z8VF58jXFRj9enYUSTqjyHAjrds=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a5e4bbcb4780c63c79c87d29ea409abf097de3f7", + "rev": "dd37924974b9202f8226ed5d74a252a9785aedf8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 64a34a1..2bcb1ea 100644 --- a/flake.nix +++ b/flake.nix @@ -33,14 +33,35 @@ outputs = inputs @ { self, nix-gaming, agenix, hammering, nixpkgs, nixpkgs-stable, nix-locate, chaotic, ... }: let - system = "x86_64-linux"; - stable = import nixpkgs-stable { inherit system; config.allowUnfree = true; }; + patches = [ + { + url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/305278.patch"; + hash = "sha256-8RvPI8Id+Ttgv07IMBTAxkSc+K00WhiWgdgrCcULd7o="; + } + ]; + + customNixosSystem = system: definitions: + let + stable = import nixpkgs-stable { + inherit system; + config.allowUnfree = true; + }; + patched = let unpatched = nixpkgs.legacyPackages.${system}; in + unpatched.applyPatches { + name = "nixpkgs-patched"; + src = inputs.nixpkgs; + patches = map unpatched.fetchpatch patches; + }; + nixosSystem = import (patched + "/nixos/lib/eval-config.nix"); + in + nixosSystem ({ + inherit system; + specialArgs = { inherit inputs system stable; }; + } // definitions); in { nixosConfigurations = { - grimmauld-nixos = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { inherit inputs system stable; }; + grimmauld-nixos = (customNixosSystem "x86_64-linux" { modules = [ (import ./overlays) agenix.nixosModules.default @@ -52,9 +73,8 @@ ./modules/users.nix ./modules/system-packages.nix ./modules/kvm.nix - { environment.systemPackages = [ agenix.packages.${system}.default ]; } ]; - }; + }); }; }; }