Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devshell: add gigthub section #4

Open
wants to merge 54 commits into
base: da/devhsell-githooks
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
061c913
nixos/redis: enable sandbox mode
Izorkin Apr 3, 2021
e075aeb
nixos/redis: add option maxclients
Izorkin Apr 12, 2021
6426d1e
maintainers: add dasisdormax
dasisdormax Apr 14, 2021
d307dad
oauth2_proxy: rename to oauth2-proxy
yorickvP Apr 18, 2021
279c7d4
nixos/oauth2_proxy: fix package name in nixos module
yorickvP Apr 18, 2021
d94462e
astc-encoder: init at 2.5
dasisdormax Apr 20, 2021
03ea3ba
modules.matrix-appservice-irc: allow connecting to unix sockets
expipiplus1 Apr 20, 2021
388c018
mpvScripts.mpv-playlistmanager: init at c15a033 (09-03-2021)
lunik1 Apr 19, 2021
4954e63
libretro: add thepowdertoy core
lunik1 Apr 20, 2021
29bb1cf
vimPlugins.vim-dispatch-neovim: init at 2017-01-18
Apr 19, 2021
ac8fc5f
vimPlugins.vim-jack-in: init at 2021-03-27
KyleOndy Apr 19, 2021
b4a87f0
wemux: init at 2021-04-16
bsima Apr 19, 2021
59a672e
vimPlugins: update
Apr 20, 2021
1369207
vimPlugins.rnvimr: init at 2020-10-02
Apr 20, 2021
753f073
vimPlugins.vimade: init at 2021-04-07
Apr 20, 2021
17de5c3
Merge pull request #119964 from jb55/wemux
SuperSandro2000 Apr 20, 2021
c6d9a0b
devshell: add (tiny) but useful pre-commit hook
Apr 20, 2021
db9ee72
Merge branch 'master' into da/devhsell
Apr 20, 2021
cebfeed
Merge branch 'da/devhsell' into da/devhsell-githooks
Apr 20, 2021
4725fcc
Merge pull request #119969 from lofsigma/add-vim-plugins
SuperSandro2000 Apr 20, 2021
6a5576e
Merge pull request #119798 from yorickvP/mv-oauth2_proxy
SuperSandro2000 Apr 20, 2021
b3e22b9
python3Packages.adafruit-platformdetect: 3.5.0 -> 3.6.0
fabaff Apr 20, 2021
165d4ec
python3Packages.minidump: 0.0.16 -> 0.0.17
fabaff Apr 20, 2021
cac2f95
python3Packages.minikerberos: 0.2.9 -> 0.2.11
fabaff Apr 20, 2021
84471cd
crun: 0.19 -> 0.19.1
saschagrunert Apr 20, 2021
0540805
linuxPackages.oci-seccomp-bpf-hook: 1.2.1 -> 1.2.2
saschagrunert Apr 20, 2021
a8e7d96
Merge pull request #118961 from Izorkin/update-redis-sandbox
Mic92 Apr 20, 2021
20e0c6d
configuration template: add hint to install editor (#105771)
Mic92 Apr 20, 2021
f86b57d
Include custom package in vim docs (#92811)
a-h Apr 20, 2021
b3491ec
python3Packages.aiosmb: 0.2.37 -> 0.2.41
fabaff Apr 20, 2021
e03850e
Merge pull request #119898 from lunik1/mpv-playlistmanager
SuperSandro2000 Apr 20, 2021
00fe267
gh: 1.9.1 -> 1.9.2
zowoq Apr 20, 2021
8c4eadf
Merge pull request #119018 from dasisdormax/add-astc-encoder
SuperSandro2000 Apr 20, 2021
813446b
Merge pull request #119900 from KyleOndy/add-vim-jack-in
SuperSandro2000 Apr 20, 2021
41ecbc0
Merge pull request #119919 from lunik1/libretro-powdertoy
SuperSandro2000 Apr 20, 2021
609d9cb
Merge pull request #119901 from KyleOndy/add-vim-dispatch-neovim
SuperSandro2000 Apr 20, 2021
c6cb6a7
linode-cli: enable/add test; add bash auto-completion
superherointj Apr 20, 2021
3346f49
python3Packages.pypykatz: 0.4.7 -> 0.5.0
fabaff Apr 20, 2021
c8f64dc
python3Packages.msldap: 0.3.28 -> 0.3.29
fabaff Apr 20, 2021
14b5ddf
haxe_4_1,haxe_4_2: fix build on Darwin
OPNA2608 Apr 20, 2021
8716479
python3Packages.msldap: 0.3.28 -> 0.3.29
fabaff Apr 20, 2021
231dae3
Update devshell.toml
Apr 20, 2021
8ee65ae
Update devshell.toml
Apr 20, 2021
974f9a1
Update devshell.toml
Apr 20, 2021
dacb7e5
Update devshell.toml
Apr 20, 2021
41aba2c
Merge pull request #119954 from superherointj/package-linode-cli-auto…
SuperSandro2000 Apr 20, 2021
35057bf
Merge pull request #119982 from fabaff/bump-pypykatz
SuperSandro2000 Apr 20, 2021
ac50770
Merge pull request #119975 from fabaff/bump-adafruit-platformdetect
mweinelt Apr 20, 2021
1c4f6dd
Merge pull request #119929 from expipiplus1/patch-3
mweinelt Apr 20, 2021
ae79547
asterisk: 13.38.0 -> 13.38.2, 16.15.0 -> 16.17.0, 17.9.0 -> 17.9.3, 1…
yorickvP Apr 18, 2021
4f8cfd1
asterisk: clarify license
yorickvP Apr 18, 2021
d1d681d
Merge branch 'master' into da/devhsell
Apr 20, 2021
2ce6b50
Merge branch 'da/devhsell' into da/devhsell-githooks
Apr 20, 2021
3f26313
devshell: add gigthub section
Apr 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions devshell.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,45 @@
imports = [ "git.hooks" ]

[devshell]
name = "nixpkgs"
packages = [
"fd",
"nixpkgs-fmt",
"editorconfig-checker",
]

[[commands]]
package = "editorconfig-checker"
category = "linters"

[[commands]]
package = "gitAndTools.gh"
category = "github"

[[commands]]
name = "bugs"
help = "List issues labeled as bugs"
category = "github"
command = "gh issue list --label=\"0.kind: bug\""

[[commands]]
name = "packaging-requests"
help = "List issues labeled as packaging requests (chill out work)"
category = "github"
command = "gh issue list --label=\"0.kind: packaging request\""

[[commands]]
name = "pr-status"
help = "Information about relevant PRs"
category = "github"
command = "gh pr status"

[[commands]]
name = "issue-status"
help = "Information about relevant issues"
category = "github"
command = "gh issue status"

[[commands]]
name = "fmt"
help = "Check Nix formatting"
Expand All @@ -17,3 +52,34 @@ help = "Check Nix parsing"
category = "folder tree checks"
command = "fd --extension nix --exec nix-instantiate --parse --quiet {} >/dev/null"

[git.hooks]
enable = true
pre-commit.text = """
#!/usr/bin/env bash
set -eou pipefail
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(${git}/bin/git hash-object -t tree /dev/null)
fi

diff="git diff-index --name-only --cached $against --diff-filter d"

nix_files=($($diff -- '*.nix'))
all_files=($($diff))

# Format staged nix files.
if [[ -n "${nix_files[@]}" ]]; then
nixpkgs-fmt "${nix_files[@]}"
git add "${nix_files[@]}"
fi

# check editorconfig
if ! editorconfig-checker -- "${all_files[@]}"; then
echo -e "\nCode is not aligned with .editorconfig
Review the output and commit your fixes" >&2
exit 1
fi
"""
38 changes: 38 additions & 0 deletions doc/languages-frameworks/vim.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,44 @@ The resulting package can be added to `packageOverrides` in `~/.nixpkgs/config.n

After that you can install your special grafted `myVim` or `myNeovim` packages.

### What if your favourite Vim plugin isn't already packaged?

If one of your favourite plugins isn't packaged, you can package it yourself:

```
{ config, pkgs, ... }:

let
easygrep = pkgs.vimUtils.buildVimPlugin {
name = "vim-easygrep";
src = pkgs.fetchFromGitHub {
owner = "dkprice";
repo = "vim-easygrep";
rev = "d0c36a77cc63c22648e792796b1815b44164653a";
sha256 = "0y2p5mz0d5fhg6n68lhfhl8p4mlwkb82q337c22djs4w5zyzggbc";
};
};
in
{
environment.systemPackages = [
(
pkgs.neovim.override {
configure = {
packages.myPlugins = with pkgs.vimPlugins; {
start = [
vim-go # already packaged plugin
easygrep # custom package
];
opt = [];
};
# ...
};
}
)
];
}
```

## Managing plugins with vim-plug

To use [vim-plug](https://github.com/junegunn/vim-plug) to manage your Vim
Expand Down
10 changes: 10 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,16 @@
githubId = 4971975;
name = "Janne Heß";
};
dasisdormax = {
email = "[email protected]";
github = "dasisdormax";
githubId = 3714905;
keys = [{
longkeyid = "rsa4096/0x02BA0D4480CA6C44";
fingerprint = "E59B A198 61B0 A9ED C1FA 3FB2 02BA 0D44 80CA 6C44";
}];
name = "Maximilian Wende";
};
dasj19 = {
email = "[email protected]";
github = "dasj19";
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/installer/tools/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ in
# List packages installed in system profile. To search, run:
# \$ nix search wget
# environment.systemPackages = with pkgs; [
# wget vim
# nano vim # don't forget to add an editor to edit configuration.nix!
# wget
# firefox
# ];

Expand Down
41 changes: 39 additions & 2 deletions nixos/modules/services/databases/redis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ with lib;
let
cfg = config.services.redis;

ulimitNofile = cfg.maxclients + 32;

mkValueString = value:
if value == true then "yes"
else if value == false then "no"
Expand All @@ -14,8 +16,8 @@ let
listsAsDuplicateKeys = true;
mkKeyValue = generators.mkKeyValueDefault { inherit mkValueString; } " ";
} cfg.settings);
in
{

in {
imports = [
(mkRemovedOptionModule [ "services" "redis" "user" ] "The redis module now is hardcoded to the redis user.")
(mkRemovedOptionModule [ "services" "redis" "dbpath" ] "The redis module now uses /var/lib/redis as data directory.")
Expand Down Expand Up @@ -121,6 +123,12 @@ in
description = "Set the number of databases.";
};

maxclients = mkOption {
type = types.int;
default = 10000;
description = "Set the max number of connected clients at the same time.";
};

save = mkOption {
type = with types; listOf (listOf int);
default = [ [900 1] [300 10] [60 10000] ];
Expand Down Expand Up @@ -253,6 +261,7 @@ in
logfile = cfg.logfile;
syslog-enabled = cfg.syslog;
databases = cfg.databases;
maxclients = cfg.maxclients;
save = map (d: "${toString (builtins.elemAt d 0)} ${toString (builtins.elemAt d 1)}") cfg.save;
dbfilename = "dump.rdb";
dir = "/var/lib/redis";
Expand Down Expand Up @@ -295,6 +304,34 @@ in
StateDirectoryMode = "0700";
# Access write directories
UMask = "0077";
# Capabilities
CapabilityBoundingSet = "";
# Security
NoNewPrivileges = true;
# Process Properties
LimitNOFILE = "${toString ulimitNofile}";
# Sandboxing
ProtectSystem = "strict";
ProtectHome = true;
PrivateTmp = true;
PrivateDevices = true;
PrivateUsers = true;
ProtectClock = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectControlGroups = true;
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
LockPersonality = true;
MemoryDenyWriteExecute = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
PrivateMounts = true;
# System Call Filtering
SystemCallArchitectures = "native";
SystemCallFilter = "~@clock @cpu-emulation @debug @keyring @memlock @module @mount @obsolete @privileged @raw-io @reboot @resources @setuid @swap";
};
};
};
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/services/misc/matrix-appservice-irc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ in {
PrivateMounts = true;
SystemCallFilter = "~@aio @clock @cpu-emulation @debug @keyring @memlock @module @mount @obsolete @raw-io @setuid @swap";
SystemCallArchitectures = "native";
RestrictAddressFamilies = "AF_INET AF_INET6";
# AF_UNIX is required to connect to a postgres socket.
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
};
};

Expand Down
6 changes: 3 additions & 3 deletions nixos/modules/services/security/oauth2_proxy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ in

package = mkOption {
type = types.package;
default = pkgs.oauth2_proxy;
defaultText = "pkgs.oauth2_proxy";
default = pkgs.oauth2-proxy;
defaultText = "pkgs.oauth2-proxy";
description = ''
The package that provides oauth2_proxy.
The package that provides oauth2-proxy.
'';
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

buildGoModule rec {
pname = "gh";
version = "1.9.1";
version = "1.9.2";

src = fetchFromGitHub {
owner = "cli";
repo = "cli";
rev = "v${version}";
sha256 = "1nrbz049nizrrfxdpws05gj0bqk47l4mrl4wcvfb6nwispc74ib0";
sha256 = "0lx6sx3zkjq9855va1vxbd5g47viqkrchk5d2rb6xj7zywwm4mgb";
};

vendorSha256 = "0j2jy7n7hca5ybwwgh7cvm77j96ngaq1a1l5bl70vjpd8hz2qapc";
vendorSha256 = "1zmyd566xcksgqm0f7mq0rkfnxk0fmf39k13fcp9jy30c1y9681v";

nativeBuildInputs = [ installShellFiles ];

Expand Down
37 changes: 37 additions & 0 deletions pkgs/applications/video/mpv/scripts/mpv-playlistmanager.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ lib, stdenvNoCC, fetchFromGitHub, youtube-dl }:

stdenvNoCC.mkDerivation rec {
pname = "mpv-playlistmanager";
version = "unstable-2021-03-09";

src = fetchFromGitHub {
owner = "jonniek";
repo = "mpv-playlistmanager";
rev = "c15a0334cf6d4581882fa31ddb1e6e7f2d937a3e";
sha256 = "uxcvgcSGS61UU8MmuD6qMRqpIa53iasH/vkg1xY7MVc=";
};

postPatch = ''
substituteInPlace playlistmanager.lua \
--replace "'youtube-dl'" "'${youtube-dl}/bin/youtube-dl'" \
'';

dontBuild = true;

installPhase = ''
runHook preInstall
mkdir -p $out/share/mpv/scripts
cp playlistmanager.lua $out/share/mpv/scripts
runHook postInstall
'';

passthru.scriptName = "playlistmanager.lua";

meta = with lib; {
description = "Mpv lua script to create and manage playlists";
homepage = "https://github.com/jonniek/mpv-playlistmanager";
license = licenses.unlicense;
platforms = platforms.all;
maintainers = with maintainers; [ lunik1 ];
};
}
4 changes: 2 additions & 2 deletions pkgs/applications/virtualization/crun/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ let
in
stdenv.mkDerivation rec {
pname = "crun";
version = "0.19";
version = "0.19.1";

src = fetchFromGitHub {
owner = "containers";
repo = pname;
rev = version;
sha256 = "sha256-G9asWedX03cP5Qg5HIzlSIwwqNL16kiyWairk+6Kabw=";
sha256 = "sha256-v5uESTEspIc8rhZXrQqLEVMDvvPcfHuFoj6lI4M5z70=";
fetchSubmodules = true;
};

Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/compilers/haxe/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, coreutils, ocaml-ng, zlib, pcre, neko, mbedtls }:
{ lib, stdenv, fetchFromGitHub, coreutils, ocaml-ng, zlib, pcre, neko, mbedtls, Security }:

let
ocamlDependencies = version:
Expand Down Expand Up @@ -31,7 +31,8 @@ let
inherit version;

buildInputs = [ zlib pcre neko ]
++ lib.optional (lib.versionAtLeast version "4.1") [ mbedtls ]
++ lib.optional (lib.versionAtLeast version "4.1") mbedtls
++ lib.optional (lib.versionAtLeast version "4.1" && stdenv.isDarwin) Security
++ ocamlDependencies version;

src = fetchFromGitHub {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

buildPythonPackage rec {
pname = "adafruit-platformdetect";
version = "3.5.0";
version = "3.6.0";

src = fetchPypi {
pname = "Adafruit-PlatformDetect";
inherit version;
sha256 = "sha256-QJeb9+iiS4QZ7poOBp5oKD5KuagkG6cfTalbNRwrI1M=";
sha256 = "sha256-096bMTAh5d2wikrmlDcUspD9GYZlPHbdDcf/e/BLAHI=";
};

nativeBuildInputs = [ setuptools-scm ];
Expand Down
12 changes: 7 additions & 5 deletions pkgs/development/python-modules/aiosmb/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, asysocks
, buildPythonPackage
, colorama
, fetchPypi
, minikerberos
, prompt_toolkit
Expand All @@ -13,22 +14,23 @@

buildPythonPackage rec {
pname = "aiosmb";
version = "0.2.37";
version = "0.2.41";
disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
sha256 = "0daf1fk7406vpywc0yxv0wzf4nw986js9lc2agfyfxz0q7s29lf0";
sha256 = "sha256-hiLLoFswh0rm5f5TsaX+zyRDkOIyzGXVO0M5J5d/gtQ=";
};

propagatedBuildInputs = [
asysocks
colorama
minikerberos
winsspi
prompt_toolkit
six
asysocks
tqdm
prompt_toolkit
winacl
winsspi
];

# Project doesn't have tests
Expand Down
Loading