diff --git a/flake.nix b/flake.nix index 7d11854..10f519a 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,8 @@ url = "github:ryantm/agenix"; inputs = { nixpkgs.follows = "nixpkgs"; + darwin.follows = "nix-darwin"; + home-manager.follows = "home-manager"; }; }; home-manager = { @@ -179,6 +181,8 @@ "millironx@bosephus" = mkHomeConfiguration { hostname = "bosephus"; }; + "tchristensen@beocat" = mkHomeConfiguration { hostname = "beocat"; }; + "millironx@odyssey" = mkHomeConfiguration { hostname = "odyssey"; desktop = true; diff --git a/homes/beocat.nix b/homes/beocat.nix new file mode 100644 index 0000000..2282c83 --- /dev/null +++ b/homes/beocat.nix @@ -0,0 +1,8 @@ +{ config, lib, pkgs, pkgs-unstable, ... }: { + home = { + username = "tchristensen"; + homeDirectory = "/homes/tchristensen"; + }; + programs = { }; + services = { }; +} diff --git a/homes/darwin.nix b/homes/darwin.nix index 8f1c3b6..32cc0e2 100644 --- a/homes/darwin.nix +++ b/homes/darwin.nix @@ -1,4 +1,4 @@ -{ pkgs, custom-pkgs, ... }: { +{ config, lib, pkgs, pkgs-unstable, ... }: { imports = [ ./../modules/defaults.nix @@ -15,27 +15,21 @@ (pkgs.writeShellScriptBin "get-current-wifi" '' ipconfig getsummary $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/{getline; print $2}') | awk -F ' SSID : ' '/ SSID : / {print $2}' '') - (pkgs.writeScriptBin "secure-finger" ( - builtins.readFile ./../bin/find_processes_using_secure_input.py - )) + (pkgs.writeScriptBin "secure-finger" + (builtins.readFile ./../bin/find_processes_using_secure_input.py)) ]; sessionVariables = { JULIA_NUM_THREADS = "$(sysctl -n hw.logicalcpu)"; # This is a workaround because it appears that launchd sets the socket # and the home-manager module won't set the socket if it's already set # This line seems to break on Linux, but is needed on MacOS - SSH_AUTH_SOCK = "$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"; + SSH_AUTH_SOCK = + "$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"; }; shellAliases = { nproc = "sysctl -n hw.logicalcpu"; tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale"; }; - file = { - "Library/Spelling/en_US-medical.dic".source = - "${custom-pkgs.hunspell-en-med-glut}/share/hunspell/en_US-medical.dic"; - "Library/Spelling/en_US-medical.aff".source = - "${custom-pkgs.hunspell-en-med-glut}/share/hunspell/en_US-medical.aff"; - }; }; programs = { bash = { @@ -57,11 +51,5 @@ ''; }; }; - services = { - gpg-agent = { - pinentry = { - package = pkgs.pinentry_mac; - }; - }; - }; + services = { gpg-agent = { pinentry = { package = pkgs.pinentry_mac; }; }; }; } diff --git a/homes/desktop.nix b/homes/desktop.nix index 51a4e01..fad5434 100644 --- a/homes/desktop.nix +++ b/homes/desktop.nix @@ -1,5 +1,6 @@ { pkgs, + lib, custom-pkgs, ... }: @@ -36,9 +37,39 @@ woodpecker-cli (texlive.combine { inherit (texlive) scheme-basic latex-bin latexmk; }) custom-pkgs.ark - custom-pkgs.hunspell-en-med-glut + custom-pkgs.hunspell-en-med custom-pkgs.jlfmt custom-pkgs.runic ]; + shellAliases = { + code = "codium"; + zunlink = '' + readlink ~/.config/zed/settings.json > ~/.config/zed/hm-settings-location && + rm ~/.config/zed/settings.json && + cp $(< ~/.config/zed/hm-settings-location) ~/.config/zed/settings.json && + chmod u+w ~/.config/zed/settings.json + ''; + zrelink = '' + rm -f ~/.config/zed/settings.json && + ln -s $(< ~/.config/zed/hm-settings-location) ~/.config/zed/settings.json + ''; + }; + }; + services = { + syncthing.enable = true; + }; + + # Symlink the merged en_MED Hunspell dictionary into the user dictionary + # directory that Qt/Sonnet (and macOS native spellcheck) scan at startup. + home.file = lib.mkIf pkgs.stdenv.isDarwin { + "Library/Spelling/en_MED.dic".source = "${custom-pkgs.hunspell-en-med}/share/hunspell/en_MED.dic"; + "Library/Spelling/en_MED.aff".source = "${custom-pkgs.hunspell-en-med}/share/hunspell/en_MED.aff"; + }; + + # On Linux, Qt/Sonnet resolves QStandardPaths::GenericDataLocation + "/hunspell" + # which maps to ~/.local/share/hunspell (managed via xdg.dataFile). + xdg.dataFile = lib.mkIf pkgs.stdenv.isLinux { + "hunspell/en_MED.dic".source = "${custom-pkgs.hunspell-en-med}/share/hunspell/en_MED.dic"; + "hunspell/en_MED.aff".source = "${custom-pkgs.hunspell-en-med}/share/hunspell/en_MED.aff"; }; } diff --git a/homes/linux-desktop.nix b/homes/linux-desktop.nix index 6ed4842..6447c0d 100644 --- a/homes/linux-desktop.nix +++ b/homes/linux-desktop.nix @@ -1,24 +1,13 @@ -{ - config, - pkgs, - custom-pkgs, - ... -}: +{ config, pkgs, custom-pkgs, ... }: let home-manager-repo = "${config.xdg.configHome}/home-manager"; mkOutOfStoreSymlink = config.lib.file.mkOutOfStoreSymlink; -in -{ +in { imports = [ ./../programs/plasma.nix ]; home = { - packages = with pkgs; [ - sqlitebrowser - custom-pkgs.sc4pac - ]; - sessionVariables = { - ZED_WINDOW_DECORATIONS = "server"; - }; + packages = with pkgs; [ sqlitebrowser custom-pkgs.sc4pac ]; + sessionVariables = { ZED_WINDOW_DECORATIONS = "server"; }; }; services = { gpg-agent = { @@ -31,22 +20,22 @@ in }; xdg = { configFile = { - "plasma-workspace/env/ZED_WINDOW_DECORATIONS.sh".text = "export ZED_WINDOW_DECORATIONS=server"; + "plasma-workspace/env/ZED_WINDOW_DECORATIONS.sh".text = + "export ZED_WINDOW_DECORATIONS=server"; "onedrive/config".text = '' force_session_upload = "true" delay_inotify_processing = "true" ''; }; dataFile = { - "hunspell/en_US-medical.dic".source = - "${custom-pkgs.hunspell-en-med-glut}/share/hunspell/en_US-medical.dic"; - "hunspell/en_US-medical.aff".source = - "${custom-pkgs.hunspell-en-med-glut}/share/hunspell/en_US-medical.aff"; "kio/servicemenus/kate.desktop".source = ./../dotfiles/kate.desktop; "kio/servicemenus/vlc.desktop".source = ./../dotfiles/vlc.desktop; - "kio/servicemenus/word-to-pdf.desktop".source = ./../dotfiles/word-to-pdf.desktop; - "kio/servicemenus/powerpoint-to-pdf.desktop".source = ./../dotfiles/powerpoint-to-pdf.desktop; - "user-places.xbel".source = mkOutOfStoreSymlink "${home-manager-repo}/dotfiles/user-places.xbel"; + "kio/servicemenus/word-to-pdf.desktop".source = + ./../dotfiles/word-to-pdf.desktop; + "kio/servicemenus/powerpoint-to-pdf.desktop".source = + ./../dotfiles/powerpoint-to-pdf.desktop; + "user-places.xbel".source = + mkOutOfStoreSymlink "${home-manager-repo}/dotfiles/user-places.xbel"; }; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 74604e1..8fa7b3d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,7 +2,7 @@ with pkgs; { ark = callPackage ./ark.nix { }; - hunspell-en-med-glut = callPackage ./hunspell-en-med-glut.nix { }; + hunspell-en-med = callPackage ./hunspell-en-med.nix { }; jlfmt = callPackage ./jlfmt.nix { }; runic = callPackage ./runic.nix { }; sc4pac = callPackage ./sc4pac.nix { }; diff --git a/pkgs/hunspell-en-med-glut.nix b/pkgs/hunspell-en-med.nix similarity index 52% rename from pkgs/hunspell-en-med-glut.nix rename to pkgs/hunspell-en-med.nix index baf6e35..db3f182 100644 --- a/pkgs/hunspell-en-med-glut.nix +++ b/pkgs/hunspell-en-med.nix @@ -1,19 +1,25 @@ { pkgs, lib }: let - pname = "hunspell-en-med-glut"; - version = "0.0.20140410"; - src = pkgs.fetchFromGitHub { - owner = "glutanimate"; - repo = pname; - rev = version; - sha256 = "sha256-7KzZ+4UToWMYFXxIRwQTxT4PwyVsBwLAF07Tlnk8eY8="; + # Hunspell dictionary of English medical terms by glutanimate. + # Merges OpenMedSpel (R. Robinson) and MTH-Med-Spel-Chek (Rajasekharan N.), + # covering ~90,000 terms (anatomy, pharmacology, DSM-IV, ICD-9, etc.). + # Note: word list is current to April 2014; GPL-3.0 licensed. + # Source: https://github.com/glutanimate/hunspell-en-med-glut + medDic = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/glutanimate/hunspell-en-med-glut/master/en_med_glut.dic"; + # Run `nix build` once with this placeholder to get the real hash from the + # error message, then replace it here. + hash = "sha256-voNMOdaB3QED0Lut3KujWXhr0Sa+sdDAi27ZMoVJDBs="; }; + in pkgs.stdenv.mkDerivation { - inherit pname; - inherit version; - inherit src; + pname = "hunspell-en-med"; + # Date of last upstream commit to the dictionary file + version = "2017-01-04"; + + dontUnpack = true; installPhase = '' runHook preInstall @@ -23,25 +29,24 @@ pkgs.stdenv.mkDerivation { # de-duplicate, then prepend the new count to form a valid .dic file. { tail -n +2 "${pkgs.hunspellDicts.en_US}/share/hunspell/en_US.dic" - tail -n +18 $src/en_med_glut.dic + tail -n +2 ${medDic} } | sort -u > words.txt count=$(wc -l < words.txt) - { printf '%s\n' "$count"; cat words.txt; } > $out/share/hunspell/en_US-medical.dic + { printf '%s\n' "$count"; cat words.txt; } > $out/share/hunspell/en_MED.dic # Reuse en_US affix rules; the medical word list carries no morphology. - cp "${pkgs.hunspellDicts.en_US}/share/hunspell/en_US.aff" $out/share/hunspell/en_US-medical.aff + cp "${pkgs.hunspellDicts.en_US}/share/hunspell/en_US.aff" $out/share/hunspell/en_MED.aff runHook postInstall ''; meta = { - description = "Merged US English + medical terms Hunspell dictionary (en_US-medical)"; + description = "Merged US English + medical terms Hunspell dictionary (en_MED)"; longDescription = '' Combines the standard en_US Hunspell dictionary with the glutanimate medical terms word list (hunspell-en-med-glut), giving a single - en_US-medical dictionary that covers everyday English and ~90,000 medical - terms. + en_MED dictionary that covers everyday English and ~90,000 medical terms. ''; homepage = "https://github.com/glutanimate/hunspell-en-med-glut"; license = lib.licenses.gpl3; diff --git a/programs/direnv.nix b/programs/direnv.nix index 086b41c..4b34305 100644 --- a/programs/direnv.nix +++ b/programs/direnv.nix @@ -1,7 +1,6 @@ -{ pkgs-unstable, ... }: { +{ ... }: { programs.direnv = { enable = true; - package = pkgs-unstable.direnv; enableBashIntegration = true; enableZshIntegration = true; }; diff --git a/programs/plasma.nix b/programs/plasma.nix index 0fbd948..ec79918 100644 --- a/programs/plasma.nix +++ b/programs/plasma.nix @@ -1,16 +1,11 @@ { config, ... }: { - imports = [ - ./konsole.nix - ./yakuake.nix - ]; + imports = [ ./konsole.nix ./yakuake.nix ]; programs.plasma = { enable = true; overrideConfig = true; - shortcuts = { - yakuake.toggle-window-state = "Ctrl+`"; - }; + shortcuts = { yakuake.toggle-window-state = "Ctrl+`"; }; configFile = { dolphinrc = { DetailsMode.PreviewSize = 16; @@ -27,7 +22,8 @@ "Places Icons Auto-resize" = false; "Places Icons Static Size" = 22; }; - PreviewSettings.Plugins = "audiothumbnail,avif,blenderthumbnail,comicbookthumbnail,cursorthumbnail,djvuthumbnail,ebookthumbnail,exrthumbnail,directorythumbnail,fontthumbnail,imagethumbnail,jpegthumbnail,jxl,kraorathumbnail,windowsexethumbnail,windowsimagethumbnail,mobithumbnail,opendocumentthumbnail,gsthumbnail,rawthumbnail,svgthumbnail,gdk-pixbuf-thumbnailer,ffmpegthumbs,gsf-office"; + PreviewSettings.Plugins = + "audiothumbnail,avif,blenderthumbnail,comicbookthumbnail,cursorthumbnail,djvuthumbnail,ebookthumbnail,exrthumbnail,directorythumbnail,fontthumbnail,imagethumbnail,jpegthumbnail,jxl,kraorathumbnail,windowsexethumbnail,windowsimagethumbnail,mobithumbnail,opendocumentthumbnail,gsthumbnail,rawthumbnail,svgthumbnail,gdk-pixbuf-thumbnailer,ffmpegthumbs,gsf-office"; }; # Store GPG passphrase @@ -38,27 +34,19 @@ }; # Disable hot corner - kwinrc = { - Effect-overview.BorderActivate = 9; - }; + kwinrc = { Effect-overview.BorderActivate = 9; }; }; - input.mice = [ - { - enable = true; - name = "Logitech M705"; - vendorId = "046d"; - productId = "406d"; - naturalScroll = true; - } - ]; + input.mice = [{ + enable = true; + name = "Logitech M705"; + vendorId = "046d"; + productId = "406d"; + naturalScroll = true; + }]; kwin = { cornerBarrier = false; titlebarButtons = { - left = [ - "close" - "minimize" - "maximize" - ]; + left = [ "close" "minimize" "maximize" ]; right = [ "help" ]; }; virtualDesktops = { @@ -78,11 +66,7 @@ hiding = "normalpanel"; screen = 0; widgets = [ - { - kickoff = { - icon = "fedora-logo-icon"; - }; - } + { kickoff = { icon = "fedora-logo-icon"; }; } "org.kde.plasma.marginsseparator" "org.kde.plasma.windowlist" "org.kde.plasma.appmenu" @@ -92,8 +76,9 @@ config = { Appearance.chartFace = "org.kde.ksysguard.barchart"; Sensors.highPrioritySensorIds = "[${ - builtins.concatStringsSep "," (builtins.genList (i: ''"cpu/cpu${builtins.toString i}/usage"'') 32) - }]"; + builtins.concatStringsSep "," (builtins.genList + (i: ''"cpu/cpu${builtins.toString i}/usage"'') 32) + }]"; }; } { @@ -104,7 +89,8 @@ name = "org.kde.plasma.systemmonitor.net"; config = { Appearance.chartFace = "org.kde.ksysguard.horizontalbars"; - Sensors.highPrioritySensorIds = ''[ "network/all/download","network/all/upload" ]''; + Sensors.highPrioritySensorIds = + ''[ "network/all/download","network/all/upload" ]''; # These are the values needed to make the network indicator # actually useful, but it appears that plasma-manager doesn't # support nesting this deep yet. Disable for now. @@ -171,10 +157,7 @@ opacity = "adaptive"; hiding = "normalpanel"; screen = 1; - widgets = [ - "org.kde.plasma.windowlist" - "org.kde.plasma.appmenu" - ]; + widgets = [ "org.kde.plasma.windowlist" "org.kde.plasma.appmenu" ]; } ##### Bottom: Virtual desktop pager | Full-name taskbar w/o pins ##### { @@ -198,36 +181,26 @@ } ]; powerdevil.AC.autoSuspend.action = "nothing"; - window-rules = [ - { - description = "Firefox picture-in-picture"; - match = { - # Window class intentionally omitted ("Unimportant") — matching on - # class alone causes the rule to silently fail on Wayland. - title = { - value = "Picture-in-Picture"; - type = "exact"; - }; - window-types = [ "normal" ]; + window-rules = [{ + description = "Firefox picture-in-picture"; + match = { + window-class = { + value = "org.mozilla.firefox"; + type = "exact"; }; - apply = { - above = { - value = true; - apply = "force"; - }; - skiptaskbar = { - value = true; - apply = "force"; - }; - }; - } - ]; + }; + apply = { + above = true; + aboverule = 2; + }; + }]; workspace = { lookAndFeel = "org.kde.breezedark.desktop"; wallpaperFillMode = "preserveAspectCrop"; wallpaperSlideShow = { interval = 86400; - path = "${config.home.homeDirectory}/Nextcloud/Pictures/Desktop backgrounds/"; + path = + "${config.home.homeDirectory}/Nextcloud/Pictures/Desktop backgrounds/"; }; }; };