Merge pull request 'devos: include upstream commits' (#106) from feature/upstream-fixes into main
Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/106 Reviewed-by: hensoko <hensoko@noreply.example.org>
This commit is contained in:
commit
a0d0b62cf8
|
@ -8,6 +8,7 @@ channels: final: prev: {
|
||||||
discord
|
discord
|
||||||
element-desktop
|
element-desktop
|
||||||
rage
|
rage
|
||||||
|
nix-index
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
qutebrowser
|
qutebrowser
|
||||||
signal-desktop
|
signal-desktop
|
||||||
|
|
|
@ -1,12 +1,22 @@
|
||||||
{ pkgs, extraModulesPath, inputs, ... }:
|
{ pkgs, extraModulesPath, inputs, lib, ... }:
|
||||||
let
|
let
|
||||||
|
|
||||||
|
inherit (pkgs)
|
||||||
|
agenix
|
||||||
|
cachix
|
||||||
|
editorconfig-checker
|
||||||
|
mdbook
|
||||||
|
nixUnstable
|
||||||
|
nixpkgs-fmt
|
||||||
|
nvfetcher
|
||||||
|
;
|
||||||
|
|
||||||
hooks = import ./hooks;
|
hooks = import ./hooks;
|
||||||
|
|
||||||
pkgWithCategory = category: package: { inherit package category; };
|
pkgWithCategory = category: package: { inherit package category; };
|
||||||
|
devos = pkgWithCategory "devos";
|
||||||
linter = pkgWithCategory "linter";
|
linter = pkgWithCategory "linter";
|
||||||
docs = pkgWithCategory "docs";
|
docs = pkgWithCategory "docs";
|
||||||
devos = pkgWithCategory "devos";
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -44,15 +54,15 @@ in
|
||||||
}
|
}
|
||||||
(linter nixpkgs-fmt)
|
(linter nixpkgs-fmt)
|
||||||
(linter editorconfig-checker)
|
(linter editorconfig-checker)
|
||||||
# (docs python3Packages.grip) too many deps
|
|
||||||
(docs mdbook)
|
(docs mdbook)
|
||||||
|
]
|
||||||
|
++ lib.optionals (!pkgs.stdenv.buildPlatform.isi686) [
|
||||||
|
(devos cachix)
|
||||||
|
]
|
||||||
|
++ lib.optionals (pkgs.stdenv.hostPlatform.isLinux && !pkgs.stdenv.buildPlatform.isDarwin) [
|
||||||
|
(devos inputs.nixos-generators.defaultPackage.${pkgs.system})
|
||||||
(devos deploy-rs)
|
(devos deploy-rs)
|
||||||
]
|
]
|
||||||
++ lib.optional
|
|
||||||
(system != "i686-linux")
|
|
||||||
(devos cachix)
|
|
||||||
++ lib.optional
|
|
||||||
(system != "aarch64-darwin")
|
|
||||||
(devos inputs.nixos-generators.defaultPackage.${pkgs.system})
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,13 +14,16 @@ nix_files=($($diff -- '*.nix'))
|
||||||
all_files=($($diff))
|
all_files=($($diff))
|
||||||
|
|
||||||
# Format staged nix files.
|
# Format staged nix files.
|
||||||
if [[ -n "${nix_files[@]}" ]]; then
|
if (( ${#nix_files[@]} != 0 )); then
|
||||||
nixpkgs-fmt "${nix_files[@]}" \
|
nixpkgs-fmt "${nix_files[@]}" \
|
||||||
&& git add "${nix_files[@]}"
|
&& git add "${nix_files[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check editorconfig
|
# check editorconfig
|
||||||
editorconfig-checker -- "${all_files[@]}"
|
if (( ${#all_files[@]} != 0 )); then
|
||||||
|
editorconfig-checker -- "${all_files[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $? != '0' ]]; then
|
if [[ $? != '0' ]]; then
|
||||||
printf "%b\n" \
|
printf "%b\n" \
|
||||||
"\nCode is not aligned with .editorconfig" \
|
"\nCode is not aligned with .editorconfig" \
|
||||||
|
|
Loading…
Reference in a new issue