-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpackage.nix
48 lines (43 loc) · 1.09 KB
/
package.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
# Fallback shell to use
# Can be either a shell with a proper passthru.shellPath, or a path to a file
bashInteractive,
defaultShell ? bashInteractive,
#
stdenv,
cmake,
lib,
}: let
defaultShell' =
if lib.isDerivation defaultShell
then "${defaultShell}${defaultShell.passthru.shellPath}"
else defaultShell;
fs = lib.fileset;
r = ./.;
in
stdenv.mkDerivation {
name = "noshell";
src = fs.toSource {
root = r;
fileset = fs.intersection (lib.fileset.fromSource (lib.sources.cleanSource r)) (
lib.fileset.unions [
(fs.fileFilter (file: file.hasExt "c") r)
(fs.fileFilter (file: file.hasExt "txt") r)
(fs.fileFilter (file: file.hasExt "in") r)
]
);
};
nativeBuildInputs = [cmake];
cmakeFlags = [
"-DDEFAULT_SHELL=${defaultShell'}"
];
passthru = {
shellPath = "/bin/noshell";
};
meta = {
mainProgram = "noshell";
description = "User-configurable login shell";
homepage = "https://github.com/viperML/noshell";
license = lib.licenses.eupl12;
};
}