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

12 lines
315 B
Nix
Raw Normal View History

2022-01-18 09:32:55 +01:00
{ 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 "$@"
''