Add DOTFILES envvar & dotfiles NIX_PATH

This commit is contained in:
Henrik Lissner 2020-10-11 21:29:49 -04:00
parent fa546d6337
commit 2eb91b8bc3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 9 additions and 7 deletions

View file

@ -27,7 +27,7 @@
let
inherit (builtins) baseNameOf;
inherit (lib) nixosSystem mkIf removeSuffix attrNames attrValues;
inherit (lib.my) mapModules mapModulesRec mapModulesRec';
inherit (lib.my) dotFilesDir mapModules mapModulesRec mapModulesRec';
system = "x86_64-linux";
@ -69,13 +69,15 @@
{
networking.hostName = removeSuffix ".nix" (baseNameOf modulePath);
environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
environment.variables.DOTFILES = dotFilesDir;
nixpkgs.pkgs = pkgs;
nix = {
package = unstable.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
nixPath = [
"nixpkgs=${nixos}"
"nixpkgs-overlays=${toString ./.}/overlays"
"nixpkgs-overlays=${dotFilesDir}/overlays"
"dotfiles=${dotFilesDir}"
];
binaryCaches = [
"https://cache.nixos.org/"

View file

@ -4,11 +4,11 @@ with builtins;
with lib;
rec {
# ...
dotFiles = toString ../.;
modulesDir = "${dotFiles}/modules";
configDir = "${dotFiles}/config";
binDir = "${dotFiles}/bin";
themeDir = "${modulesDir}/themes";
dotFilesDir = toString ../.;
modulesDir = "${dotFilesDir}/modules";
configDir = "${dotFilesDir}/config";
binDir = "${dotFilesDir}/bin";
themeDir = "${modulesDir}/themes";
homeDir = "/home/${let name = getEnv "USERNAME"; in
if elem name [ "" "root" ]
then "hlissner" else name}";