-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
27 lines (26 loc) · 975 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ sources ? import ./nix/sources.nix }:
let
pkgs = import sources.nixpkgs {
# Uncomment this to produce a working executable.
# overlays = [writePython3FixedOverlay];
};
writePython3FixedOverlay = self: super: {
writers = super.writers // {
writePython3 = name: { libraries ? [], flakeIgnore ? [] }:
let
py = super.python3.withPackages (ps: libraries);
ignoreAttribute = super.lib.optionalString (flakeIgnore != []) "--ignore ${super.lib.concatMapStringsSep "," super.lib.escapeShellArg flakeIgnore}";
in
super.writers.makeScriptWriter {
interpreter = "${self.coreutils}/bin/env ${py}/bin/python";
check = super.writers.writeDash "python3check.sh" ''
exec ${super.python3Packages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1"
'';
} name;
};
};
in
pkgs.writers.writePython3
"test_yaml"
{ libraries = [ pkgs.python3Packages.pyyaml ]; }
./script.py