about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix22
1 files changed, 9 insertions, 13 deletions
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 {};
         };
-      };
+      });
 }

Consider giving Nix/NixOS a try! <3