about summary refs log tree commit diff
path: root/flake
diff options
context:
space:
mode:
Diffstat (limited to 'flake')
-rw-r--r--flake/devshell.nix41
-rw-r--r--flake/mba.nix20
2 files changed, 61 insertions, 0 deletions
diff --git a/flake/devshell.nix b/flake/devshell.nix
new file mode 100644
index 0000000..f096bfe
--- /dev/null
+++ b/flake/devshell.nix
@@ -0,0 +1,41 @@
+{ inputs, ... }: {
+  imports = [
+    inputs.devshell.flakeModule
+    inputs.treefmt-nix.flakeModule
+    inputs.pre-commit-hooks.flakeModule
+  ];
+
+  perSystem = { config, pkgs, inputs', ... }: {
+    devShells.default = pkgs.mkShell {
+      name = "dotfiles";
+
+      packages = [
+      ];
+
+      TREEFMT_CONFIG_FILE = config.treefmt.build.configFile;
+    };
+
+    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;
+      };
+    };
+
+    pre-commit = {
+      settings = {
+        hooks = {
+          # deadnix.enable = true;
+          shellcheck.enable = true;
+          treefmt.enable = true;
+        };
+      };
+    };
+  };
+}
diff --git a/flake/mba.nix b/flake/mba.nix
new file mode 100644
index 0000000..60ac876
--- /dev/null
+++ b/flake/mba.nix
@@ -0,0 +1,20 @@
+{ nixpkgs, home-manager, darwin, inputs, ... }:
+
+let
+  default-system = "aarch64-darwin";
+
+  nixpkgsConfig = {
+    config = {
+      allowUnfree = true;
+    };
+  };
+in
+{
+  system = darwin.lib.darwinSystem {
+    system = default-system;
+    modules = [
+      ../hosts/mba
+      home-manager.darwinModules.home-manager
+    ];
+  };
+}