flake: refactor
This commit is contained in:
parent
db92d6ed01
commit
f457676f1c
1 changed files with 42 additions and 33 deletions
25
flake.nix
25
flake.nix
|
@ -118,8 +118,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = inputs: let
|
||||
inherit (inputs.flake-utils.lib) eachDefaultSystemMap;
|
||||
outputs = inputs:
|
||||
inputs.flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||
treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
||||
|
||||
mkNixOS = system: modules:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
|
@ -132,13 +134,20 @@
|
|||
inherit system modules;
|
||||
specialArgs = {inherit inputs;};
|
||||
};
|
||||
|
||||
treefmtEval = eachDefaultSystemMap (system: inputs.treefmt-nix.lib.evalModule inputs.nixpkgs.legacyPackages.${system} ./treefmt.nix);
|
||||
in {
|
||||
formatter = eachDefaultSystemMap (system: treefmtEval.${system}.config.build.wrapper);
|
||||
checks = eachDefaultSystemMap (system: {formatting = treefmtEval.${system}.config.build.check inputs.self;});
|
||||
packages = eachDefaultSystemMap (system: import ./pkgs inputs.nixpkgs.legacyPackages.${system});
|
||||
### 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;
|
||||
|
@ -154,5 +163,5 @@
|
|||
"plato" = mkDarwin "x86_64-darwin" [./hosts/plato];
|
||||
"whitesteel" = mkDarwin "x86_64-darwin" [./hosts/whitesteel];
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue