mirror of
https://github.com/larstvei/nix-config.git
synced 2024-11-26 08:58:31 +00:00
Refactoring
This commit is contained in:
parent
ce6ce0ae70
commit
c43ca98179
41
flake.nix
41
flake.nix
@ -49,31 +49,28 @@
|
|||||||
services.nix-daemon.enable = true;
|
services.nix-daemon.enable = true;
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
|
|
||||||
config.allpwUnfree = true;
|
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 = [
|
overlays = with inputs; [
|
||||||
./patches/fix-window-role.patch
|
(final: prev: {
|
||||||
./patches/my-no-titlebar.patch
|
emacs-mac = (prev.emacs.override {
|
||||||
./patches/system-appearance.patch
|
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
|
||||||
|
];
|
||||||
|
});
|
||||||
|
})
|
||||||
|
];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
135
modules/home.nix
135
modules/home.nix
@ -3,87 +3,103 @@
|
|||||||
# Can probably be removed when this is resolved:
|
# Can probably be removed when this is resolved:
|
||||||
# https://github.com/nix-community/home-manager/issues/1341
|
# https://github.com/nix-community/home-manager/issues/1341
|
||||||
home.activation = {
|
home.activation = {
|
||||||
copyApplications = let
|
copyApplications =
|
||||||
apps = pkgs.buildEnv {
|
let
|
||||||
name = "home-manager-applications";
|
apps = pkgs.buildEnv {
|
||||||
paths = config.home.packages;
|
name = "home-manager-applications";
|
||||||
pathsToLink = "/Applications";
|
paths = config.home.packages;
|
||||||
};
|
pathsToLink = "/Applications";
|
||||||
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
};
|
||||||
baseDir="$HOME/Applications/Home Manager Apps"
|
in
|
||||||
if [ -d "$baseDir" ]; then
|
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
rm -rf "$baseDir"
|
baseDir="$HOME/Applications/Home Manager Apps"
|
||||||
fi
|
if [ -d "$baseDir" ]; then
|
||||||
mkdir -p "$baseDir"
|
rm -rf "$baseDir"
|
||||||
for appFile in ${apps}/Applications/*; do
|
fi
|
||||||
target="$baseDir/$(basename "$appFile")"
|
mkdir -p "$baseDir"
|
||||||
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
|
for appFile in ${apps}/Applications/*; do
|
||||||
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
|
target="$baseDir/$(basename "$appFile")"
|
||||||
done
|
$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; [
|
home.packages = with pkgs; [
|
||||||
((emacsPackagesFor emacs-mac).emacsWithPackages
|
((emacsPackagesFor emacs-mac).emacsWithPackages
|
||||||
(epkgs: [
|
(epkgs: with epkgs; [
|
||||||
epkgs.vterm
|
vterm
|
||||||
epkgs.pdf-tools
|
pdf-tools
|
||||||
|
]))
|
||||||
|
(aspellWithDicts
|
||||||
|
(dpkgs: with dpkgs; [
|
||||||
|
en
|
||||||
|
en-computers
|
||||||
|
en-science
|
||||||
]))
|
]))
|
||||||
sqlite
|
|
||||||
htop
|
|
||||||
(aspellWithDicts (ds: with ds; [ en en-computers en-science ]))
|
|
||||||
bat
|
bat
|
||||||
fd
|
fd
|
||||||
fzf
|
|
||||||
ffmpeg
|
ffmpeg
|
||||||
|
fzf
|
||||||
|
htop
|
||||||
|
nixpkgs-fmt
|
||||||
ripgrep
|
ripgrep
|
||||||
rnix-lsp
|
rnix-lsp
|
||||||
nixpkgs-fmt
|
sqlite
|
||||||
tree
|
tree
|
||||||
wget
|
wget
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.direnv.enable = true;
|
# Somehow related to: https://github.com/NixOS/nixpkgs/issues/1000
|
||||||
programs.direnv.nix-direnv.enable = true;
|
|
||||||
|
|
||||||
home.file.".aspell.conf".text = "data-dir ${pkgs.aspell}/lib/aspell";
|
home.file.".aspell.conf".text = "data-dir ${pkgs.aspell}/lib/aspell";
|
||||||
|
|
||||||
programs.fzf = {
|
programs = {
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.fish = {
|
direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
functions = {
|
fzf = {
|
||||||
track_directories = {
|
enable = true;
|
||||||
description = "For directory tracking in emacs vterm";
|
enableFishIntegration = true;
|
||||||
onEvent = "fish_postexec";
|
};
|
||||||
body = "printf \'\\e]51;A\'(pwd)\'\\e\\\\\'";
|
|
||||||
|
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 = ''
|
git = {
|
||||||
track_directories
|
enable = true;
|
||||||
'';
|
userName = "larstvei";
|
||||||
};
|
userEmail = "larstvei@ifi.uio.no";
|
||||||
|
ignores = [ ".dir-locals.el" ".envrc" ".DS_Store" ];
|
||||||
programs.starship = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
character = {
|
|
||||||
success_symbol = "[λ](bold green)";
|
|
||||||
error_symbol = "[λ](bold red)";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
programs.git = {
|
# Let Home Manager install and manage itself.
|
||||||
enable = true;
|
home-manager.enable = true;
|
||||||
userName = "larstvei";
|
|
||||||
userEmail = "larstvei@ifi.uio.no";
|
|
||||||
ignores = [ ".dir-locals.el" ".envrc" ".DS_Store" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
@ -95,7 +111,4 @@
|
|||||||
# the Home Manager release notes for a list of state version
|
# the Home Manager release notes for a list of state version
|
||||||
# changes in each release.
|
# changes in each release.
|
||||||
home.stateVersion = "22.05";
|
home.stateVersion = "22.05";
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user