move devShells out of flake-parts #64

Merged
Mic92 merged 1 commits from flake-parts-refactoring into main 2023-08-03 14:19:36 +00:00
18 changed files with 76 additions and 136 deletions

View File

@ -1,9 +1,7 @@
{
perSystem =
{ inputs'
, lib
, pkgs
, self'
, ...
}: {
devShells.default = pkgs.mkShell {

View File

@ -1,24 +0,0 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.git
pkgs.openssh
]
''
bash ${./script.sh}
'';
in
{
packages.${name} = script;
};
}

View File

@ -1,25 +0,0 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.git
pkgs.tea
pkgs.openssh
]
''
bash ${./script.sh} "$@"
'';
in
{
packages.${name} = script;
};
}

View File

@ -1,23 +0,0 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.tea
]
''
bash ${./script.sh}
'';
in
{
packages.${name} = script;
};
}

View File

@ -1,27 +0,0 @@
{
perSystem =
{ config
, pkgs
, self'
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
self'.packages.action-checkout
self'.packages.action-ensure-tea-login
self'.packages.action-create-pr
self'.packages.action-flake-update
]
''
bash ${./script.sh}
'';
in
{
packages.${name} = script;
};
}

View File

@ -1,24 +0,0 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.git
pkgs.nix
]
''
bash ${./script.sh}
'';
in
{
packages.${name} = script;
};
}

View File

@ -32,7 +32,7 @@
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
flake-parts.lib.mkFlake { inherit inputs; } ({ ... }: {
systems = [
"x86_64-linux"
"aarch64-linux"
@ -40,12 +40,7 @@
imports = [
inputs.treefmt-nix.flakeModule
inputs.clan-core.modules.flake-parts.writers
./flake-parts/action-checkout
./flake-parts/action-create-pr
./flake-parts/action-ensure-tea-login
./flake-parts/action-flake-update
./flake-parts/action-flake-update-pr-clan
./flake-parts/devShells
./devShells/flake-module.nix
./flake-parts/job-flake-update-clan-core
./flake-parts/job-flake-update-clan-homepage
./flake-parts/job-flake-update-clan-infra
@ -54,7 +49,7 @@
./pkgs/flake-module.nix
./pkgs/clan-merge/flake-module.nix
];
perSystem = { pkgs, inputs', ... }: {
perSystem = { ... }: {
treefmt = {
projectRootFile = "flake.nix";
programs.terraform.enable = true;

View File

@ -0,0 +1,9 @@
{ bash
, coreutils
, git
, openssh
, writePureShellScriptBin
}:
writePureShellScriptBin "action-checkout" [ bash coreutils git openssh ] ''
bash ${./script.sh}
''

View File

@ -0,0 +1,10 @@
{ bash
, coreutils
, git
, tea
, openssh
, writePureShellScriptBin
}:
writePureShellScriptBin "action-create-pr" [ bash coreutils git tea openssh ] ''
bash ${./script.sh}
''

View File

@ -0,0 +1,8 @@
{ bash
, coreutils
, tea
, writePureShellScriptBin
}:
writePureShellScriptBin "action-ensure-tea-login" [ bash coreutils tea ] ''
bash ${./script.sh}
''

View File

@ -0,0 +1,18 @@
{ bash
, coreutils
, action-checkout
, action-ensure-tea-login
, action-create-pr
, action-flake-update
, writePureShellScriptBin
}:
writePureShellScriptBin "action-flake-update-pr-clan" [
bash
coreutils
action-checkout
action-ensure-tea-login
action-create-pr
action-flake-update
] ''
bash ${./script.sh}
''

View File

@ -0,0 +1,9 @@
{ bash
, coreutils
, git
, nix
, writePureShellScriptBin
}:
writePureShellScriptBin "action-flake-update" [ bash coreutils git nix ] ''
bash ${./script.sh}
''

View File

@ -1,9 +1,25 @@
{ lib, ... }: {
perSystem = { pkgs, inputs', ... }: {
{ ... }: {
perSystem = { pkgs, config, ... }: {
packages = {
inherit (pkgs.callPackage ./renovate { }) renovate;
} // lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
gitea = pkgs.callPackage ./gitea { };
action-checkout = pkgs.callPackage ./action-checkout {
inherit (config.writers) writePureShellScriptBin;
};
action-create-pr = pkgs.callPackage ./action-create-pr {
inherit (config.writers) writePureShellScriptBin;
};
action-ensure-tea-login = pkgs.callPackage ./action-ensure-tea-login {
inherit (config.writers) writePureShellScriptBin;
};
action-flake-update = pkgs.callPackage ./action-flake-update {
inherit (config.writers) writePureShellScriptBin;
};
action-flake-update-pr-clan = pkgs.callPackage ./action-flake-update-pr-clan {
inherit (config.writers) writePureShellScriptBin;
inherit (config.packages) action-checkout action-ensure-tea-login action-create-pr action-flake-update;
};
};
};
}