Skip to content

Instantly share code, notes, and snippets.

@ixxie
Last active June 28, 2017 20:00
Show Gist options
  • Save ixxie/ebd63959f2e9e6bad67ff7a3f2d4cf3d to your computer and use it in GitHub Desktop.
Save ixxie/ebd63959f2e9e6bad67ff7a3f2d4cf3d to your computer and use it in GitHub Desktop.
Streaming git repos into NixOS
error: while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-system-meso-17.03.1395.9b948ea439’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpk
gs/nixos/modules/system/activation/top-level.nix:107:7:
while evaluating the attribute ‘sources’ of the derivation ‘etc’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/etc/etc.nix:12:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute ‘source’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:75:45, called from /nix/var/nix/profiles/per-user/root/cha
nnels/nixos/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:300:9:
while evaluating the option `environment.etc.systemd/system.source':
while evaluating the attribute ‘mergedValue’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:327:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:327:32, called from /nix/var/nix/profiles/per-user/root/ch
annels/nixos/nixpkgs/lib/modules.nix:327:19:
while evaluating ‘check’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:168:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/
nixpkgs/lib/modules.nix:328:10:
while evaluating the attribute ‘buildCommand’ of the derivation ‘system-units’ at /nix/store/18bnvwv4cywkydrljzygcjxgz71vbr1c-nixos-17.03.1395.9b948ea439/nixos/pkgs/build-s
upport/trivial-builders.nix:7:14:
while evaluating the attribute ‘text’ of the derivation ‘unit-dbus.service’ at /nix/store/18bnvwv4cywkydrljzygcjxgz71vbr1c-nixos-17.03.1395.9b948ea439/nixos/pkgs/build-supp
ort/trivial-builders.nix:7:14:
while evaluating the attribute ‘text’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:75:45, called from /nix/var/nix/profiles/per-user/root/cha
nnels/nixos/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:300:9:
while evaluating the option `systemd.units.dbus.service.text':
while evaluating the attribute ‘isDefined’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:332:5:
hile evaluating ‘filterOverrides’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:407:21, called from /nix/var/nix/profiles/per-user/root/cha
nnels/nixos/nixpkgs/lib/modules.nix:316:18:
while evaluating ‘concatMap’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/lists.nix:79:18, called from /nix/var/nix/profiles/per-user/root/channels/nix
os/nixpkgs/lib/modules.nix:413:8:
while evaluating ‘concatMap’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/lists.nix:79:18, called from /nix/var/nix/profiles/per-user/root/channels/nix
os/nixpkgs/lib/modules.nix:311:17:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:311:28, called from undefined position:
while evaluating ‘dischargeProperties’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:374:25, called from /nix/var/nix/profiles/per-user/root
/channels/nixos/nixpkgs/lib/modules.nix:312:62:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:204:48:
while evaluating the attribute ‘config.text’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/systemd.nix:326:7:
while evaluating ‘commonUnitText’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/systemd.nix:310:20, called from /nix/var/nix/profi
les/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/systemd.nix:326:14:
while evaluating ‘attrsToSection’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/systemd-lib.nix:90:20, called from /nix/var/nix/pr
ofiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/systemd.nix:312:9:
while evaluating ‘mapAttrsToList’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:223:23, called from /nix/var/nix/profiles/per-user/root/cha
nnels/nixos/nixpkgs/nixos/modules/system/boot/systemd-lib.nix:91:33:
while evaluating the attribute ‘unitConfig’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:199:44:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:75:45, called from /nix/var/nix/profiles/per-user/root/cha
nnels/nixos/nixpkgs/lib/attrsets.nix:199:52:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:300:9:
while evaluating the option `systemd.services.dbus.unitConfig':
while evaluating the attribute ‘mergedValue’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:327:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:327:32, called from /nix/var/nix/profiles/per-user/root/ch
annels/nixos/nixpkgs/lib/modules.nix:327:19:
while evaluating ‘merge’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:201:20, called from /nix/var/nix/profiles/per-user/root/channels/nixos/
nixpkgs/lib/modules.nix:330:8:
while evaluating ‘mapAttrs’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:198:17, called from /nix/var/nix/profiles/per-user/root/channels/
nixos/nixpkgs/lib/types.nix:202:9:
while evaluating ‘filterAttrs’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:115:23, called from /nix/var/nix/profiles/per-user/root/channe
ls/nixos/nixpkgs/lib/types.nix:202:35:
while evaluating ‘concatMap’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/lists.nix:79:18, called from /nix/var/nix/profiles/per-user/root/channels/nix
os/nixpkgs/lib/attrsets.nix:116:18:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:116:29, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:202:51, called from /nix/var/nix/profiles/per-user/root/chan
nels/nixos/nixpkgs/lib/attrsets.nix:116:62:
while evaluating the attribute ‘X-Restart-Triggers’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:334:7:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:202:86, called from /nix/var/nix/profiles/per-user/root/chan
nels/nixos/nixpkgs/lib/attrsets.nix:334:15:
while evaluating the attribute ‘optionalValue’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:334:5:
while evaluating ‘filterOverrides’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:407:21, called from /nix/var/nix/profiles/per-user/root/cha
nnels/nixos/nixpkgs/lib/modules.nix:316:18:
while evaluating ‘concatMap’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/lists.nix:79:18, called from /nix/var/nix/profiles/per-user/root/channels/nix
os/nixpkgs/lib/modules.nix:413:8:
while evaluating ‘concatMap’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/lists.nix:79:18, called from /nix/var/nix/profiles/per-user/root/channels/nix
os/nixpkgs/lib/modules.nix:311:17:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:311:28, called from undefined position:
while evaluating ‘dischargeProperties’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:374:25, called from /nix/var/nix/profiles/per-user/root
/channels/nixos/nixpkgs/lib/modules.nix:312:62:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:207:55:
while evaluating the attribute ‘X-Restart-Triggers’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/systemd.nix:227:13:
while evaluating the attribute ‘serviceDirectories’ of the derivation ‘dbus-1’ at /nix/store/18bnvwv4cywkydrljzygcjxgz71vbr1c-nixos-17.03.1395.9b948ea439/nixos/pkgs/build-s
upport/trivial-builders.nix:7:14:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:180:14, called from undefined position:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:335:27:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:327:32, called from /nix/var/nix/profiles/per-user/root/ch
annels/nixos/nixpkgs/lib/modules.nix:327:19:
while evaluating ‘check’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:168:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/
nixpkgs/lib/modules.nix:328:10:
while evaluating the attribute ‘pkgs’ of the derivation ‘system-path’ at /nix/store/18bnvwv4cywkydrljzygcjxgz71vbr1c-nixos-17.03.1395.9b948ea439/nixos/pkgs/build-support/tr
ivial-builders.nix:7:14:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:180:14, called from undefined position:
while evaluating the attribute ‘value’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:335:27:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/modules.nix:327:32, called from /nix/var/nix/profiles/per-user/root/ch
annels/nixos/nixpkgs/lib/modules.nix:327:19:
while evaluating ‘check’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/types.nix:155:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/
nixpkgs/lib/modules.nix:328:10:
while evaluating ‘isStorePath’ at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/strings.nix:442:17, called from /nix/var/nix/profiles/per-user/root/channel
s/nixos/nixpkgs/lib/types.nix:155:36:
cannot coerce a function to a string, at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/strings.nix:442:44
Structure of the git repo:
|-bin/
|-lib/
|-nix/
|-default.nix
|-derivation.nix
|-module.nix
based on https://stackoverflow.com/a/44621588/973433
test repo: https://github.com/ixxie/flux
{ config, pkgs, ... }:
with builtins;
let
streamsDir = ../streams;
streamFiles = map
(file: streamsDir + ("/" + file) )
(attrNames (readDir streamsDir));
fetchStream =
(jsonFile:
pkgs.fetchgit
(removeAttrs
(fromJSON
(readFile jsonFile)
)
[ "date" "fetchSubmodules" ]
)
);
importStream =
(stream:
import "${stream}/nix/derivation.nix" {}
);
streams = map fetchStream streamFiles;
pkglist = map importStream streams;
in
{
environment =
{
systemPackages = pkglist;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment