handle config file using environment variable

feat/kile-v2
Ricard Illa 2022-01-19 16:34:20 +01:00
parent 10a9c55c7e
commit 9cb1c91bc8
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
4 changed files with 2 additions and 19 deletions

View File

@ -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;

View File

@ -35,7 +35,6 @@ in {
./neovim
./pass
./rss
./scripts
./snapcast
./sound
./ssh

View File

@ -1,7 +0,0 @@
{ config, pkgs, ... }:
{
home.packages = [
(pkgs.callPackage ./nixos-rebuild.nix { inherit config pkgs; })
];
}

View File

@ -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 "$@"
''