From 9cb1c91bc89807b4692fbead5d2de14ef858e7be Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Wed, 19 Jan 2022 16:34:20 +0100 Subject: [PATCH] handle config file using environment variable --- capibara.nix | 2 ++ home/default.nix | 1 - home/scripts/default.nix | 7 ------- home/scripts/nixos-rebuild.nix | 11 ----------- 4 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 home/scripts/default.nix delete mode 100644 home/scripts/nixos-rebuild.nix diff --git a/capibara.nix b/capibara.nix index 9048fce..cd4e3ed 100644 --- a/capibara.nix +++ b/capibara.nix @@ -87,6 +87,8 @@ in { ]; }; + environment.variables.NIXOS_CONFIG = "/home/rilla/configs/nix-config/capibara.nix"; + networking.networkmanager.wifi.macAddress = "CC:AF:78:75:29:32"; nixpkgs.config.allowUnfree = true; diff --git a/home/default.nix b/home/default.nix index 60ef4cf..0d6f99a 100644 --- a/home/default.nix +++ b/home/default.nix @@ -35,7 +35,6 @@ in { ./neovim ./pass ./rss - ./scripts ./snapcast ./sound ./ssh diff --git a/home/scripts/default.nix b/home/scripts/default.nix deleted file mode 100644 index 2c29f79..0000000 --- a/home/scripts/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = [ - (pkgs.callPackage ./nixos-rebuild.nix { inherit config pkgs; }) - ]; -} diff --git a/home/scripts/nixos-rebuild.nix b/home/scripts/nixos-rebuild.nix deleted file mode 100644 index e9c9530..0000000 --- a/home/scripts/nixos-rebuild.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -let - config-dir="configs/nix-config"; -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 "$@" - ''