I am finally attempting to tackle this again. I believe my problem is related to my trying to implement some custom script files into my setup.
Specifically, I have two scripts files that allow me to use rofi to control my bluetooth and wifi connections. I want to be able to call these scripts from within my home.nix. There seems to be no easy way to achieve this. I searched and asked on this forum for help, and the best I could come up with is to use overlays (which I don’t fully understand).
This is what I did:
I created a file called rofi-bluetooth.nix
in ~/.config/nixpkgs/overlays
:
self: super: {
rofi-bluetooth = super.writeShellApplication {
name = "rofi-bluetooth";
runtimeInputs = [ super.rofi super.bluez super.coreutils super.gnugrep ];
checkPhase = ''
runHook preCheck
runHook postCheck
'';
text = builtins.readFile ./rofi-bluetooth.sh;
};
}
Also, in ~/config/nixpkgs/overlays
I created rofi-bluetooth.sh
which is a large file and I don’t think is necessary to show here. It is the script I used in my pre-NixOS days.
Next, I “installed” these overlays/derivations/whatever they are called in my home.nix
by doing this:
home = {
packages = with pkgs ; [
rofi-bluetooth
]
And then throughout my home.nix
I call these scripts like this inside my sxhkd config:
"super + b" = "rofi-bluetooth";
I used to be able to update my config with a home-manager switch
, but now when I try I get the following:
❯ home-manager switch
these 10 derivations will be built:
/nix/store/jn1b2kqxap814a8h7fw27fmg34aq6605-coreutils-9.0.drv
/nix/store/1zp5h9dand7xq0i1p7ybmzpm5wcc5awm-rofi-bluetooth.drv
/nix/store/6pgkpiaf3x8fvyxgv19vqc0kawavflm5-rofi-network-manager.drv
/nix/store/c414jyj3f3m9j1s7n87afb856ayba2hp-home-manager-path.drv
/nix/store/2vmbaglcg5gvdvmkbbqr9mdaz53v69qd-hm_fontconfigconf.d10hmfonts.conf.drv
/nix/store/mgg7blcd6x874sq65k3w59pvkrhxrjzs-polybar.conf.drv
/nix/store/d167644k8pwnqpf65dla29vgkiy5yzlc-polybar.service.drv
/nix/store/8wxry9mafxrpdjw82rc0hqx6mnlh4dqm-home-manager-files.drv
/nix/store/vfkvpynq8cdy13rlbhbcmk9849i5afg1-activation-script.drv
/nix/store/4rvw4503r8ziyvyz68q023ax38c4wc3g-home-manager-generation.drv
building '/nix/store/mgg7blcd6x874sq65k3w59pvkrhxrjzs-polybar.conf.drv'...
building '/nix/store/jn1b2kqxap814a8h7fw27fmg34aq6605-coreutils-9.0.drv'...
building '/nix/store/d167644k8pwnqpf65dla29vgkiy5yzlc-polybar.service.drv'...
unpacking sources
unpacking source archive /nix/store/is8fadziysa55wpq1dppzhv5yhlhhm6n-coreutils-9.0.tar.xz
source root is coreutils-9.0
setting SOURCE_DATE_EPOCH to timestamp 1632488258 of file coreutils-9.0/doc/coreutils.info
patching sources
applying patch /nix/store/2j8nv5xpgw7js9lr3dnspc2vk04jifzv-fix-chmod-exit-code.patch
patching file NEWS
Hunk #1 succeeded at 143 with fuzz 2 (offset 141 lines).
patching file src/chmod.c
patching file tests/chmod/ignore-symlink.sh
patching file tests/local.mk
applying patch /nix/store/snhl0w63mc0s3q6y386g061bgc7jdwwn-disable-seek-hole.patch
patching file src/copy.c
patching file tests/seek-data-capable
applying patch /nix/store/nqrwkrrnpc7443annivd10zgnnfcc0cm-fix-arm64-macos.patch
patching file src/uname.c
autoreconfPhase
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: running: autopoint --force
Copying file build-aux/config.rpath
Copying file m4/extern-inline.m4
Copying file m4/glibc2.m4
Copying file m4/glibc21.m4
...
etc. until the build eventually quits and I finally get this error:
error: builder for '/nix/store/jn1b2kqxap814a8h7fw27fmg34aq6605-coreutils-9.0.drv' failed with exit code 2;
last 10 log lines:
> ============================================================================
> make[4]: *** [Makefile:13580: tests/test-suite.log] Error 1
> make[4]: Leaving directory '/build/coreutils-9.0'
> make[3]: *** [Makefile:13688: check-TESTS] Error 2
> make[3]: Leaving directory '/build/coreutils-9.0'
> make[2]: *** [Makefile:13948: check-am] Error 2
> make[2]: Leaving directory '/build/coreutils-9.0'
> make[1]: *** [Makefile:13465: check-recursive] Error 1
> make[1]: Leaving directory '/build/coreutils-9.0'
> make: *** [Makefile:13950: check] Error 2
For full logs, run 'nix log /nix/store/jn1b2kqxap814a8h7fw27fmg34aq6605-coreutils-9.0.drv'.
error: 1 dependencies of derivation '/nix/store/1zp5h9dand7xq0i1p7ybmzpm5wcc5awm-rofi-bluetooth.drv' failed to build
error: 1 dependencies of derivation '/nix/store/c414jyj3f3m9j1s7n87afb856ayba2hp-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/byl8h83l2h178l06rwhsavzj8vszkcw5-polybar.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q3r3418rgii6k55il672rvl9b2cc78jc-home-manager-generation.drv' failed to build
Hopefully this gives a bit more insight into my situation, and hopefully I can get some help. I am unable to make any changes to my system because of this.