-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(templates): use mkShell & pass inputs to shell.nix
- Loading branch information
1 parent
1391456
commit c478421
Showing
14 changed files
with
116 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
_: _: { | ||
_: prev: { | ||
# https://github.com/NixOS/nixpkgs/pull/371815 | ||
matrix-synapse-unwrapped = prev.matrix-synapse-unwrapped.overrideAttrs (oa: { | ||
patches = [ | ||
(prev.fetchpatch2 { | ||
url = "https://github.com/element-hq/synapse/commit/3eb92369ca14012a07da2fbf9250e66f66afb710.patch"; | ||
sha256 = "sha256-VDn3kQy23+QC2WKhWfe0FrUOnLuI1YwH5GxdTTVWt+A="; | ||
}) | ||
]; | ||
|
||
postPatch = | ||
oa.postPatch or "" | ||
+ '' | ||
substituteInPlace tests/storage/databases/main/test_events_worker.py \ | ||
--replace-fail "def test_recovery" "def no_test_recovery" | ||
''; | ||
|
||
nativeCheckInputs = builtins.filter (p: !p.meta.broken) oa.nativeCheckInputs; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
{ | ||
stdenv, | ||
mkShellNoCC, | ||
|
||
# extra tooling | ||
libcxx, | ||
gnumake, | ||
cppcheck, | ||
clang-tools, | ||
callPackage, | ||
|
||
inputs, # our inputs | ||
self ? inputs.self, | ||
}: | ||
let | ||
mainPkg = callPackage ./default.nix { }; | ||
in | ||
mainPkg.overrideAttrs (oa: { | ||
nativeBuildInputs = [ | ||
mkShellNoCC { | ||
inputsFrom = [ self.packages.${stdenv.hostPlatform.system}.default ]; | ||
|
||
packages = [ | ||
libcxx # stdlib for cpp | ||
gnumake # builder | ||
cppcheck # static analysis | ||
clang-tools # fix headers not found | ||
] ++ (oa.nativeBuildInputs or [ ]); | ||
}) | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
{ | ||
stdenv, | ||
mkShellNoCC, | ||
|
||
# extra tooling | ||
go, | ||
gopls, | ||
goreleaser, | ||
callPackage, | ||
|
||
inputs, # our inputs | ||
self ? inputs.self, | ||
}: | ||
let | ||
mainPkg = callPackage ./default.nix { }; | ||
in | ||
mainPkg.overrideAttrs (oa: { | ||
nativeBuildInputs = [ | ||
mkShellNoCC { | ||
inputsFrom = [ self.packages.${stdenv.hostPlatform.system}.default ]; | ||
|
||
packages = [ | ||
go | ||
gopls | ||
goreleaser | ||
] ++ (oa.nativeBuildInputs or [ ]); | ||
}) | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
{ | ||
eza, | ||
callPackage, | ||
stdenv, | ||
mkShellNoCC, | ||
|
||
inputs, # our inputs | ||
self ? inputs.self, | ||
}: | ||
let | ||
mainPkg = callPackage ./default.nix { }; | ||
in | ||
mainPkg.overrideAttrs (oa: { | ||
nativeBuildInputs = [ eza ] ++ (oa.nativeBuildInputs or [ ]); | ||
}) | ||
mkShellNoCC { | ||
inputsFrom = [ self.packages.${stdenv.hostPlatform.system}.default ]; | ||
|
||
packages = [ ]; | ||
|
||
shellHook = '' | ||
echo "Hello, world!" | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
{ | ||
stdenv, | ||
mkShellNoCC, | ||
|
||
# extra tooling | ||
eslint_d, | ||
prettierd, | ||
callPackage, | ||
writeShellScriptBin, | ||
typescript, | ||
|
||
inputs, # our inputs | ||
self ? inputs.self, | ||
}: | ||
let | ||
mainPkg = callPackage ./default.nix { }; | ||
mkNpxAlias = name: writeShellScriptBin name "npx ${name} \"$@\""; | ||
in | ||
mainPkg.overrideAttrs (oa: { | ||
nativeBuildInputs = [ | ||
mkShellNoCC { | ||
inputsFrom = [ self.packages.${stdenv.hostPlatform.system}.default ]; | ||
|
||
packages = [ | ||
eslint_d | ||
prettierd | ||
(mkNpxAlias "tsc") | ||
(mkNpxAlias "tsserver") | ||
] ++ (oa.nativeBuildInputs or [ ]); | ||
typescript | ||
]; | ||
|
||
shellHook = '' | ||
eslint_d start # start eslint daemon | ||
eslint_d status # inform user about eslint daemon status | ||
''; | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
{ | ||
stdenv, | ||
mkShell, | ||
|
||
# extra tooling | ||
clippy, | ||
rustfmt, | ||
callPackage, | ||
rust-analyzer, | ||
|
||
inputs, # our inputs | ||
self ? inputs.self, | ||
}: | ||
let | ||
mainPkg = callPackage ./default.nix { }; | ||
in | ||
mainPkg.overrideAttrs (oa: { | ||
nativeBuildInputs = [ | ||
# Additional rust tooling | ||
mkShell { | ||
inputsFrom = [ self.packages.${stdenv.hostPlatform.system}.default ]; | ||
|
||
packages = [ | ||
clippy | ||
rustfmt | ||
rust-analyzer | ||
] ++ (oa.nativeBuildInputs or [ ]); | ||
}) | ||
]; | ||
} |