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

111
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,7 +11,8 @@
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";
@ -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,49 +6,19 @@ 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
colima
pinentry_mac
iterm2
];
guiPackages = with pkgs; [
discord
];
dockerPackages = with pkgs; [
unstable.docker
docker-compose
];
editingPackages = with pkgs; [
black black
shellcheck shellcheck
plantuml plantuml
rnix-lsp
clang-tools clang-tools
graphviz graphviz
nixfmt nixfmt
texlive.combined.scheme-full texlive.combined.scheme-full
]; ] ++ [ nodePackages.bash-language-server ] ++ [
nodePackages = with pkgs.nodePackages; [
bash-language-server
];
sharedPackages = with pkgs; [
zsh-powerlevel10k zsh-powerlevel10k
comma comma
automake automake
@ -66,17 +36,11 @@ let
jq jq
nmap nmap
unzip unzip
unp
unrar
rsync rsync
openssh openssh
tldr tldr
(import ./python-packages.nix { inherit pkgs; }) (import ./python-packages.nix { inherit pkgs; })
]; ];
in
{
home.packages = sharedPackages
++ (lib.optionals isDarwin darwinPackages)
++ guiPackages
++ editingPackages
++ nodePackages
++ dockerPackages ;
} }

View file

@ -4,9 +4,7 @@
programs = { programs = {
direnv = { direnv = {
enable = true; enable = true;
nix-direnv = { nix-direnv = { enable = true; };
enable = true;
};
}; };
gpg = { gpg = {
@ -24,9 +22,7 @@
git = { git = {
enable = true; enable = true;
delta = { delta = { enable = true; };
enable = true;
};
signing = { signing = {
key = "C3DE5DF6198DACBD"; key = "C3DE5DF6198DACBD";
signByDefault = true; signByDefault = true;
@ -55,7 +51,8 @@
enableVteIntegration = true; enableVteIntegration = true;
autocd = true; autocd = true;
defaultKeymap = "emacs"; defaultKeymap = "emacs";
envExtra = "export PATH=${pkgs.pinentry_mac.out}/Applications/pinentry-mac.app/Contents/MacOS:$PATH"; envExtra =
"export PATH=${pkgs.pinentry_mac.out}/Applications/pinentry-mac.app/Contents/MacOS:$PATH";
dirHashes = { dirHashes = {
docs = "$HOME/Documents"; docs = "$HOME/Documents";
appsup = "$HOME/Library/Application Support"; appsup = "$HOME/Library/Application Support";

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
])