From 2fc2e6cd9cb5ed1190002aec13aac13a0b9363d8 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Thu, 22 Jan 2026 13:21:16 -0700 Subject: [PATCH] Oops forgot this --- Makefile | 8 ++++++-- modules/aliases.nix | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a365d11..2e9921b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: init install link unlink rebuild update purge edit help +.PHONY: init install link unlink rebuild update purge edit gen-hardware help NIXOS_DIR := /etc/nixos REPO_DIR := $(shell pwd) @@ -14,6 +14,7 @@ help: @echo "NixOS Config" @echo "" @echo " make init - first time setup" + @echo " make gen-hardware - generate hardware-configuration.nix" @echo " make rebuild - rebuild nixos" @echo " make update - upgrade + rebuild" @echo " make purge - garbage collect" @@ -22,7 +23,7 @@ help: @echo " make edit - edit settings.nix" init: - @./scripts/init.sh + @$(MAKE) --no-print-directory gen-hardware @$(MAKE) --no-print-directory link @echo "" @echo "done. run 'make rebuild' when ready" @@ -59,5 +60,8 @@ purge: check: nix-instantiate '' -A system --dry-run +gen-hardware: + sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix + edit: @$${EDITOR:-nano} $(SETTINGS) diff --git a/modules/aliases.nix b/modules/aliases.nix index 4440087..5557cc4 100644 --- a/modules/aliases.nix +++ b/modules/aliases.nix @@ -9,6 +9,7 @@ "nix:edit" = "$EDITOR /etc/nixos"; "nix:push" = "cd /etc/nixos && git add -A && git commit -m \"$(date -u +%s)\" && git push"; "nix:pull" = "cd /etc/nixos && git pull"; + "nix:gen-hardware" = "sudo nixos-generate-config --show-hardware-config > /etc/nixos/hardware-configuration.nix"; # Utilities "fixaudio" = "systemctl --user restart pipewire pipewire-pulse wireplumber";