diff options
| author | seth <[email protected]> | 2023-06-27 03:31:06 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-06-27 03:31:06 -0400 |
| commit | db9da46064baf8992a6ba7d21e999993e7c279a5 (patch) | |
| tree | d131a2940acaecb2bafc24ace33111775356946e /templates/basic/flake.nix | |
| parent | 86671bb299747b87981559ed48cf631d4e227421 (diff) | |
templates: add forEachSystem to basic
Diffstat (limited to 'templates/basic/flake.nix')
| -rw-r--r-- | templates/basic/flake.nix | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/templates/basic/flake.nix b/templates/basic/flake.nix index 2c638b2..00ec696 100644 --- a/templates/basic/flake.nix +++ b/templates/basic/flake.nix @@ -26,23 +26,42 @@ overlays = [self.overlays.default]; }); - packageFn = pkgs: let - inherit (pkgs.lib) licenses maintainers platforms; + forEachSystem = fn: + forAllSystems (system: + fn { + inherit system; + pkgs = nixpkgsFor.${system}; + }); + in { + devShells = forEachSystem ({pkgs, ...}: let + inherit (pkgs) mkShell; in { - hello = pkgs.stdenv.mkDerivation rec { + default = mkShell { + packages = with pkgs; [ + bash + ]; + }; + }); + + formatter = forEachSystem ({pkgs, ...}: pkgs.alejandra); + + packages = forEachSystem ({pkgs, ...}: { + inherit (pkgs) hello; + default = pkgs.hello; + }); + + overlays.default = _: prev: { + hello = prev.stdenv.mkDerivation { pname = "hello"; inherit version; - src = builtins.path { - name = "${pname}-src"; - path = ./.; - }; + src = self; installPhase = '' echo "hi" > $out ''; - meta = { + meta = with prev.lib; { description = ""; homepage = ""; license = licenses.mit; @@ -51,25 +70,5 @@ }; }; }; - in { - devShells = forAllSystems (s: let - pkgs = nixpkgsFor.${s}; - inherit (pkgs) mkShell; - in { - default = mkShell { - packages = with pkgs; [ - bash - ]; - }; - }); - - formatter = forAllSystems (s: nixpkgsFor.${s}.alejandra); - - packages = forAllSystems (s: rec { - inherit (nixpkgsFor.${s}) hello; - default = hello; - }); - - overlays.default = final: _: packageFn final; }; } |
