From 8520e18ad256ae8e7a7ee1716fddc566b39a1a6b Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Mon, 20 Mar 2023 13:57:57 +0300 Subject: 2023-03-20 --- flake.nix | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 4eb3fd0..4b5fa34 100644 --- a/flake.nix +++ b/flake.nix @@ -254,13 +254,10 @@ inherit (self.checks.${system}.preCommit) shellHook; }; - formatter = pkgs.writeShellApplication { - name = "fmt"; - runtimeInputs = with pkgs; [alejandra]; - text = '' - alejandra --quiet "$@" + formatter = with pkgs; + writeShellScriptBin "fmt" '' + ${alejandra}/bin/alejandra --quiet "$@" ''; - }; checks.preCommit = pre-commit-hooks.lib.${system}.run { src = ./.; @@ -283,20 +280,19 @@ settings.deadnix.edit = true; }; }) - // { + // (let + importConfigurations = dir: import dir {inherit inputs lib;}; + in { inherit lib; modules.nixfiles = import ./modules/common; nixosModules.nixfiles = import ./modules/nixos; - nixosConfigurations = - import ./nixosConfigurations {inherit inputs lib;}; + nixosConfigurations = importConfigurations ./nixosConfigurations; darwinModules.nixfiles = import ./modules/darwin; - darwinConfigurations = - import ./darwinConfigurations {inherit inputs lib;}; + darwinConfigurations = importConfigurations ./darwinConfigurations; - # TODO Make it so that self.packages also can use this. overlays.default = final: _: { bruh = final.callPackage ./packages/bruh.nix {}; mpv-autosub = final.callPackage ./packages/mpv-autosub.nix {}; @@ -304,5 +300,5 @@ nixfiles = final.callPackage ./packages/nixfiles.nix {}; throttled = final.callPackage ./packages/throttled.nix {}; }; - }; + }); } -- cgit v1.2.3