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

12 lines
320 B
Nix
Raw Normal View History

2022-01-18 09:32:55 +01:00
{ config, pkgs, ... }:
let
2022-01-19 11:30:41 +01:00
config-dir="configs/nix-config";
2022-01-18 09:32:55 +01:00
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 "$@"
''