about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix126
1 files changed, 74 insertions, 52 deletions
diff --git a/flake.nix b/flake.nix
index b65a7dd..b71d627 100644
--- a/flake.nix
+++ b/flake.nix
@@ -38,24 +38,40 @@
   };
 
   # Output config, or config for NixOS system
-  outputs = { self, nixpkgs, darwin, flake-utils, pre-commit-hooks, devshell
-    , treefmt-nix, agenix, ... }@inputs:
-    flake-utils.lib.eachDefaultSystem (system:
+  outputs =
+    {
+      self,
+      nixpkgs,
+      darwin,
+      flake-utils,
+      pre-commit-hooks,
+      devshell,
+      treefmt-nix,
+      agenix,
+      ...
+    }@inputs:
+    flake-utils.lib.eachDefaultSystem (
+      system:
       let
         pkgs = import nixpkgs {
           inherit system;
           overlays = [ devshell.overlays.default ];
         };
-        treefmt = (treefmt-nix.lib.mkWrapper pkgs {
-          projectRootFile = "flake.nix";
-          programs = { nixfmt-classic.enable = true; };
-          settings.formatter.deadnix = {
-            command = "${pkgs.deadnix}/bin/deadnix";
-            options = [ "--edit" ];
-            includes = [ "*.nix" ];
-          };
-        });
-      in {
+        treefmt = (
+          treefmt-nix.lib.mkWrapper pkgs {
+            projectRootFile = "flake.nix";
+            programs = {
+              nixfmt.enable = true;
+            };
+            settings.formatter.deadnix = {
+              command = "${pkgs.deadnix}/bin/deadnix";
+              options = [ "--edit" ];
+              includes = [ "*.nix" ];
+            };
+          }
+        );
+      in
+      {
         checks = {
           pre-commit-check = pre-commit-hooks.lib.${system}.run {
             src = ./.;
@@ -80,49 +96,55 @@
             treefmt
             inputs.agenix.packages."${system}".default
           ];
-          devshell.startup.pre-commit.text =
-            self.checks.${system}.pre-commit-check.shellHook;
-          env = [{
-            name = "DEVSHELL_NO_MOTD";
-            value = "1";
-          }];
+          devshell.startup.pre-commit.text = self.checks.${system}.pre-commit-check.shellHook;
+          env = [
+            {
+              name = "DEVSHELL_NO_MOTD";
+              value = "1";
+            }
+          ];
         };
 
-      }) // (flake-utils.lib.eachDefaultSystemPassThrough (system:
-        let
-          mkSystem = import ./nix/lib/mkSystem.nix { inherit nixpkgs inputs; };
-        in {
-
-          # a VM running on the MacBook Air
-          nixosConfigurations.vm-aarch64 = mkSystem "vm-aarch64" {
-            system = "aarch64-linux";
-            user = "fcuny";
-          };
+      }
+    )
+    // (flake-utils.lib.eachDefaultSystemPassThrough (
+      system:
+      let
+        mkSystem = import ./nix/lib/mkSystem.nix { inherit nixpkgs inputs; };
+      in
+      {
+
+        # a VM running on the MacBook Air
+        nixosConfigurations.vm-aarch64 = mkSystem "vm-aarch64" {
+          system = "aarch64-linux";
+          user = "fcuny";
+        };
 
-          # a VM running on the synology DS923+
-          nixosConfigurations.vm-synology = mkSystem "vm-synology" {
-            system = "x86_64-linux";
-            user = "fcuny";
-          };
+        # a VM running on the synology DS923+
+        nixosConfigurations.vm-synology = mkSystem "vm-synology" {
+          system = "x86_64-linux";
+          user = "fcuny";
+        };
 
-          # a VM running on hetzner cloud
-          nixosConfigurations.vm-hetzner = mkSystem "vm-hetzner" {
-            system = "x86_64-linux";
-            user = "fcuny";
-          };
+        # a VM running on hetzner cloud
+        nixosConfigurations.vm-hetzner = mkSystem "vm-hetzner" {
+          system = "x86_64-linux";
+          user = "fcuny";
+        };
 
-          # my personal MacBook Air
-          darwinConfigurations.mba-m2 = mkSystem "mba-m2" {
-            system = "aarch64-darwin";
-            user = "fcuny";
-            darwin = true;
-          };
+        # my personal MacBook Air
+        darwinConfigurations.mba-m2 = mkSystem "mba-m2" {
+          system = "aarch64-darwin";
+          user = "fcuny";
+          darwin = true;
+        };
 
-          # my work MacBook Pro
-          darwinConfigurations.hq-c02fk3q7md6t = mkSystem "hq-c02fk3q7md6t" {
-            system = "x86_64-darwin";
-            user = "fcuny";
-            darwin = true;
-          };
-        }));
+        # my work MacBook Pro
+        darwinConfigurations.hq-c02fk3q7md6t = mkSystem "hq-c02fk3q7md6t" {
+          system = "x86_64-darwin";
+          user = "fcuny";
+          darwin = true;
+        };
+      }
+    ));
 }