about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix24
-rw-r--r--flake/devshell.nix55
-rw-r--r--flake/hosts.nix21
3 files changed, 57 insertions, 43 deletions
diff --git a/flake.nix b/flake.nix
index 8994fc9..93df93c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -32,28 +32,14 @@
   };
 
   # Output config, or config for NixOS system
-  outputs = inputs@{ self, flake-parts, ... }:
-    flake-parts.lib.mkFlake { inherit inputs; } {
-      flake =
-        let
-          mba = import ./flake/mba.nix {
-            inherit (inputs) nixpkgs home-manager darwin;
-            inherit inputs;
-          };
-        in
-        {
-          darwinConfigurations = {
-            mba-fcuny = mba.system;
-          };
-        };
-
-      systems = [
-        "aarch64-darwin"
-        "x86_64-linux"
-      ];
+  outputs = inputs:
+    inputs.flake-parts.lib.mkFlake { inherit inputs; } {
+
+      systems = [ "aarch64-darwin" "x86_64-linux" ];
 
       imports = [
         ./flake/devshell.nix
+        ./flake/hosts.nix
       ];
     };
 }
diff --git a/flake/devshell.nix b/flake/devshell.nix
index f096bfe..7b75417 100644
--- a/flake/devshell.nix
+++ b/flake/devshell.nix
@@ -5,37 +5,44 @@
     inputs.pre-commit-hooks.flakeModule
   ];
 
-  perSystem = { config, pkgs, inputs', ... }: {
-    devShells.default = pkgs.mkShell {
-      name = "dotfiles";
+  perSystem =
+    { config
+    , inputs'
+    , pkgs
+    , ...
+    }: {
+      devshells.default = {
+        name = "world";
 
-      packages = [
-      ];
+        packages = with pkgs; [
+        ];
 
-      TREEFMT_CONFIG_FILE = config.treefmt.build.configFile;
-    };
+        commands = [
+          { package = config.treefmt.build.wrapper; }
+        ];
+      };
 
-    treefmt = {
-      projectRootFile = ".git/config";
+      treefmt = {
+        projectRootFile = ".git/config";
 
-      # list of supported programs
-      # https://github.com/numtide/treefmt-nix
-      programs = {
-        nixpkgs-fmt.enable = true;
-        shfmt.enable = true;
-        yamlfmt.enable = true;
-        taplo.enable = true;
+        # list of supported programs
+        # https://github.com/numtide/treefmt-nix
+        programs = {
+          nixpkgs-fmt.enable = true;
+          shfmt.enable = true;
+          yamlfmt.enable = true;
+          taplo.enable = true;
+        };
       };
-    };
 
-    pre-commit = {
-      settings = {
-        hooks = {
-          # deadnix.enable = true;
-          shellcheck.enable = true;
-          treefmt.enable = true;
+      pre-commit = {
+        settings = {
+          hooks = {
+            # deadnix.enable = true;
+            shellcheck.enable = true;
+            treefmt.enable = true;
+          };
         };
       };
     };
-  };
 }
diff --git a/flake/hosts.nix b/flake/hosts.nix
new file mode 100644
index 0000000..b0bc74c
--- /dev/null
+++ b/flake/hosts.nix
@@ -0,0 +1,21 @@
+{ inputs, ... }:
+let
+  inherit (inputs) self nixpkgs darwin home-manager;
+  inherit (nixpkgs.lib) mkMerge;
+
+  mkDarwinConfig = system: path:
+    darwin.lib.darwinSystem {
+      inherit system;
+      modules = [ home-manager.darwinModule path ];
+      specialArgs = { inherit inputs; };
+    };
+in
+{
+  flake = mkMerge [
+    {
+      darwinConfigurations = {
+        mba-fcuny = mkDarwinConfig "aarch64-darwin" ../hosts/mba;
+      };
+    }
+  ];
+}