convert to proper module layout

This commit is contained in:
Noah Masur
2022-12-21 14:18:03 -07:00
parent bf1d2f1e9e
commit d040077d3a
95 changed files with 1196 additions and 895 deletions

View File

@ -0,0 +1,5 @@
{ ... }: {
imports = [ ./dotfiles.nix ./notes.nix ];
}

View File

@ -1,24 +1,30 @@
{ config, pkgs, lib, ... }: {
home-manager.users.${config.user} = {
options.dotfiles.enable = lib.mkEnableOption "Clone dotfiles.";
home.activation = {
config = lib.mkIf config.dotfiles.enable {
# Always clone dotfiles repository if it doesn't exist
cloneDotfiles =
config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
if [ ! -d "${config.dotfilesPath}" ]; then
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
$DRY_RUN_CMD ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
fi
'';
home-manager.users.${config.user} = {
home.activation = {
# Always clone dotfiles repository if it doesn't exist
cloneDotfiles =
config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
if [ ! -d "${config.dotfilesPath}" ]; then
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
$DRY_RUN_CMD ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
fi
'';
};
# Set a variable for dotfiles repo, not necessary but convenient
home.sessionVariables.DOTS = config.dotfilesPath;
};
# Set a variable for dotfiles repo, not necessary but convenient
home.sessionVariables.DOTS = config.dotfilesPath;
};
}