1
0
Просмотр исходного кода

chore(cleanup): make things tidier

Zander Hawke 9 месяцев назад
Родитель
Сommit
1fe1bdffbe
3 измененных файлов с 16 добавлено и 21 удалено
  1. 1 1
      flake.nix
  2. 14 20
      lib/default.nix
  3. 1 0
      shell.nix

+ 1 - 1
flake.nix

@@ -39,8 +39,8 @@
     rec {
 
       lib = import ./lib { inherit inputs outputs; };
-      modules = import ./modules { inherit inputs outputs; };
       overlays = import ./overlays { inherit inputs outputs; };
+      modules = import ./modules;
 
       formatter = lib.eachSystem (pkgs: pkgs.nixfmt-tree);
       packages = lib.eachSystem (pkgs: import ./packages { inherit pkgs; });

+ 14 - 20
lib/default.nix

@@ -61,26 +61,20 @@ rec {
 
   pkgsFor = lib.genAttrs allSystems (
     system:
-    if isDarwin system then
-      import nixpkgs-darwin {
-        inherit system;
-        config.allowUnfree = true;
-        overlays = [
-          outputs.overlays.additions
-          outputs.overlays.modifications
-          outputs.overlays.unstable-packages
-        ];
-      }
-    else
-      import nixpkgs {
-        inherit system;
-        config.allowUnfree = true;
-        overlays = [
-          outputs.overlays.additions
-          outputs.overlays.modifications
-          outputs.overlays.unstable-packages
-        ];
-      }
+    let
+      importFor =
+        nixpkgs:
+        import nixpkgs {
+          inherit system;
+          config.allowUnfree = true;
+          overlays = [
+            outputs.overlays.additions
+            outputs.overlays.modifications
+            outputs.overlays.unstable-packages
+          ];
+        };
+    in
+    if isDarwin system then importFor nixpkgs-darwin else importFor nixpkgs
   );
 
   print =

+ 1 - 0
shell.nix

@@ -13,6 +13,7 @@
 {
   default = pkgs.mkShell {
     NIX_CONFIG = "extra-experimental-features = nix-command flakes";
+
     nativeBuildInputs = with pkgs; [
       nix
       nixfmt-tree