File tree Expand file tree Collapse file tree 4 files changed +10
-26
lines changed
Expand file tree Collapse file tree 4 files changed +10
-26
lines changed Original file line number Diff line number Diff line change 2727 TEMP_DIR=$(mktemp -d)
2828 cd $TEMP_DIR
2929 nix flake init -t $FLAKE
30- nix develop -c , fmt
30+ nix develop --override-input mission-control path:${FLAKE} - c , fmt
3131 - name : Flake checks 🧪
3232 run : |
3333 # Because 'nix flake check' is not system-aware
Original file line number Diff line number Diff line change 1616 mission-control . scripts = {
1717 hello = {
1818 description = "Say Hello" ;
19- command = "echo Hello" ;
19+ exec = "echo Hello" ;
2020 } ;
2121 fmt = {
2222 description = "Format the top-level Nix files" ;
23- command = "${ lib . getExe pkgs . nixpkgs-fmt } ./*.nix" ;
23+ exec = "${ lib . getExe pkgs . nixpkgs-fmt } ./*.nix" ;
2424 category = "Tools" ;
2525 } ;
2626 ponysay = {
27- package = pkgs . ponysay ;
27+ exec = pkgs . ponysay ;
2828 } ;
2929 } ;
3030 devShells . default =
Original file line number Diff line number Diff line change 2929 '' ;
3030 default = "Commands" ;
3131 } ;
32- # The following are enum options
33- command = mkOption {
34- type = types . nullOr types . str ;
35- description = lib . mdDoc ''
36- The command or script to run
37-
38- When setting this option, the 'package' option must not also be set.
39- '' ;
40- default = null ;
41- } ;
42- package = mkOption {
43- type = types . nullOr types . package ;
32+ exec = mkOption {
33+ type = types . oneOf [ types . str types . package ] ;
4434 description = lib . mdDoc ''
45- The Nix package to run as the script.
46-
47- When setting this option, the 'command' option must not also be set.
35+ The script or package to run
4836 '' ;
49- default = null ;
5037 } ;
5138 } ;
5239 } ;
Original file line number Diff line number Diff line change 44 mkCommand = name : v :
55 let
66 drv =
7- if v . package == null
8- then pkgs . writeShellApplication { inherit name ; text = v . command ; }
9- else
10- if v . command == null
11- then v . package
12- else builtins . throw "misson-control.scripts.${ name } : Both 'package' and 'command' options are set. You must set exactly one of them." ;
7+ if builtins . typeOf v . exec == "string"
8+ then pkgs . writeShellApplication { inherit name ; text = v . exec ; }
9+ else v . exec ;
1310 in
1411 drv . overrideAttrs ( oa : {
1512 meta . description =
You can’t perform that action at this time.
0 commit comments