diff --git a/home-nix/flake.lock b/nix-conf/home-manager/flake.lock similarity index 100% rename from home-nix/flake.lock rename to nix-conf/home-manager/flake.lock diff --git a/home-nix/flake.nix b/nix-conf/home-manager/flake.nix similarity index 100% rename from home-nix/flake.nix rename to nix-conf/home-manager/flake.nix diff --git a/home-nix/fromYamlSandbox/flake.lock b/nix-conf/home-manager/fromYamlSandbox/flake.lock similarity index 100% rename from home-nix/fromYamlSandbox/flake.lock rename to nix-conf/home-manager/fromYamlSandbox/flake.lock diff --git a/home-nix/fromYamlSandbox/flake.nix b/nix-conf/home-manager/fromYamlSandbox/flake.nix similarity index 100% rename from home-nix/fromYamlSandbox/flake.nix rename to nix-conf/home-manager/fromYamlSandbox/flake.nix diff --git a/home-nix/home.nix b/nix-conf/home-manager/home.nix similarity index 100% rename from home-nix/home.nix rename to nix-conf/home-manager/home.nix diff --git a/home-nix/hwtr/nix.conf b/nix-conf/home-manager/hwtr/nix.conf similarity index 100% rename from home-nix/hwtr/nix.conf rename to nix-conf/home-manager/hwtr/nix.conf diff --git a/lib-nix/default.nix b/nix-conf/lib/default.nix similarity index 100% rename from lib-nix/default.nix rename to nix-conf/lib/default.nix diff --git a/nix-conf/pkgs/default.nix b/nix-conf/pkgs/default.nix new file mode 100644 index 0000000..d40c66a --- /dev/null +++ b/nix-conf/pkgs/default.nix @@ -0,0 +1,5 @@ +# This module aims to be merge (not inject/override) with top-level pkgs to provide +# personalized/custom packages +{ pkgs, lib, ... }@pkgs_input: { + dot-hwtr = import "./dot-hwtr" pkgs_input; +} diff --git a/nix-conf/pkgs/dot-hwtr/default.nix b/nix-conf/pkgs/dot-hwtr/default.nix new file mode 100644 index 0000000..ec01c78 --- /dev/null +++ b/nix-conf/pkgs/dot-hwtr/default.nix @@ -0,0 +1,4 @@ +{ pkgs, lib, ... }@pkgs_input: pkgs.stdenv.mkDerivation { + name = "dot-hwtr"; + native +} diff --git a/system-nix/configuration.nix b/nix-conf/system/configuration.nix similarity index 100% rename from system-nix/configuration.nix rename to nix-conf/system/configuration.nix diff --git a/system-nix/flake.lock b/nix-conf/system/flake.lock similarity index 100% rename from system-nix/flake.lock rename to nix-conf/system/flake.lock diff --git a/system-nix/flake.nix b/nix-conf/system/flake.nix similarity index 100% rename from system-nix/flake.nix rename to nix-conf/system/flake.nix diff --git a/system-nix/hardware-configuration.nix b/nix-conf/system/hardware-configuration.nix similarity index 100% rename from system-nix/hardware-configuration.nix rename to nix-conf/system/hardware-configuration.nix diff --git a/system-nix/nixos-wsl/.envrc b/nix-conf/system/nixos-wsl/.envrc similarity index 100% rename from system-nix/nixos-wsl/.envrc rename to nix-conf/system/nixos-wsl/.envrc diff --git a/system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md b/nix-conf/system/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md rename to nix-conf/system/nixos-wsl/.github/ISSUE_TEMPLATE/bug_report.md diff --git a/system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md b/nix-conf/system/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from system-nix/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md rename to nix-conf/system/nixos-wsl/.github/ISSUE_TEMPLATE/feature_request.md diff --git a/system-nix/nixos-wsl/.github/release-drafter.yml b/nix-conf/system/nixos-wsl/.github/release-drafter.yml similarity index 100% rename from system-nix/nixos-wsl/.github/release-drafter.yml rename to nix-conf/system/nixos-wsl/.github/release-drafter.yml diff --git a/system-nix/nixos-wsl/.github/workflows/main.yml b/nix-conf/system/nixos-wsl/.github/workflows/main.yml similarity index 100% rename from system-nix/nixos-wsl/.github/workflows/main.yml rename to nix-conf/system/nixos-wsl/.github/workflows/main.yml diff --git a/system-nix/nixos-wsl/.github/workflows/release-drafter.yml b/nix-conf/system/nixos-wsl/.github/workflows/release-drafter.yml similarity index 100% rename from system-nix/nixos-wsl/.github/workflows/release-drafter.yml rename to nix-conf/system/nixos-wsl/.github/workflows/release-drafter.yml diff --git a/system-nix/nixos-wsl/.github/workflows/update-flakes.yml b/nix-conf/system/nixos-wsl/.github/workflows/update-flakes.yml similarity index 100% rename from system-nix/nixos-wsl/.github/workflows/update-flakes.yml rename to nix-conf/system/nixos-wsl/.github/workflows/update-flakes.yml diff --git a/system-nix/nixos-wsl/.gitignore b/nix-conf/system/nixos-wsl/.gitignore similarity index 100% rename from system-nix/nixos-wsl/.gitignore rename to nix-conf/system/nixos-wsl/.gitignore diff --git a/system-nix/nixos-wsl/LICENSE b/nix-conf/system/nixos-wsl/LICENSE similarity index 100% rename from system-nix/nixos-wsl/LICENSE rename to nix-conf/system/nixos-wsl/LICENSE diff --git a/system-nix/nixos-wsl/README.md b/nix-conf/system/nixos-wsl/README.md similarity index 100% rename from system-nix/nixos-wsl/README.md rename to nix-conf/system/nixos-wsl/README.md diff --git a/system-nix/nixos-wsl/default.nix b/nix-conf/system/nixos-wsl/default.nix similarity index 100% rename from system-nix/nixos-wsl/default.nix rename to nix-conf/system/nixos-wsl/default.nix diff --git a/system-nix/nixos-wsl/flake.lock b/nix-conf/system/nixos-wsl/flake.lock similarity index 100% rename from system-nix/nixos-wsl/flake.lock rename to nix-conf/system/nixos-wsl/flake.lock diff --git a/system-nix/nixos-wsl/flake.nix b/nix-conf/system/nixos-wsl/flake.nix similarity index 100% rename from system-nix/nixos-wsl/flake.nix rename to nix-conf/system/nixos-wsl/flake.nix diff --git a/system-nix/nixos-wsl/modules/build-tarball.nix b/nix-conf/system/nixos-wsl/modules/build-tarball.nix similarity index 100% rename from system-nix/nixos-wsl/modules/build-tarball.nix rename to nix-conf/system/nixos-wsl/modules/build-tarball.nix diff --git a/system-nix/nixos-wsl/modules/docker-desktop.nix b/nix-conf/system/nixos-wsl/modules/docker-desktop.nix similarity index 100% rename from system-nix/nixos-wsl/modules/docker-desktop.nix rename to nix-conf/system/nixos-wsl/modules/docker-desktop.nix diff --git a/system-nix/nixos-wsl/modules/docker-native.nix b/nix-conf/system/nixos-wsl/modules/docker-native.nix similarity index 100% rename from system-nix/nixos-wsl/modules/docker-native.nix rename to nix-conf/system/nixos-wsl/modules/docker-native.nix diff --git a/system-nix/nixos-wsl/modules/installer.nix b/nix-conf/system/nixos-wsl/modules/installer.nix similarity index 100% rename from system-nix/nixos-wsl/modules/installer.nix rename to nix-conf/system/nixos-wsl/modules/installer.nix diff --git a/system-nix/nixos-wsl/modules/interop.nix b/nix-conf/system/nixos-wsl/modules/interop.nix similarity index 100% rename from system-nix/nixos-wsl/modules/interop.nix rename to nix-conf/system/nixos-wsl/modules/interop.nix diff --git a/system-nix/nixos-wsl/modules/wsl-distro.nix b/nix-conf/system/nixos-wsl/modules/wsl-distro.nix similarity index 100% rename from system-nix/nixos-wsl/modules/wsl-distro.nix rename to nix-conf/system/nixos-wsl/modules/wsl-distro.nix diff --git a/system-nix/nixos-wsl/syschdemd.nix b/nix-conf/system/nixos-wsl/syschdemd.nix similarity index 100% rename from system-nix/nixos-wsl/syschdemd.nix rename to nix-conf/system/nixos-wsl/syschdemd.nix diff --git a/system-nix/nixos-wsl/syschdemd.sh b/nix-conf/system/nixos-wsl/syschdemd.sh similarity index 100% rename from system-nix/nixos-wsl/syschdemd.sh rename to nix-conf/system/nixos-wsl/syschdemd.sh diff --git a/system-nix/profiles/Felia/hardware-configuration.nix b/nix-conf/system/profiles/Felia/hardware-configuration.nix similarity index 100% rename from system-nix/profiles/Felia/hardware-configuration.nix rename to nix-conf/system/profiles/Felia/hardware-configuration.nix diff --git a/system-nix/profiles/README.md b/nix-conf/system/profiles/README.md similarity index 100% rename from system-nix/profiles/README.md rename to nix-conf/system/profiles/README.md diff --git a/system-nix/profiles/homeless/hardware-configuration.nix b/nix-conf/system/profiles/homeless/hardware-configuration.nix similarity index 100% rename from system-nix/profiles/homeless/hardware-configuration.nix rename to nix-conf/system/profiles/homeless/hardware-configuration.nix diff --git a/system-nix/profiles/lester/hardware-configuration.nix b/nix-conf/system/profiles/lester/hardware-configuration.nix similarity index 100% rename from system-nix/profiles/lester/hardware-configuration.nix rename to nix-conf/system/profiles/lester/hardware-configuration.nix diff --git a/system-nix/profiles/lizzi/hardware-configuration.nix b/nix-conf/system/profiles/lizzi/hardware-configuration.nix similarity index 100% rename from system-nix/profiles/lizzi/hardware-configuration.nix rename to nix-conf/system/profiles/lizzi/hardware-configuration.nix diff --git a/system-nix/profiles/nyx/hardware-configuration.nix b/nix-conf/system/profiles/nyx/hardware-configuration.nix similarity index 100% rename from system-nix/profiles/nyx/hardware-configuration.nix rename to nix-conf/system/profiles/nyx/hardware-configuration.nix diff --git a/system-nix/profiles/prince/hardware-configuration.nix b/nix-conf/system/profiles/prince/hardware-configuration.nix similarity index 100% rename from system-nix/profiles/prince/hardware-configuration.nix rename to nix-conf/system/profiles/prince/hardware-configuration.nix diff --git a/system-nix/scripts/felia-hwconf.sh b/nix-conf/system/scripts/felia-hwconf.sh similarity index 100% rename from system-nix/scripts/felia-hwconf.sh rename to nix-conf/system/scripts/felia-hwconf.sh diff --git a/system-nix/scripts/felia-mount.sh b/nix-conf/system/scripts/felia-mount.sh similarity index 100% rename from system-nix/scripts/felia-mount.sh rename to nix-conf/system/scripts/felia-mount.sh diff --git a/system-nix/scripts/mount-windrive.sh b/nix-conf/system/scripts/mount-windrive.sh similarity index 100% rename from system-nix/scripts/mount-windrive.sh rename to nix-conf/system/scripts/mount-windrive.sh diff --git a/system-nix/wsl-configuration.nix b/nix-conf/system/wsl-configuration.nix similarity index 100% rename from system-nix/wsl-configuration.nix rename to nix-conf/system/wsl-configuration.nix diff --git a/scripts/config-sysnix.sh b/scripts/config-sysnix.sh index 8b0e8ab..6915a01 100755 --- a/scripts/config-sysnix.sh +++ b/scripts/config-sysnix.sh @@ -12,7 +12,7 @@ fi SCRIPT_DIR=$(realpath $(dirname $0)) echo "SCRIPT_DIR: ${SCRIPT_DIR}" -SYSNIX_DIR="${SCRIPT_DIR}/../system-nix" +SYSNIX_DIR="${SCRIPT_DIR}/../nix-conf/system" # Copy hardware-configuration of existing machine onto our version control SYSNIX_PROF="${SYSNIX_DIR}/profiles/${HOSTNAME}" diff --git a/scripts/hm-switch.sh b/scripts/hm-switch.sh new file mode 100755 index 0000000..bfafbed --- /dev/null +++ b/scripts/hm-switch.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env sh +# NOTE: Untested on case of no home-manager +set -xv + +# Where this script located +SCRIPT_DIR=$(realpath $(dirname $0)) +echo "SCRIPT_DIR: ${SCRIPT_DIR}" + +HOME_MANAGER_DIR="${SCRIPT_DIR}/../nix-conf/home-manager" + +# test if we have home-manager, if not, attempt to use nix to put home-manager to +# our environment +if [ $(home-manager &>/dev/null) ]; then + nix-shell -p home-manager --run "home-manager switch --flake $HOME_MANAGER_DIR" +else + home-manager switch --flake "$HOME_MANAGER_DIR" +fi + + diff --git a/scripts/sys-switch.sh b/scripts/sys-switch.sh new file mode 100755 index 0000000..e69de29