mirror of
https://github.com/nix-community/flakelight.git
synced 2025-06-21 10:07:51 +02:00
Nix now requires app programs to be paths in store
This commit is contained in:
parent
bac4759bcb
commit
3304eb3746
@ -683,9 +683,8 @@ Types:
|
|||||||
The `app` and `apps` options allow you to set `apps.${system}` outputs.
|
The `app` and `apps` options allow you to set `apps.${system}` outputs.
|
||||||
|
|
||||||
`apps` is an attribute set of apps or a function that takes packages and returns
|
`apps` is an attribute set of apps or a function that takes packages and returns
|
||||||
an attribute set of apps. If the app value is not an app, it is converted to a
|
an attribute set of apps. If the app value is a function, it is passed packages.
|
||||||
string and set as the program attr of an app. If it is a function, it is passed
|
If the app value or function result is a string, it is converted to an app.
|
||||||
packages.
|
|
||||||
|
|
||||||
`app` sets `apps.default`.
|
`app` sets `apps.default`.
|
||||||
|
|
||||||
@ -697,7 +696,6 @@ For example:
|
|||||||
outputs = { flakelight, ... }:
|
outputs = { flakelight, ... }:
|
||||||
flakelight ./. {
|
flakelight ./. {
|
||||||
apps = {
|
apps = {
|
||||||
shell = "/bin/sh";
|
|
||||||
emacs = pkgs: "${pkgs.emacs}/bin/emacs";
|
emacs = pkgs: "${pkgs.emacs}/bin/emacs";
|
||||||
bash = pkgs: { type = "app"; program = "${pkgs.bash}/bin/bash"; };
|
bash = pkgs: { type = "app"; program = "${pkgs.bash}/bin/bash"; };
|
||||||
};
|
};
|
||||||
@ -713,7 +711,6 @@ Alternatively, the above can be written as:
|
|||||||
outputs = { flakelight, ... }:
|
outputs = { flakelight, ... }:
|
||||||
flakelight ./. {
|
flakelight ./. {
|
||||||
apps = { emacs, bash, ... }: {
|
apps = { emacs, bash, ... }: {
|
||||||
shell = "/bin/sh";
|
|
||||||
emacs = "${emacs}/bin/emacs";
|
emacs = "${emacs}/bin/emacs";
|
||||||
bash = { type = "app"; program = "${bash}/bin/bash"; };
|
bash = { type = "app"; program = "${bash}/bin/bash"; };
|
||||||
};
|
};
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
{ config, lib, flakelight, genSystems, ... }:
|
{ config, lib, flakelight, genSystems, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) isStringLike mapAttrs mkIf mkMerge mkOption mkOptionType;
|
inherit (lib) isStringLike mapAttrs mkIf mkMerge mkOption mkOptionType;
|
||||||
inherit (lib.types) coercedTo lazyAttrsOf;
|
inherit (lib.types) coercedTo lazyAttrsOf pathInStore;
|
||||||
inherit (lib.options) mergeEqualOption;
|
inherit (lib.options) mergeEqualOption;
|
||||||
inherit (flakelight.types) nullable optFunctionTo;
|
inherit (flakelight.types) nullable optFunctionTo;
|
||||||
|
|
||||||
@ -13,7 +13,8 @@ let
|
|||||||
name = "app";
|
name = "app";
|
||||||
description = "flake app";
|
description = "flake app";
|
||||||
descriptionClass = "noun";
|
descriptionClass = "noun";
|
||||||
check = x: (x ? type) && (x.type == "app") && (x ? program);
|
check = x: (x ? type) && (x.type == "app") &&
|
||||||
|
(x ? program) && (pathInStore.check x.program);
|
||||||
merge = mergeEqualOption;
|
merge = mergeEqualOption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -466,11 +466,11 @@ in
|
|||||||
app-string = test
|
app-string = test
|
||||||
(flakelight ./empty {
|
(flakelight ./empty {
|
||||||
inputs = { inherit nixpkgs; };
|
inputs = { inherit nixpkgs; };
|
||||||
app = "/bin/sh";
|
app = "${nixpkgs.legacyPackages.x86_64-linux.hello}/bin/hello";
|
||||||
})
|
})
|
||||||
(f: (f.apps.x86_64-linux.default == {
|
(f: (f.apps.x86_64-linux.default == {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "/bin/sh";
|
program = "${nixpkgs.legacyPackages.x86_64-linux.hello}/bin/hello";
|
||||||
}));
|
}));
|
||||||
|
|
||||||
app-string-fn = test
|
app-string-fn = test
|
||||||
@ -487,16 +487,11 @@ in
|
|||||||
(flakelight ./empty {
|
(flakelight ./empty {
|
||||||
inputs = { inherit nixpkgs; };
|
inputs = { inherit nixpkgs; };
|
||||||
apps = {
|
apps = {
|
||||||
shell = "/bin/sh";
|
|
||||||
emacs = pkgs: "${pkgs.emacs}/bin/emacs";
|
emacs = pkgs: "${pkgs.emacs}/bin/emacs";
|
||||||
bash = pkgs: { type = "app"; program = "${pkgs.bash}/bin/bash"; };
|
bash = pkgs: { type = "app"; program = "${pkgs.bash}/bin/bash"; };
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(f: f.apps.x86_64-linux == {
|
(f: f.apps.x86_64-linux == {
|
||||||
shell = {
|
|
||||||
type = "app";
|
|
||||||
program = "/bin/sh";
|
|
||||||
};
|
|
||||||
emacs = {
|
emacs = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${nixpkgs.legacyPackages.x86_64-linux.emacs}/bin/emacs";
|
program = "${nixpkgs.legacyPackages.x86_64-linux.emacs}/bin/emacs";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user