From 2b969f772671c264e6f746e51aa66b6f9a9fbe01 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 8 Mar 2023 18:01:37 +0000 Subject: [PATCH] flake: dev-shells: convert to 'flake-parts' --- flake/default.nix | 3 +-- flake/dev-shells.nix | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/flake/default.nix b/flake/default.nix index 3ba2b19..eb85017 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -26,8 +26,6 @@ let default = self.apps.${system}.diff-flake; }; - devShells = import ./dev-shells.nix inputs system; - packages = import ./packages.nix inputs system; # Work-around for https://github.com/nix-community/home-manager/issues/3075 @@ -73,6 +71,7 @@ flake-parts.lib.mkFlake { inherit inputs; } { imports = [ ./checks.nix + ./dev-shells.nix ./lib.nix ./nixos.nix ./overlays.nix diff --git a/flake/dev-shells.nix b/flake/dev-shells.nix index 064f57d..15c1335 100644 --- a/flake/dev-shells.nix +++ b/flake/dev-shells.nix @@ -1,17 +1,17 @@ -{ self, nixpkgs, ... }: -system: -let - pkgs = nixpkgs.legacyPackages.${system}; -in +{ inputs, ... }: { - default = pkgs.mkShell { - name = "NixOS-config"; + perSystem = { self', pkgs, ... }: { + devShells = { + default = pkgs.mkShell { + name = "NixOS-config"; - nativeBuildInputs = with pkgs; [ - gitAndTools.pre-commit - nixpkgs-fmt - ]; + nativeBuildInputs = with pkgs; [ + gitAndTools.pre-commit + nixpkgs-fmt + ]; - inherit (self.checks.${system}.pre-commit) shellHook; + inherit (self'.checks.pre-commit) shellHook; + }; + }; }; }