nix-config/home/scripts/nixos-rebuild.nix

12 lines
315 B
Nix

{ config, pkgs, ... }:
let
config-dir="configs/nixos";
in
pkgs.writeScriptBin "nixos-rebuild" ''
#!${pkgs.dash}/bin/dash
HOSTNAME="''${HOSTNAME:-''$(hostname)}"
export NIXOS_CONFIG="${config.home.homeDirectory}/${config-dir}/''${HOSTNAME}.nix"
${pkgs.nixos-rebuild}/bin/nixos-rebuild "$@"
''