diff --git a/imports/formatter.nix b/imports/formatter.nix index 3793bca..9bd90c9 100644 --- a/imports/formatter.nix +++ b/imports/formatter.nix @@ -1,16 +1,8 @@ -{ inputs, ... }: +{ ... }: { perSystem = - { - config, - self', - inputs', - pkgs, - system, - lib, - ... - }: + { pkgs, ... }: { formatter = pkgs.nixfmt-rfc-style; }; diff --git a/templates/client/flake.nix b/templates/client/flake.nix index 92a17e0..7e37b24 100644 --- a/templates/client/flake.nix +++ b/templates/client/flake.nix @@ -13,25 +13,9 @@ flake-parts.lib.mkFlake { inherit inputs; } { systems = import systems; - imports = [ ./imports/overlay.nix ]; - - perSystem = - { - config, - self', - inputs', - pkgs, - system, - ... - }: - { - devShells.default = pkgs.mkShellNoCC { - name = "default"; - packages = [ - pkgs.example1 - pkgs.example2 - ]; - }; - }; + imports = [ + ./imports/devShells.nix + ./imports/overlay.nix + ]; }; } diff --git a/templates/client/imports/devShells.nix b/templates/client/imports/devShells.nix index a1379c2..7f8691f 100644 --- a/templates/client/imports/devShells.nix +++ b/templates/client/imports/devShells.nix @@ -2,14 +2,7 @@ { perSystem = - { - config, - self', - inputs', - pkgs, - system, - ... - }: + { pkgs, ... }: { devShells.default = pkgs.mkShell { name = "default"; diff --git a/templates/client/imports/overlay.nix b/templates/client/imports/overlay.nix index d915ee2..4d063e0 100644 --- a/templates/client/imports/overlay.nix +++ b/templates/client/imports/overlay.nix @@ -2,14 +2,7 @@ { perSystem = - { - config, - self', - inputs', - pkgs, - system, - ... - }: + { system, ... }: { _module.args.pkgs = import inputs.nixpkgs { inherit system; diff --git a/templates/my-own-nixpkgs/flake.nix b/templates/my-own-nixpkgs/flake.nix index 1afddda..caeded9 100644 --- a/templates/my-own-nixpkgs/flake.nix +++ b/templates/my-own-nixpkgs/flake.nix @@ -5,6 +5,7 @@ flake-parts.url = "github:hercules-ci/flake-parts"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; systems.url = "github:nix-systems/default"; + pkgs-by-name-for-flake-parts.url = "github:drupol/pkgs-by-name-for-flake-parts"; }; outputs = @@ -14,9 +15,9 @@ imports = [ inputs.flake-parts.flakeModules.easyOverlay + inputs.pkgs-by-name-for-flake-parts.flakeModule ./imports/overlay.nix ./imports/formatter.nix - ./imports/pkgs-by-name.nix ./imports/pkgs-all.nix ]; }; diff --git a/templates/my-own-nixpkgs/imports/formatter.nix b/templates/my-own-nixpkgs/imports/formatter.nix index 3793bca..9bd90c9 100644 --- a/templates/my-own-nixpkgs/imports/formatter.nix +++ b/templates/my-own-nixpkgs/imports/formatter.nix @@ -1,16 +1,8 @@ -{ inputs, ... }: +{ ... }: { perSystem = - { - config, - self', - inputs', - pkgs, - system, - lib, - ... - }: + { pkgs, ... }: { formatter = pkgs.nixfmt-rfc-style; }; diff --git a/templates/my-own-nixpkgs/imports/overlay.nix b/templates/my-own-nixpkgs/imports/overlay.nix index 0eff119..5e1d049 100644 --- a/templates/my-own-nixpkgs/imports/overlay.nix +++ b/templates/my-own-nixpkgs/imports/overlay.nix @@ -2,14 +2,7 @@ { perSystem = - { - config, - self', - inputs', - pkgs, - system, - ... - }: + { config, system, ... }: { _module.args.pkgs = import inputs.nixpkgs { inherit system; diff --git a/templates/my-own-nixpkgs/imports/pkgs-all.nix b/templates/my-own-nixpkgs/imports/pkgs-all.nix index 138c64f..5b16f84 100644 --- a/templates/my-own-nixpkgs/imports/pkgs-all.nix +++ b/templates/my-own-nixpkgs/imports/pkgs-all.nix @@ -1,15 +1,8 @@ -{ inputs, lib, ... }: +{ ... }: { perSystem = - { - config, - self', - inputs', - pkgs, - system, - ... - }: + { pkgs, ... }: { packages = { example2 = pkgs.callPackage ../pkgs/example2 { }; diff --git a/templates/my-own-nixpkgs/imports/pkgs-by-name.nix b/templates/my-own-nixpkgs/imports/pkgs-by-name.nix index db99256..490e67f 100644 --- a/templates/my-own-nixpkgs/imports/pkgs-by-name.nix +++ b/templates/my-own-nixpkgs/imports/pkgs-by-name.nix @@ -1,25 +1,9 @@ -{ inputs, lib, ... }: +{ ... }: { perSystem = + { ... }: { - config, - self', - inputs', - pkgs, - system, - ... - }: - { - packages = - let - scope = lib.makeScope pkgs.newScope (self: { - inherit inputs; - }); - in - lib.filesystem.packagesFromDirectoryRecursive { - inherit (scope) callPackage; - directory = ../pkgs/by-name; - }; + pkgsDirectory = ../pkgs/by-name; }; }