From 42b9e71edfff43fd510287ef376a02879ca111da Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 9 Mar 2024 12:25:06 +0800 Subject: [PATCH] fixup! flake: refactor --- flake.nix | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 96b01b8..9e892d0 100755 --- a/flake.nix +++ b/flake.nix @@ -122,7 +122,17 @@ inputs.flake-utils.lib.eachDefaultSystem (system: let pkgs = inputs.nixpkgs.legacyPackages.${system}; treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix; + in { + ### nix fmt + formatter = treefmtEval.config.build.wrapper; + ### nix flake check + checks = {formatting = treefmtEval.config.build.check inputs.self;}; + + ### nix {run,shell,build} + packages = import ./pkgs pkgs; + }) + // (let mkNixOS = system: modules: inputs.nixpkgs.lib.nixosSystem { inherit system modules; @@ -135,23 +145,14 @@ specialArgs = {inherit inputs;}; }; in { - ### nix fmt - formatter = treefmtEval.config.build.wrapper; - - ### nix flake check - checks = {formatting = treefmtEval.config.build.check inputs.self;}; - - ### nix {run,shell,build} - packages = import ./pkgs pkgs; - - ### nixpkgs.overlays = []; - overlays = import ./overlays; - ### imports = []; nixosModules.default = ./nixos/modules; darwinModules.default = ./darwin/modules; homeManagerModules.default = ./home/modules; + ### nixpkgs.overlays = []; + overlays = import ./overlays; + ### NixOS nixosConfigurations = { "aristotle" = mkNixOS "x86_64-linux" [./hosts/aristotle];