-
Notifications
You must be signed in to change notification settings - Fork 39
/
system-path.nix
48 lines (45 loc) · 1.51 KB
/
system-path.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
{ config, lib, pkgs, ... }:
# based heavily on https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/system-path.nix
# crosser = if pkgs.stdenv ? cross then (x: if x ? crossDrv then x.crossDrv else x) else (x: x);
with lib;
let
requiredPackages = with pkgs; [ utillinux coreutils iproute iputils procps bashInteractive runit ];
in
{
options = {
environment = {
systemPackages = mkOption {
type = types.listOf types.package;
default = [];
example = literalExample "[ pkgs.firefox pkgs.thunderbird ]";
};
pathsToLink = mkOption {
type = types.listOf types.str;
default = [];
example = ["/"];
description = "List of directories to be symlinked in <filename>/run/current-system/sw</filename>.";
};
extraOutputsToInstall = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "doc" "info" "docdev" ];
description = "List of additional package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
};
};
system.path = mkOption {
internal = true;
};
};
config = {
environment.systemPackages = requiredPackages;
environment.pathsToLink = [ "/bin" ];
system.path = pkgs.buildEnv {
name = "system-path";
paths = config.environment.systemPackages;
inherit (config.environment) pathsToLink extraOutputsToInstall;
postBuild = ''
# TODO, any system level caches that need to regenerate
'';
};
};
}