From 483de25778d81ff274cfac4795f72cddddc08924 Mon Sep 17 00:00:00 2001 From: Sense T Date: Fri, 28 Feb 2025 22:23:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=88=E4=BA=8E=E5=8F=AF=E4=BB=A5=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E8=BF=90=E8=A1=8C=E4=BA=86=EF=BC=8C=E5=B0=B1=E5=85=88?= =?UTF-8?q?=E8=BF=99=E6=A0=B7=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 807a95d..fe818d1 100644 --- a/flake.nix +++ b/flake.nix @@ -5,11 +5,16 @@ }; outputs = - inputs: + { + self, + nixpkgs, + treefmt-nix, + ... + }: let system = "x86_64-linux"; - pkgs = import inputs.nixpkgs { inherit system; }; - treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix; + pkgs = import nixpkgs { inherit system; }; + treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; packages-inode = with pkgs; [ libgcc libxcrypt-legacy @@ -36,7 +41,7 @@ ]; inherit (pkgs) mkShell; in - rec { + { formatter.${system} = treefmtEval.config.build.wrapper; devShell."${system}" = mkShell { nativeBuildInputs = with pkgs; [ @@ -50,15 +55,20 @@ h3c-inode-client = pkgs.callPackage ./h3c-inode-client/package.nix { }; }; - nixosModules = rec { - chuang-packages = { - pkgs-chuang = packages; - imports = [ - ./h3c-inode-client/module.nix - ]; - }; + nixosModules = + let + pkgs-chuang = self.packages."${system}"; + in + rec { + chuang-packages = + { config, lib, ... }: + { + imports = [ + (import ./h3c-inode-client/module.nix { inherit lib pkgs-chuang config; }) + ]; + }; - default = chuang-packages; - }; + default = chuang-packages; + }; }; }