From 28901f25f13dc7097a3db7564c53b267863556f5 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Thu, 27 Jul 2023 13:34:32 +0200 Subject: [PATCH] added formatter --- flake.nix | 61 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/flake.nix b/flake.nix index 782057c..26ff251 100644 --- a/flake.nix +++ b/flake.nix @@ -5,37 +5,40 @@ nixpkgs.url = github:nixos/nixpkgs/nixos-23.05; }; - outputs = { self, nixpkgs }: - let - supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system}); - in { + outputs = { + self, + nixpkgs, + }: let + supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system}); + in { + # Formatter + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); - # Packages - packages = forAllSystems (system: { - default = pkgs.${system}.poetry2nix.mkPoetryApplication { projectDir = self; }; - }); + # Packages + packages = forAllSystems (system: { + default = pkgs.${system}.poetry2nix.mkPoetryApplication {projectDir = self;}; + }); - # Dev Shell - devShells = forAllSystems (system: { - default = pkgs.${system}.mkShellNoCC { - shellHook = "Welcome to your nix-powered dev environment for dyn-gandi!"; + # Dev Shell + devShells = forAllSystems (system: { + default = pkgs.${system}.mkShellNoCC { + shellHook = "Welcome to your nix-powered dev environment for dyn-gandi!"; - packages = with pkgs.${system}; [ - (poetry2nix.mkPoetryEnv { projectDir = self; }) - poetry - ]; + packages = with pkgs.${system}; [ + (poetry2nix.mkPoetryEnv {projectDir = self;}) + poetry + ]; + }; + }); - }; - }); - - # Run as apps - apps = forAllSystems (system: { - default = { - program = "${self.packages.${system}.default}/bin/dyn_gandi"; - type = "app"; - }; - }); - }; + # Run as apps + apps = forAllSystems (system: { + default = { + program = "${self.packages.${system}.default}/bin/dyn_gandi"; + type = "app"; + }; + }); + }; }