I have a GitHub repo that builds using a flake. (I.e., it has a a flake.nix
, and a flake.lock
). I’ve built and tested it, and now I’d like to add it to my NixOS set-up.
I’m trying to adapt this example from the NixOS manual
In my NixOS configuration, I have:
environment.systemPackages = [
. . .
(import ./pandoc-select-code.nix)
. . .
And here’s pandoc-select-code.nix
:
with import <nixpkgs> {}; # bring all of Nixpkgs into scope
stdenv.mkDerivation rec {
name = "pandoc-select-code";
src = builtins.fetchGit {
url = "https://github.com/mhwombat/pandoc-select-code.git";
ref = "HEAD";
};
}
But when I do sudo nixos-rebuild switch --upgrade
, I get the following errors. Does mkDerivation
support flakes?
unpacking channels...
building Nix...
building the system configuration...
these 12 derivations will be built:
/nix/store/4gd4js7w1sdlzf8walgginn3akambdpg-pandoc-select-code.drv
/nix/store/sllghpxvry7dbzfjf3ai4fnsz23c55n8-system-path.drv
/nix/store/524h485gpggcpbkc9w8nja9cpccj3glc-unit-polkit.service.drv
/nix/store/59b5a7zfxss2nh49yi425f0wx5iq2nbw-unit-systemd-fsck-.service.drv
/nix/store/j7nwxdmbw21afy26qwqh6c2gv93z93aj-dbus-1.drv
/nix/store/kh5fjmz0pr51zqgvwk1ik4fz45m78p0v-unit-dbus.service.drv
/nix/store/mvpgpkv82bb1vqxhx9lpm7jcrlyk2wv3-unit-accounts-daemon.service.drv
/nix/store/a2lpks1lv5rzqy2rj5hn6wmv3b6lrz1j-system-units.drv
/nix/store/zhypgllf7dsc858pcc2q6ibjiqvhz9p7-unit-dbus.service.drv
/nix/store/wbvcs3rn6dk53dxbgm2ril4x08x5h8x9-user-units.drv
/nix/store/9p2priypx9llgf0skpia9x1jwafd0ifd-etc.drv
/nix/store/ybfi9kl83wnr8kwqlkgjknnk8ywxwayw-nixos-system-wombat11k-22.05pre356435.7f9b6e2babf.drv
building '/nix/store/4gd4js7w1sdlzf8walgginn3akambdpg-pandoc-select-code.drv'...
unpacking sources
unpacking source archive /nix/store/yl8n55bxr85y0a37g0hi32w4p8ml347r-source
source root is source
patching sources
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
install flags: SHELL=/nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12/bin/bash install
make: *** No rule to make target 'install'. Stop.
error: builder for '/nix/store/4gd4js7w1sdlzf8walgginn3akambdpg-pandoc-select-code.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/sllghpxvry7dbzfjf3ai4fnsz23c55n8-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ybfi9kl83wnr8kwqlkgjknnk8ywxwayw-nixos-system-wombat11k-22.05pre356435.7f9b6e2babf.drv' failed to build