diff options
author | Martin Fischer <martin@push-f.com> | 2024-12-27 08:27:03 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2024-12-27 13:02:48 +0100 |
commit | edda7ef46bf2ae7fde9511005b4e7d40648c7e24 (patch) | |
tree | 69f22f3b10650db1e658c5ead0edd397371bf7b5 | |
parent | a38027b74258a984dd959d6558440bf3078e336e (diff) |
refactor: move host configs under hosts/
-rw-r--r-- | nixos/README.md | 6 | ||||
-rw-r--r-- | nixos/hosts/ev/default.nix (renamed from nixos/ev-configuration.nix) | 12 | ||||
-rw-r--r-- | nixos/hosts/ev/hardware-configuration.nix (renamed from nixos/ev-hardware-configuration.nix) | 0 | ||||
-rw-r--r-- | nixos/hosts/hamac/default.nix (renamed from nixos/hamac-configuration.nix) | 16 | ||||
-rw-r--r-- | nixos/hosts/hamac/hardware-configuration.nix (renamed from nixos/hamac-hardware-configuration.nix) | 0 | ||||
-rw-r--r-- | nixos/hosts/tente/default.nix (renamed from nixos/tente-configuration.nix) | 8 | ||||
-rw-r--r-- | nixos/hosts/tente/hardware-configuration.nix (renamed from nixos/tente-hardware-configuration.nix) | 0 | ||||
-rwxr-xr-x | nixos/rebuild | 2 |
8 files changed, 22 insertions, 22 deletions
diff --git a/nixos/README.md b/nixos/README.md index 1a9c50e..67b6cf7 100644 --- a/nixos/README.md +++ b/nixos/README.md @@ -22,7 +22,7 @@ We're assuming that you just installed NixOS by going through the [official inst 'git clone https://git.push-f.com/config ~/config' cd ~/config/nixos ``` -2. Add your initial NixOS configuration files, either +2. Create a new directory under `hosts` named after the hostname. Add your initial NixOS configuration files, either - Move your existing configuration files into it: ``` sudo mv /etc/nixos/* . @@ -31,8 +31,8 @@ We're assuming that you just installed NixOS by going through the [official inst ``` nixos-generate-config --dir . ``` -3. Rename the files to `$host-configuration.nix` and `$host-hardware-configuration.nix` where `$host` is the configured hostname. - Add `# channel="..."` to the start of the `$host-configuration.nix` file where `...` is the key of a channel pinned in `npins/sources.json`. +3. Rename the `configuration.nix` to `default.nix`. + Add `# channel="..."` to the start of the `default.nix` file where `...` is the key of a channel pinned in `npins/sources.json`. A new channel can be pinned with: ``` diff --git a/nixos/ev-configuration.nix b/nixos/hosts/ev/default.nix index 11acf3f..d8b4b24 100644 --- a/nixos/ev-configuration.nix +++ b/nixos/hosts/ev/default.nix @@ -7,12 +7,12 @@ { imports = [ - ./ev-hardware-configuration.nix - ./sanix.nix - ./parts/server.nix - ./parts/tailscale.nix - ./parts/basics.nix - ./parts/basics-physical.nix + ./hardware-configuration.nix + ../../sanix.nix + ../../parts/server.nix + ../../parts/tailscale.nix + ../../parts/basics.nix + ../../parts/basics-physical.nix ]; boot.loader.systemd-boot.enable = true; diff --git a/nixos/ev-hardware-configuration.nix b/nixos/hosts/ev/hardware-configuration.nix index 65300c8..65300c8 100644 --- a/nixos/ev-hardware-configuration.nix +++ b/nixos/hosts/ev/hardware-configuration.nix diff --git a/nixos/hamac-configuration.nix b/nixos/hosts/hamac/default.nix index 1ddd371..c8f40e1 100644 --- a/nixos/hamac-configuration.nix +++ b/nixos/hosts/hamac/default.nix @@ -5,14 +5,14 @@ { imports = [ - ./hamac-hardware-configuration.nix - ./sanix.nix - ./parts/basics.nix - ./parts/basics-physical.nix - ./parts/graphical.nix - ./parts/tailscale.nix - ./parts/dev.nix - ./parts/create.nix + ./hardware-configuration.nix + ../../sanix.nix + ../../parts/basics.nix + ../../parts/basics-physical.nix + ../../parts/graphical.nix + ../../parts/tailscale.nix + ../../parts/dev.nix + ../../parts/create.nix ]; # Bootloader. diff --git a/nixos/hamac-hardware-configuration.nix b/nixos/hosts/hamac/hardware-configuration.nix index 54b9d60..54b9d60 100644 --- a/nixos/hamac-hardware-configuration.nix +++ b/nixos/hosts/hamac/hardware-configuration.nix diff --git a/nixos/tente-configuration.nix b/nixos/hosts/tente/default.nix index 183e065..b38d1ea 100644 --- a/nixos/tente-configuration.nix +++ b/nixos/hosts/tente/default.nix @@ -20,10 +20,10 @@ in { imports = [ - ./tente-hardware-configuration.nix - ./sanix.nix - ./parts/server.nix - ./parts/basics.nix + ./hardware-configuration.nix + ../../sanix.nix + ../../parts/server.nix + ../../parts/basics.nix ]; # Use the GRUB 2 boot loader. diff --git a/nixos/tente-hardware-configuration.nix b/nixos/hosts/tente/hardware-configuration.nix index 576ca76..576ca76 100644 --- a/nixos/tente-hardware-configuration.nix +++ b/nixos/hosts/tente/hardware-configuration.nix diff --git a/nixos/rebuild b/nixos/rebuild index 3cb086e..978dc87 100755 --- a/nixos/rebuild +++ b/nixos/rebuild @@ -4,7 +4,7 @@ set -euo pipefail # Enable all future paths in this script to be relative to the directory containing the script. cd "$(dirname -- "${BASH_SOURCE[0]}")" -configPath=$(realpath -- "$HOSTNAME-configuration.nix") +configPath=$(realpath -- "hosts/$HOSTNAME/default.nix") if [ ! -f $configPath ]; then echo "aborting: $configPath doesn't exist" |