fix errors

This commit is contained in:
willemml 2022-12-29 11:25:37 -08:00
parent b582ed09a7
commit 6579f8d012
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
6 changed files with 190 additions and 230 deletions

125
emacs.nix
View file

@ -1,7 +1,6 @@
{ config, pkgs, inputs, nurNoPkgs, ... }: { config, pkgs, inputs, lib, ... }:
let let pcfg = config.programs.emacs.init.usePackage;
pcfg = config.programs.emacs.init.usePackage;
in { in {
imports = [ imports = [
pkgs.nur.repos.rycee.hmModules.emacs-init pkgs.nur.repos.rycee.hmModules.emacs-init
@ -15,92 +14,92 @@ in {
usePackageVerbose = false; usePackageVerbose = false;
earlyInit = '' earlyInit = ''
;; Disable Toolbar ;; Disable Toolbar
(tool-bar-mode -1) (tool-bar-mode -1)
;; Disable scrollbar ;; Disable scrollbar
(scroll-bar-mode -1) (scroll-bar-mode -1)
;; Disable menubar ;; Disable menubar
(menu-bar-mode -1) (menu-bar-mode -1)
;; Increase garbage collector threshold before load ;; Increase garbage collector threshold before load
(setq gc-cons-threshold 640000000) (setq gc-cons-threshold 640000000)
(setq debug-on-error t) (setq debug-on-error t)
;; Use UTF-8 ;; Use UTF-8
(set-terminal-coding-system 'utf-8) (set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8) (prefer-coding-system 'utf-8)
;; Minimize native-comp warnings ;; Minimize native-comp warnings
(setq native-comp-async-report-warnings-errors nil) (setq native-comp-async-report-warnings-errors nil)
(setq warning-minimum-level 'error) (setq warning-minimum-level 'error)
''; '';
prelude = '' prelude = ''
;; Disable startup message. ;; Disable startup message.
(setq inhibit-startup-screen t (setq inhibit-startup-screen t
inhibit-startup-echo-area-message (user-login-name)) inhibit-startup-echo-area-message (user-login-name))
(setq initial-major-mode 'fundamental-mode (setq initial-major-mode 'fundamental-mode
initial-scratch-message nil) initial-scratch-message nil)
;; Accept 'y' and 'n' rather than 'yes' and 'no'. ;; Accept 'y' and 'n' rather than 'yes' and 'no'.
(defalias 'yes-or-no-p 'y-or-n-p) (defalias 'yes-or-no-p 'y-or-n-p)
;; Don't use tabs for indents ;; Don't use tabs for indents
(setq indent-tabs-mode nil) (setq indent-tabs-mode nil)
;; Don't warn when cannot guess python indent level ;; Don't warn when cannot guess python indent level
(setq python-indent-guess-indent-offset-verbose nil) (setq python-indent-guess-indent-offset-verbose nil)
;; Set indent level to 4 ;; Set indent level to 4
(setq-default tab-width 4) (setq-default tab-width 4)
;; Increase emacs data read limit (default too low for LSP) ;; Increase emacs data read limit (default too low for LSP)
(setq read-process-output-max (* 1024 1024)) (setq read-process-output-max (* 1024 1024))
;; Reduce wrist pain ;; Reduce wrist pain
(global-set-key (kbd "M-n") "~") (global-set-key (kbd "M-n") "~")
(global-set-key (kbd "M-N") "`") (global-set-key (kbd "M-N") "`")
;; Stop creating backup and autosave files. ;; Stop creating backup and autosave files.
(setq make-backup-files nil (setq make-backup-files nil
auto-save-default nil) auto-save-default nil)
;; Always show line and column number in the mode line. ;; Always show line and column number in the mode line.
(line-number-mode) (line-number-mode)
(column-number-mode) (column-number-mode)
;; Use one space to end sentences. ;; Use one space to end sentences.
(setq sentence-end-double-space nil) (setq sentence-end-double-space nil)
;; I typically want to use UTF-8. ;; I typically want to use UTF-8.
(prefer-coding-system 'utf-8) (prefer-coding-system 'utf-8)
;; Enable highlighting of current line. ;; Enable highlighting of current line.
(global-hl-line-mode 1) (global-hl-line-mode 1)
(setq custom-file (locate-user-emacs-file "custom.el")) (setq custom-file (locate-user-emacs-file "custom.el"))
(load custom-file) (load custom-file)
;; When finding file in non-existing directory, offer to create the ;; When finding file in non-existing directory, offer to create the
;; parent directory. ;; parent directory.
(defun with-buffer-name-prompt-and-make-subdirs () (defun with-buffer-name-prompt-and-make-subdirs ()
(let ((parent-directory (file-name-directory buffer-file-name))) (let ((parent-directory (file-name-directory buffer-file-name)))
(when (and (not (file-exists-p parent-directory)) (when (and (not (file-exists-p parent-directory))
(y-or-n-p (format "Directory `%s' does not exist! Create it? " parent-directory))) (y-or-n-p (format "Directory `%s' does not exist! Create it? " parent-directory)))
(make-directory parent-directory t)))) (make-directory parent-directory t))))
(add-to-list 'find-file-not-found-functions #'with-buffer-name-prompt-and-make-subdirs) (add-to-list 'find-file-not-found-functions #'with-buffer-name-prompt-and-make-subdirs)
''; '';
usePackage = { usePackage = {
dracula-theme = { dracula-theme = {
enable = true; enable = true;
config = '' config = ''
(load-theme 'dracula t) (load-theme 'dracula t)
''; '';
}; };
}; };
}; };

View file

@ -11,10 +11,11 @@
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
}; };
outputs = { self, nixpkgs-unstable, nixpkgs-22_11, home-manager, nur, ... }@inputs: outputs =
{ self, nixpkgs-unstable, nixpkgs-22_11, home-manager, nur, ... }@inputs:
let let
system = "aarch64-darwin"; system = "aarch64-darwin";
pkgs = import nixpkgs-22_11 { pkgs = import nixpkgs-22_11 {
inherit system; inherit system;
overlays = [ overlays = [
@ -37,15 +38,13 @@
# Specify your home configuration modules here, for example, # Specify your home configuration modules here, for example,
# the path to your home.nix. # the path to your home.nix.
modules = [ modules = [ nur.hmModules.nur ./home.nix ];
./home.nix
];
# Optionally use extraSpecialArgs # Optionally use extraSpecialArgs
# to pass through arguments to home.nix # to pass through arguments to home.nix
extraSpecialArgs = { # extraSpecialArgs = {
inherit nurNoPkgs; # inherit nurNoPkgs;
}; # };
}; };
}; };
} }

View file

@ -1,17 +1,23 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, inputs, ... }:
let let homeDirectory = config.home.homeDirectory;
inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin;
homeDirectory = config.home.homeDirectory;
in { in {
imports = [ imports = [
./emacs.nix #./emacs.nix
./packages.nix ./packages.nix
./programs.nix ./programs.nix
]; ];
nixpkgs.config = { nixpkgs.config = {
allowUnfree = true; allowUnfree = true;
allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [ "discord" "unrar" ];
};
home = {
username = "willem";
homeDirectory = "/Users/willem";
stateVersion = "22.11";
}; };
home.language = { home.language = {
@ -25,7 +31,5 @@ in {
variant = "colemak"; variant = "colemak";
}; };
home.sessionVariables = { home.sessionVariables = { EDITOR = "emacs"; };
EDITOR = "emacs";
};
} }

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, isDarwin, ... }: { config, lib, pkgs, ... }:
let let
comma = (import (pkgs.fetchFromGitHub { comma = (import (pkgs.fetchFromGitHub {
@ -6,77 +6,41 @@ let
repo = "comma"; repo = "comma";
rev = "v1.4.0"; rev = "v1.4.0";
sha256 = "02zh0zn0yibbgn26r0idcsv8nl7pxlnq545qas0fzj5l70hdgyhh"; sha256 = "02zh0zn0yibbgn26r0idcsv8nl7pxlnq545qas0fzj5l70hdgyhh";
})).default;
rnix-lsp = (import (pkgs.fetchFromGitHub {
owner = "nix-community";
repo = "rnix-lsp";
rev = "95d40673fe43642e2e1144341e86d0036abd95d9";
sha256 = "197s5qi0yqxl84axziq3pcpf5qa9za82siv3ap6v3rcjmndk8jqp";
})); }));
in {
darwinPackages = with pkgs; [ home.packages = with pkgs;
coreutils [ coreutils gnused spoof-mac colima pinentry_mac iterm2 ] ++ [ discord ]
gnused ++ [ docker docker-compose ] ++ [
spoof-mac black
colima shellcheck
pinentry_mac plantuml
iterm2 clang-tools
]; graphviz
nixfmt
guiPackages = with pkgs; [ texlive.combined.scheme-full
discord ] ++ [ nodePackages.bash-language-server ] ++ [
]; zsh-powerlevel10k
comma
dockerPackages = with pkgs; [ automake
unstable.docker autoconf
docker-compose cmake
]; bash
rustup
editingPackages = with pkgs; [ curl
black pv
shellcheck wget
plantuml htop
rnix-lsp bat
clang-tools fd
graphviz ripgrep
nixfmt jq
texlive.combined.scheme-full nmap
]; unzip
unp
nodePackages = with pkgs.nodePackages; [ unrar
bash-language-server rsync
]; openssh
tldr
sharedPackages = with pkgs; [ (import ./python-packages.nix { inherit pkgs; })
zsh-powerlevel10k ];
comma
automake
autoconf
cmake
bash
rustup
curl
pv
wget
htop
bat
fd
ripgrep
jq
nmap
unzip
rsync
openssh
tldr
(import ./python-packages.nix { inherit pkgs; })
];
in
{
home.packages = sharedPackages
++ (lib.optionals isDarwin darwinPackages)
++ guiPackages
++ editingPackages
++ nodePackages
++ dockerPackages ;
} }

View file

@ -2,90 +2,87 @@
{ {
programs = { programs = {
direnv = { direnv = {
enable = true;
nix-direnv = {
enable = true; enable = true;
nix-direnv = { enable = true; };
}; };
};
gpg = {
enable = true;
settings = {
use-agent = true;
default-key = "860B5C62BF1FCE4272D26BF8C3DE5DF6198DACBD";
};
};
java = { gpg = {
enable = true;
package = pkgs.jdk;
};
git = {
enable = true;
delta = {
enable = true; enable = true;
settings = {
use-agent = true;
default-key = "860B5C62BF1FCE4272D26BF8C3DE5DF6198DACBD";
};
}; };
signing = {
key = "C3DE5DF6198DACBD";
signByDefault = true;
};
extraConfig.init.defaultBranch = "master";
extraConfig.core.autocrlf = false;
package = pkgs.gitAndTools.gitFull;
userName = "willemml";
userEmail = "willem@leit.so";
};
zoxide = { java = {
enable = true; enable = true;
enableZshIntegration = true; package = pkgs.jdk;
}; };
exa = { git = {
enable = true; enable = true;
enableAliases = true; delta = { enable = true; };
}; signing = {
key = "C3DE5DF6198DACBD";
signByDefault = true;
};
extraConfig.init.defaultBranch = "master";
extraConfig.core.autocrlf = false;
package = pkgs.gitAndTools.gitFull;
userName = "willemml";
userEmail = "willem@leit.so";
};
zsh = { zoxide = {
enable = true; enable = true;
enableCompletion = true; enableZshIntegration = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
autocd = true;
defaultKeymap = "emacs";
envExtra = "export PATH=${pkgs.pinentry_mac.out}/Applications/pinentry-mac.app/Contents/MacOS:$PATH";
dirHashes = {
docs = "$HOME/Documents";
appsup = "$HOME/Library/Application Support";
dls = "$HOME/Downloads";
ubc = "$HOME/Documents/school/ubc";
}; };
dotDir = ".config/zsh";
history = { exa = {
path = "$HOME/.local/zsh/history"; enable = true;
extended = true; enableAliases = true;
ignoreDups = true;
}; };
shellAliases = {
em = "emacsclient -c"; zsh = {
emt = "emacsclient -c -nw"; enable = true;
np = "nix-shell -p"; enableCompletion = true;
hms = "home-manager switch"; enableSyntaxHighlighting = true;
enableVteIntegration = true;
autocd = true;
defaultKeymap = "emacs";
envExtra =
"export PATH=${pkgs.pinentry_mac.out}/Applications/pinentry-mac.app/Contents/MacOS:$PATH";
dirHashes = {
docs = "$HOME/Documents";
appsup = "$HOME/Library/Application Support";
dls = "$HOME/Downloads";
ubc = "$HOME/Documents/school/ubc";
};
dotDir = ".config/zsh";
history = {
path = "$HOME/.local/zsh/history";
extended = true;
ignoreDups = true;
};
shellAliases = {
em = "emacsclient -c";
emt = "emacsclient -c -nw";
np = "nix-shell -p";
hms = "home-manager switch";
};
plugins = with pkgs; [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./p10k-config;
file = "p10k.zsh";
}
];
}; };
plugins = with pkgs; [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./p10k-config;
file = "p10k.zsh";
}
];
};
}; };
} }

View file

@ -1,6 +1,3 @@
{ pkgs }: { pkgs }:
pkgs.python310.withPackages(p: with p; [ pkgs.python310.withPackages (p: with p; [ matplotlib latexify-py ])
matplotlib
latexify-py
])