fixup! flake: refactor

This commit is contained in:
Guanran Wang 2024-03-09 12:25:06 +08:00
parent f457676f1c
commit 42b9e71edf
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -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];