From 7b70581a14d630f2ae3e58e4eec79445dc6d0e31 Mon Sep 17 00:00:00 2001 From: Hynggyu Jang Date: Sun, 18 Apr 2021 21:20:28 +0900 Subject: [PATCH] Draft: Delete `home-manager` related from `nix-darwin`. --- darwin/configuration.nix | 307 --------------------------------------- home.nix | 307 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 307 insertions(+), 307 deletions(-) create mode 100644 home.nix diff --git a/darwin/configuration.nix b/darwin/configuration.nix index 0dec18b..c682c0e 100644 --- a/darwin/configuration.nix +++ b/darwin/configuration.nix @@ -31,313 +31,6 @@ let hgj_home = builtins.getEnv "HOME"; in with lib; { - # Home manager - imports = [ ]; - - home-manager.useGlobalPkgs = true; - home-manager.users.hynggyujang = - let - doom-emacs = pkgs.callPackage (builtins.fetchTarball { - url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz; - }) { - inherit pkgs; - doomPrivateDir = environment.variables.DOOMDIR; - }; - in { - # home.packages = [ doom-emacs ]; - home.file = { - # ".emacs.d/init.el".text = '' - # (load "default.el") - # ''; - ".qutebrowser/config.py".text = '' - config.load_autoconfig(True) - # c.window.hide_decoration = True - - # c.colors.webpage.darkmode.enabled = True - - # c.qt.args = [ "disable-gpu" ] - - c.qt.environ = {"NODE_PATH": "/run/current-system/sw/lib/node_modules"} - - c.url.default_page = 'https://google.com' - c.url.start_pages = c.url.default_page - c.url.searchengines = {"DEFAULT": "https://google.com/search?q={}"} - - c.editor.command = ['emacsclient', '{}'] - - c.statusbar.show = "never" - c.tabs.show = "switching" - - c.bindings.commands['normal'] = { - "": "open -w", - "": "open -t", - "": "reload -f", - "": "session-load -f _autosave", - "": "tab-close", - "": "close", - "x": "tab-close", - "": "close", - # Org roam capture - "": "open javascript:location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", - # Plain old org capture - "": "open javascript:location.href='org-protocol://capture?template=p&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", - # Plain old org capture at current point - "": "open javascript:location.href='org-protocol://capture?template=L&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())" - } - - # Doom emacs like key binding - c.bindings.commands['insert'] = { - # editing - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ', - '': 'fake-key ;; fake-key ', - '': 'fake-key ;; fake-key ', - '': 'fake-key ', - '': 'insert-text', - '': 'edit-text' - } - - c.bindings.commands['caret'] = { - # Org roam capture - "": "open javascript:location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", - # Plain old org capture - "": "open javascript:location.href='org-protocol://capture?template=p&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", - # Plain old org capture at current point - "": "open javascript:location.href='org-protocol://capture?template=L&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())" - } - - c.bindings.commands['command'] = { - '': 'completion-item-focus next', - '': 'completion-item-focus prev', - '': 'rl-delete-char' - } - - c.bindings.commands['prompt'] = { - '': 'prompt-item-focus next', - '': 'prompt-item-focus prev' - } - - # Universal Emacsien C-g alias for Escape - config.bind('', 'clear-keychain ;; search ;; fullscreen --leave') - # Dark mode toggling - config.bind('', 'config-cycle colors.webpage.darkmode.enabled ;; restart ;; session-load -f _autosave') - for mode in ['caret', 'command', 'hint', 'insert', 'passthrough', 'prompt', 'register']: - config.bind('', 'mode-leave', mode=mode) - config.bind('', 'config-cycle colors.webpage.darkmode.enabled ;; restart ;; session-load -f _autosave', mode=mode) - - - config.unbind("") - config.unbind("") - config.unbind("") - config.unbind("") - config.unbind("") - - config.bind(';;', 'hint inputs --first') # easier to reach than ;t - - # Open in chrome - config.bind(';g', 'hint links spawn open -na "Google Chrome" --args --app={hint-url}') - - c.aliases['readability-js'] = "spawn -u readability-js" - c.aliases['readability'] = "spawn -u readability" - c.aliases['chrome'] = "spawn open -na 'Google Chrome' --args --app={url}" - c.aliases['removed'] = "open javascript:document.location=document.URL.replace('reddit.com','removeddit.com');" - - #Activate dracula theme - import dracula.draw - - dracula.draw.blood(c, { - 'spacing': { - 'vertical': 6, - 'horizontal': 8 - } - }) - ''; - ".qutebrowser/dracula".source = pkgs.fetchFromGitHub { - owner = "dracula"; - repo = "qutebrowser"; - rev = "ba5bd6589c4bb8ab35aaaaf7111906732f9764ef"; - sha256 = "1mhckmyqc7ripzmz0d8466fq0njqhxkigzm3nz0yl05k0xlsbzka"; - }; - ".qutebrowser/userscripts/readability-js" = { - source = pkgs.fetchurl { - name = "readability-js"; - url = "https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/misc/userscripts/readability-js"; - sha256 = "1plp2gnvk2qy6kkdhl05fd01n15nxfy2hllyd2lskp9z0g8gdldn"; - }; - executable = true; - }; - ".qutebrowser/userscripts/readability" = { - source = pkgs.fetchurl { - name = "readability"; - url = "https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/misc/userscripts/readability"; - sha256 = "029538gkymh756qd14j6947r6qdyzww6chnkd240vc8v0pif58lk"; - }; - executable = true; - }; - ".bash_profile".text = ". /Users/hynggyujang/.nix-profile/etc/profile.d/nix.sh"; - ".gitconfig".text = '' - [user] - name = Hynggyu Jang - email = murasakipurplez5@gmail.com - ''; - ".mailcap".text = '' - # HTML - text/html; open %s; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html - ''; - ".mailrc".text = '' - set sendmail="/usr/local/bin/msmtp" - ''; - ".mbsyncrc".text = '' - IMAPAccount nagoya - Host mail.j.mbox.nagoya-u.ac.jp - User jang.hyunggyu@j.mbox.nagoya-u.ac.jp #not XXX@me.com etc. - UseKeychain Yes - Port 993 - SSLType IMAPS - SSLVersions TLSv1.2 - - IMAPStore nagoya-remote - Account nagoya - - MaildirStore nagoya-local - Path ~/.mail/account.nagoya/ - Inbox ~/.mail/account.nagoya/Inbox - SubFolders Verbatim - - Channel nagoya-folders - Far :nagoya-remote: - Near :nagoya-local: - Patterns * - Create Both - Expunge Both - SyncState * - CopyArrivalDate Yes - - Group nagoya - Channel nagoya-folders - ''; - ".msmtprc".text = '' - # Set default values for all following accounts. - defaults - auth on - tls on - # https://github.com/okovko/msmtp_gmail_setup/blob/master/msmtp_setup.sh - tls_fingerprint 77:05:8C:8E:FC:3C:F0:5C:17:F1:21:75:02:27:33:30:D4:85:00:C2:09:63:4E:0A:56:AA:C1:54:45:FD:F6:37 - logfile ~/.msmtp.log - - # Nagoya-U mail - account jang.hyunggyu@j.mbox.nagoya-u.ac.jp - host mail.j.mbox.nagoya-u.ac.jp - port 587 - protocol smtp - from jang.hyunggyu@j.mbox.nagoya-u.ac.jp - user jang.hyunggyu@j.mbox.nagoya-u.ac.jp - tls_starttls on - - # Set a default account - account default : jang.hyunggyu@j.mbox.nagoya-u.ac.jp - ''; - ".notmuch-config".text = '' - [database] - path=/Users/hynggyujang/.mail - [user] - name=Hyunggyu Jang - primary_email=murasakipurplez5@gmail.com - other_email=jang.hyunggyu@j.mbox.nagoya-u.ac.jp - [new] - tags=new - ignore=/.*[.](json|lock|bak)$/;.mbsyncstate;.uidvalidity;.DS_Store - [search] - exclude_tags=deleted;spam; - [maildir] - synchronize_flags=true - ''; - ".SpaceVim.d".source = "${hgj_sync}/dotfiles/.SpaceVim.d"; - }; - programs = { - # qutebrowser.enable = true; - home-manager.enable = true; - zsh = rec { - enable = true; - dotDir = ".config/zsh"; - enableCompletion = false; - enableAutosuggestions = true; - - history = { - size = 50000; - save = 500000; - path = "$HOME/${dotDir}/history"; - ignoreDups = true; - share = true; - }; - }; - }; - xdg = { - enable = true; - - configHome = "${hgj_home}/.config"; - dataHome = "${hgj_home}/.local/share"; - cacheHome = "${hgj_home}/.cache"; - - configFile."nvim".source = "${hgj_home}/.SpaceVim"; - - configFile."afew/config".text = '' - [MailMover] - folders = account.nagoya/Inbox - rename = True - - account.nagoya/Inbox = 'NOT tag:inbox AND tag:lab':'account.nagoya/Lab' 'NOT tag:inbox AND tag:school':'account.nagoya/School' 'NOT tag:inbox AND NOT tag:trash':'account.nagoya/Archive' - - [FolderNameFilter] - folder_blacklist = account.nagoya account.gmail mail Archive - folder_transforms = Drafts:draft Junk:spam - folder_lowercases = true - maildir_separator = / - ''; - - configFile."karabiner/karabiner.json".source = "${hgj_sync}/dotfiles/karabiner.json"; - configFile."kitty/dracula.conf".source = "${kittyDracula}/dracula.conf"; - configFile."kitty/diff.conf".source = "${kittyDracula}/diff.conf"; - configFile."kitty/kitty.conf".text = '' - allow_remote_control yes - - hide_window_decorations yes - - font_family Sarasa Mono K - font_size 14.0 - - macos_thicken_font 0.5 - - macos_option_as_alt yes - macos_hide_from_tasks yes - macos_quit_when_last_window_closed yes - - include dracula.conf - ''; - configFile."zathura/zathurarc".text = "set selection-clipboard clipboard"; - configFile."nixpkgs".source = "${hgj_sync}/dotfiles/nixpkgs"; - }; - }; - system.defaults.NSGlobalDomain = { - ApplePressAndHoldEnabled = false; - AppleKeyboardUIMode = 3; - AppleShowScrollBars = "WhenScrolling"; - NSAutomaticCapitalizationEnabled = false; - NSAutomaticDashSubstitutionEnabled = false; - NSAutomaticPeriodSubstitutionEnabled = false; - NSAutomaticQuoteSubstitutionEnabled = false; - NSAutomaticSpellingCorrectionEnabled = false; - NSUseAnimatedFocusRing = false; - _HIHideMenuBar = true; - }; system.defaults.dock.orientation = "left"; diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..c889387 --- /dev/null +++ b/home.nix @@ -0,0 +1,307 @@ + # Home manager + imports = [ ]; + + home-manager.useGlobalPkgs = true; + home-manager.users.hynggyujang = + let + doom-emacs = pkgs.callPackage (builtins.fetchTarball { + url = https://github.com/vlaci/nix-doom-emacs/archive/master.tar.gz; + }) { + inherit pkgs; + doomPrivateDir = environment.variables.DOOMDIR; + }; + in { + # home.packages = [ doom-emacs ]; + home.file = { + # ".emacs.d/init.el".text = '' + # (load "default.el") + # ''; + ".qutebrowser/config.py".text = '' + config.load_autoconfig(True) + # c.window.hide_decoration = True + + # c.colors.webpage.darkmode.enabled = True + + # c.qt.args = [ "disable-gpu" ] + + c.qt.environ = {"NODE_PATH": "/run/current-system/sw/lib/node_modules"} + + c.url.default_page = 'https://google.com' + c.url.start_pages = c.url.default_page + c.url.searchengines = {"DEFAULT": "https://google.com/search?q={}"} + + c.editor.command = ['emacsclient', '{}'] + + c.statusbar.show = "never" + c.tabs.show = "switching" + + c.bindings.commands['normal'] = { + "": "open -w", + "": "open -t", + "": "reload -f", + "": "session-load -f _autosave", + "": "tab-close", + "": "close", + "x": "tab-close", + "": "close", + # Org roam capture + "": "open javascript:location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", + # Plain old org capture + "": "open javascript:location.href='org-protocol://capture?template=p&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", + # Plain old org capture at current point + "": "open javascript:location.href='org-protocol://capture?template=L&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())" + } + + # Doom emacs like key binding + c.bindings.commands['insert'] = { + # editing + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ', + '': 'fake-key ;; fake-key ', + '': 'fake-key ;; fake-key ', + '': 'fake-key ', + '': 'insert-text', + '': 'edit-text' + } + + c.bindings.commands['caret'] = { + # Org roam capture + "": "open javascript:location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", + # Plain old org capture + "": "open javascript:location.href='org-protocol://capture?template=p&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())", + # Plain old org capture at current point + "": "open javascript:location.href='org-protocol://capture?template=L&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())" + } + + c.bindings.commands['command'] = { + '': 'completion-item-focus next', + '': 'completion-item-focus prev', + '': 'rl-delete-char' + } + + c.bindings.commands['prompt'] = { + '': 'prompt-item-focus next', + '': 'prompt-item-focus prev' + } + + # Universal Emacsien C-g alias for Escape + config.bind('', 'clear-keychain ;; search ;; fullscreen --leave') + # Dark mode toggling + config.bind('', 'config-cycle colors.webpage.darkmode.enabled ;; restart ;; session-load -f _autosave') + for mode in ['caret', 'command', 'hint', 'insert', 'passthrough', 'prompt', 'register']: + config.bind('', 'mode-leave', mode=mode) + config.bind('', 'config-cycle colors.webpage.darkmode.enabled ;; restart ;; session-load -f _autosave', mode=mode) + + + config.unbind("") + config.unbind("") + config.unbind("") + config.unbind("") + config.unbind("") + + config.bind(';;', 'hint inputs --first') # easier to reach than ;t + + # Open in chrome + config.bind(';g', 'hint links spawn open -na "Google Chrome" --args --app={hint-url}') + + c.aliases['readability-js'] = "spawn -u readability-js" + c.aliases['readability'] = "spawn -u readability" + c.aliases['chrome'] = "spawn open -na 'Google Chrome' --args --app={url}" + c.aliases['removed'] = "open javascript:document.location=document.URL.replace('reddit.com','removeddit.com');" + + #Activate dracula theme + import dracula.draw + + dracula.draw.blood(c, { + 'spacing': { + 'vertical': 6, + 'horizontal': 8 + } + }) + ''; + ".qutebrowser/dracula".source = pkgs.fetchFromGitHub { + owner = "dracula"; + repo = "qutebrowser"; + rev = "ba5bd6589c4bb8ab35aaaaf7111906732f9764ef"; + sha256 = "1mhckmyqc7ripzmz0d8466fq0njqhxkigzm3nz0yl05k0xlsbzka"; + }; + ".qutebrowser/userscripts/readability-js" = { + source = pkgs.fetchurl { + name = "readability-js"; + url = "https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/misc/userscripts/readability-js"; + sha256 = "1plp2gnvk2qy6kkdhl05fd01n15nxfy2hllyd2lskp9z0g8gdldn"; + }; + executable = true; + }; + ".qutebrowser/userscripts/readability" = { + source = pkgs.fetchurl { + name = "readability"; + url = "https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/misc/userscripts/readability"; + sha256 = "029538gkymh756qd14j6947r6qdyzww6chnkd240vc8v0pif58lk"; + }; + executable = true; + }; + ".bash_profile".text = ". /Users/hynggyujang/.nix-profile/etc/profile.d/nix.sh"; + ".gitconfig".text = '' + [user] + name = Hynggyu Jang + email = murasakipurplez5@gmail.com + ''; + ".mailcap".text = '' + # HTML + text/html; open %s; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html + ''; + ".mailrc".text = '' + set sendmail="/usr/local/bin/msmtp" + ''; + ".mbsyncrc".text = '' + IMAPAccount nagoya + Host mail.j.mbox.nagoya-u.ac.jp + User jang.hyunggyu@j.mbox.nagoya-u.ac.jp #not XXX@me.com etc. + UseKeychain Yes + Port 993 + SSLType IMAPS + SSLVersions TLSv1.2 + + IMAPStore nagoya-remote + Account nagoya + + MaildirStore nagoya-local + Path ~/.mail/account.nagoya/ + Inbox ~/.mail/account.nagoya/Inbox + SubFolders Verbatim + + Channel nagoya-folders + Far :nagoya-remote: + Near :nagoya-local: + Patterns * + Create Both + Expunge Both + SyncState * + CopyArrivalDate Yes + + Group nagoya + Channel nagoya-folders + ''; + ".msmtprc".text = '' + # Set default values for all following accounts. + defaults + auth on + tls on + # https://github.com/okovko/msmtp_gmail_setup/blob/master/msmtp_setup.sh + tls_fingerprint 77:05:8C:8E:FC:3C:F0:5C:17:F1:21:75:02:27:33:30:D4:85:00:C2:09:63:4E:0A:56:AA:C1:54:45:FD:F6:37 + logfile ~/.msmtp.log + + # Nagoya-U mail + account jang.hyunggyu@j.mbox.nagoya-u.ac.jp + host mail.j.mbox.nagoya-u.ac.jp + port 587 + protocol smtp + from jang.hyunggyu@j.mbox.nagoya-u.ac.jp + user jang.hyunggyu@j.mbox.nagoya-u.ac.jp + tls_starttls on + + # Set a default account + account default : jang.hyunggyu@j.mbox.nagoya-u.ac.jp + ''; + ".notmuch-config".text = '' + [database] + path=/Users/hynggyujang/.mail + [user] + name=Hyunggyu Jang + primary_email=murasakipurplez5@gmail.com + other_email=jang.hyunggyu@j.mbox.nagoya-u.ac.jp + [new] + tags=new + ignore=/.*[.](json|lock|bak)$/;.mbsyncstate;.uidvalidity;.DS_Store + [search] + exclude_tags=deleted;spam; + [maildir] + synchronize_flags=true + ''; + ".SpaceVim.d".source = "${hgj_sync}/dotfiles/.SpaceVim.d"; + }; + programs = { + # qutebrowser.enable = true; + home-manager.enable = true; + zsh = rec { + enable = true; + dotDir = ".config/zsh"; + enableCompletion = false; + enableAutosuggestions = true; + + history = { + size = 50000; + save = 500000; + path = "$HOME/${dotDir}/history"; + ignoreDups = true; + share = true; + }; + }; + }; + xdg = { + enable = true; + + configHome = "${hgj_home}/.config"; + dataHome = "${hgj_home}/.local/share"; + cacheHome = "${hgj_home}/.cache"; + + configFile."nvim".source = "${hgj_home}/.SpaceVim"; + + configFile."afew/config".text = '' + [MailMover] + folders = account.nagoya/Inbox + rename = True + + account.nagoya/Inbox = 'NOT tag:inbox AND tag:lab':'account.nagoya/Lab' 'NOT tag:inbox AND tag:school':'account.nagoya/School' 'NOT tag:inbox AND NOT tag:trash':'account.nagoya/Archive' + + [FolderNameFilter] + folder_blacklist = account.nagoya account.gmail mail Archive + folder_transforms = Drafts:draft Junk:spam + folder_lowercases = true + maildir_separator = / + ''; + + configFile."karabiner/karabiner.json".source = "${hgj_sync}/dotfiles/karabiner.json"; + configFile."kitty/dracula.conf".source = "${kittyDracula}/dracula.conf"; + configFile."kitty/diff.conf".source = "${kittyDracula}/diff.conf"; + configFile."kitty/kitty.conf".text = '' + allow_remote_control yes + + hide_window_decorations yes + + font_family Sarasa Mono K + font_size 14.0 + + macos_thicken_font 0.5 + + macos_option_as_alt yes + macos_hide_from_tasks yes + macos_quit_when_last_window_closed yes + + include dracula.conf + ''; + configFile."zathura/zathurarc".text = "set selection-clipboard clipboard"; + configFile."nixpkgs".source = "${hgj_sync}/dotfiles/nixpkgs"; + }; + }; + system.defaults.NSGlobalDomain = { + ApplePressAndHoldEnabled = false; + AppleKeyboardUIMode = 3; + AppleShowScrollBars = "WhenScrolling"; + NSAutomaticCapitalizationEnabled = false; + NSAutomaticDashSubstitutionEnabled = false; + NSAutomaticPeriodSubstitutionEnabled = false; + NSAutomaticQuoteSubstitutionEnabled = false; + NSAutomaticSpellingCorrectionEnabled = false; + NSUseAnimatedFocusRing = false; + _HIHideMenuBar = true; + };