dotfiles/scripts/nix-secret-wrapper/default.nix
magic_rb 3f7081aff4
Move nix-secret-wrapper out of flake.nix
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-03-02 22:37:22 +01:00

21 lines
444 B
Nix

{
writeShellScript,
symlinkJoin,
nixUnstable,
makeWrapper,
nixos-rebuild,
lib,
}:
lib.fix (self: {
nix = symlinkJoin {
name = "nix";
paths = [nixUnstable];
buildInputs = [makeWrapper];
postBuild = ''
mv $out/bin/nix $out/bin/.nix-unwrapped
cp ${writeShellScript "nix" (builtins.readFile ./nix-secret-wrapper.sh)} $out/bin/nix
'';
};
nixos-rebuild = nixos-rebuild.override {nix = self.nix;};
})