Refactoring

This commit is contained in:
larstvei 2022-09-19 16:23:37 +02:00
parent ce6ce0ae70
commit c43ca98179
2 changed files with 93 additions and 83 deletions

View File

@ -49,31 +49,28 @@
services.nix-daemon.enable = true;
nixpkgs = {
config.allpwUnfree = true;
overlays =
let
versionOf = input: input.rev;
in
with inputs; [
(final: prev: {
emacs-mac = (prev.emacs.override {
srcRepo = true;
nativeComp = true;
withSQLite3 = true;
withNS = true;
}).overrideAttrs (o: rec {
version = "29.0.50";
src = inputs.emacs-src;
patches = [
./patches/fix-window-role.patch
./patches/my-no-titlebar.patch
./patches/system-appearance.patch
];
overlays = with inputs; [
(final: prev: {
emacs-mac = (prev.emacs.override {
srcRepo = true;
nativeComp = true;
withSQLite3 = true;
withNS = true;
}).overrideAttrs (o: rec {
version = "29.0.50";
src = inputs.emacs-src;
});
})
];
patches = [
./patches/fix-window-role.patch
./patches/my-no-titlebar.patch
./patches/system-appearance.patch
];
});
})
];
};
})
];

View File

@ -3,87 +3,103 @@
# Can probably be removed when this is resolved:
# https://github.com/nix-community/home-manager/issues/1341
home.activation = {
copyApplications = let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
baseDir="$HOME/Applications/Home Manager Apps"
if [ -d "$baseDir" ]; then
rm -rf "$baseDir"
fi
mkdir -p "$baseDir"
for appFile in ${apps}/Applications/*; do
target="$baseDir/$(basename "$appFile")"
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
done
'';
copyApplications =
let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
baseDir="$HOME/Applications/Home Manager Apps"
if [ -d "$baseDir" ]; then
rm -rf "$baseDir"
fi
mkdir -p "$baseDir"
for appFile in ${apps}/Applications/*; do
target="$baseDir/$(basename "$appFile")"
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
done
'';
};
home.packages = with pkgs; [
((emacsPackagesFor emacs-mac).emacsWithPackages
(epkgs: [
epkgs.vterm
epkgs.pdf-tools
(epkgs: with epkgs; [
vterm
pdf-tools
]))
(aspellWithDicts
(dpkgs: with dpkgs; [
en
en-computers
en-science
]))
sqlite
htop
(aspellWithDicts (ds: with ds; [ en en-computers en-science ]))
bat
fd
fzf
ffmpeg
fzf
htop
nixpkgs-fmt
ripgrep
rnix-lsp
nixpkgs-fmt
sqlite
tree
wget
];
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
# Somehow related to: https://github.com/NixOS/nixpkgs/issues/1000
home.file.".aspell.conf".text = "data-dir ${pkgs.aspell}/lib/aspell";
programs.fzf = {
enable = true;
enableFishIntegration = true;
};
programs = {
programs.fish = {
enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
functions = {
track_directories = {
description = "For directory tracking in emacs vterm";
onEvent = "fish_postexec";
body = "printf \'\\e]51;A\'(pwd)\'\\e\\\\\'";
fzf = {
enable = true;
enableFishIntegration = true;
};
fish = {
enable = true;
functions = {
track_directories = {
description = "For directory tracking in emacs vterm";
onEvent = "fish_postexec";
body = "printf \'\\e]51;A\'(pwd)\'\\e\\\\\'";
};
};
shellInit = ''
track_directories
'';
};
starship = {
enable = true;
settings = {
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
};
};
shellInit = ''
track_directories
'';
};
programs.starship = {
enable = true;
settings = {
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
git = {
enable = true;
userName = "larstvei";
userEmail = "larstvei@ifi.uio.no";
ignores = [ ".dir-locals.el" ".envrc" ".DS_Store" ];
};
};
programs.git = {
enable = true;
userName = "larstvei";
userEmail = "larstvei@ifi.uio.no";
ignores = [ ".dir-locals.el" ".envrc" ".DS_Store" ];
# Let Home Manager install and manage itself.
home-manager.enable = true;
};
# This value determines the Home Manager release that your
@ -95,7 +111,4 @@
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}