summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2024-11-29 07:10:07 +0100
committerMartin Fischer <martin@push-f.com>2024-12-11 08:32:27 +0100
commit112c101c7308ddd710d0936ad8d1c010ae0dfb28 (patch)
tree5d50d6f9ba2274b154b2be8253f16b4dddfcf63e
parent10ef42ae9d4a60dea161bae495ec1f09c8388617 (diff)
refactor: make configuration.nix main entry point
-rw-r--r--nixos/configuration.nix1
-rwxr-xr-xnixos/rebuild4
-rw-r--r--nixos/sanix.nix (renamed from nixos/root.nix)7
3 files changed, 4 insertions, 8 deletions
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
index c887c72..7d785ab 100644
--- a/nixos/configuration.nix
+++ b/nixos/configuration.nix
@@ -5,6 +5,7 @@
{
imports = [
./hardware-configuration.nix
+ ./sanix.nix
];
# Bootloader.
diff --git a/nixos/rebuild b/nixos/rebuild
index 2ee7d76..98101c1 100755
--- a/nixos/rebuild
+++ b/nixos/rebuild
@@ -3,8 +3,8 @@ set -euo pipefail
# nix-instantiate --eval has no raw mode yet
nixpkgsPath=$(nix-instantiate --eval --read-write-mode nixpkgs/path.nix | tr -d \")
-# Get the ./root.nix relative to this script
-configPath=$(realpath -- "$(dirname -- "${BASH_SOURCE[0]}")/root.nix")
+# Get the ./configuration.nix relative to this script
+configPath=$(realpath -- "$(dirname -- "${BASH_SOURCE[0]}")/configuration.nix")
# nixos-rebuild always reads Nixpkgs from the NIX_PATH,
# so we need to set it explicitly to our pinned version
diff --git a/nixos/root.nix b/nixos/sanix.nix
index b23e091..4895127 100644
--- a/nixos/root.nix
+++ b/nixos/sanix.nix
@@ -1,9 +1,4 @@
{ lib, pkgs, config, ... }: {
- imports = [
- # Import your main configuration
- ./configuration.nix
- ];
-
environment.systemPackages = with pkgs; [
# We're using niv to manage the systems Nixpkgs version, install it globally for ease
niv
@@ -18,7 +13,7 @@
# Makes commands default to the same Nixpkgs, config, overlays and NixOS configuration
nix.nixPath = [
"nixpkgs=${pkgs.path}"
- "nixos-config=${toString ./root.nix}"
+ "nixos-config=${toString <nixos-config>}"
"nixpkgs-overlays=${toString ./nixpkgs/overlays.nix}"
];
environment.variables.NIXPKGS_CONFIG = lib.mkForce (toString ./nixpkgs/config.nix);