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 27
27
TEMP_DIR=$(mktemp -d)
28
28
cd $TEMP_DIR
29
29
nix flake init -t $FLAKE
30
- nix develop -c , fmt
30
+ nix develop --override-input mission-control path:${FLAKE} - c , fmt
31
31
- name : Flake checks 🧪
32
32
run : |
33
33
# Because 'nix flake check' is not system-aware
Original file line number Diff line number Diff line change 16
16
mission-control . scripts = {
17
17
hello = {
18
18
description = "Say Hello" ;
19
- command = "echo Hello" ;
19
+ exec = "echo Hello" ;
20
20
} ;
21
21
fmt = {
22
22
description = "Format the top-level Nix files" ;
23
- command = "${ lib . getExe pkgs . nixpkgs-fmt } ./*.nix" ;
23
+ exec = "${ lib . getExe pkgs . nixpkgs-fmt } ./*.nix" ;
24
24
category = "Tools" ;
25
25
} ;
26
26
ponysay = {
27
- package = pkgs . ponysay ;
27
+ exec = pkgs . ponysay ;
28
28
} ;
29
29
} ;
30
30
devShells . default =
Original file line number Diff line number Diff line change 29
29
'' ;
30
30
default = "Commands" ;
31
31
} ;
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 ] ;
44
34
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
48
36
'' ;
49
- default = null ;
50
37
} ;
51
38
} ;
52
39
} ;
Original file line number Diff line number Diff line change 4
4
mkCommand = name : v :
5
5
let
6
6
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 ;
13
10
in
14
11
drv . overrideAttrs ( oa : {
15
12
meta . description =
You can’t perform that action at this time.
0 commit comments