mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2025-09-06 03:21:40 +02:00
installed and ran alejandra as formatter
This commit is contained in:
parent
49452e89db
commit
8a1314b58f
47 changed files with 1362 additions and 1113 deletions
|
@ -1,47 +1,54 @@
|
|||
{ pkgs, lib }: rec {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
}: rec {
|
||||
# taken from https://github.com/NixOS/nixpkgs/blob/3650808d85dccbfa3be3d785dfd3ce33a757bd2c/pkgs/build-support/trivial-builders/default.nix#L335
|
||||
writeNuShellApplication =
|
||||
{ name
|
||||
, text
|
||||
, runtimeInputs ? [ ]
|
||||
, meta ? { }
|
||||
, checkPhase ? null
|
||||
}:
|
||||
writeNuShellApplication = {
|
||||
name,
|
||||
text,
|
||||
runtimeInputs ? [],
|
||||
meta ? {},
|
||||
checkPhase ? null,
|
||||
}:
|
||||
writeTextFile {
|
||||
inherit name meta;
|
||||
executable = true;
|
||||
destination = "/bin/${name}";
|
||||
allowSubstitutes = true;
|
||||
preferLocalBuild = false;
|
||||
text = ''
|
||||
#!${pkgs.nushell}
|
||||
'' + lib.optionalString (runtimeInputs != [ ]) ''
|
||||
text =
|
||||
''
|
||||
#!${pkgs.nushell}
|
||||
''
|
||||
+ lib.optionalString (runtimeInputs != []) ''
|
||||
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend '${lib.makeBinPath runtimeInputs}');
|
||||
'' + ''
|
||||
$env.PATH = ($env.PATH | split row (char esep) | prepend '${lib.makeBinPath runtimeInputs}');
|
||||
''
|
||||
+ ''
|
||||
|
||||
${text}
|
||||
'';
|
||||
${text}
|
||||
'';
|
||||
|
||||
checkPhase =
|
||||
# GHC (=> shellcheck) isn't supported on some platforms (such as risc-v)
|
||||
# but we still want to use writeShellApplication on those platforms
|
||||
if checkPhase == null then ''
|
||||
if checkPhase == null
|
||||
then ''
|
||||
runHook preCheck
|
||||
|
||||
nu -c "nu-check -d $target"
|
||||
|
||||
|
||||
runHook postCheck
|
||||
''
|
||||
else checkPhase;
|
||||
};
|
||||
packageNushellApplication =
|
||||
{ name
|
||||
, path
|
||||
, runtimeInputs ? [ ]
|
||||
, meta ? { }
|
||||
, checkPhase ? null
|
||||
}:
|
||||
packageNushellApplication = {
|
||||
name,
|
||||
path,
|
||||
runtimeInputs ? [],
|
||||
meta ? {},
|
||||
checkPhase ? null,
|
||||
}:
|
||||
writeNuShellApplication {
|
||||
inherit name runtimeInputs meta checkPhase;
|
||||
text = builtins.readFile path;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue