diff --git a/dotfiles/dolphinrc b/dotfiles/dolphinrc deleted file mode 100644 index 2f11ee4..0000000 --- a/dotfiles/dolphinrc +++ /dev/null @@ -1,24 +0,0 @@ -MenuBar=Disabled - -[DetailsMode] -PreviewSize=16 - -[General] -BrowseThroughArchives=true -EditableUrl=true -GlobalViewProps=false -ShowFullPath=true -ShowStatusBar=FullWidth -ShowZoomSlider=true -Version=202 - - -[KFileDialog Settings] -Places Icons Auto-resize=false -Places Icons Static Size=22 - -[MainWindow] -MenuBar=Disabled - -[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 diff --git a/dotfiles/konsolerc b/dotfiles/konsolerc deleted file mode 100644 index 7f417e8..0000000 --- a/dotfiles/konsolerc +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -DefaultProfile=My Default.profile - -[MainWindow] -StatusBar=Disabled -ToolBarsMovable=Disabled - -[UiSettings] -ColorScheme=Default diff --git a/flake.nix b/flake.nix index 59c9ce0..3b4f7b7 100644 --- a/flake.nix +++ b/flake.nix @@ -81,7 +81,7 @@ ] ++ (if desktop then [ ./homes/desktop.nix ] else [ ]) ++ (if (desktop && os == "linux") then [ ./homes/linux-desktop.nix - plasma-manager.homeManagerModules.plasma-manager + plasma-manager.homeModules.plasma-manager ] else [ ]) ++ extraModules; extraSpecialArgs = { diff --git a/homes/common.nix b/homes/common.nix index 078bdd5..78d70a0 100644 --- a/homes/common.nix +++ b/homes/common.nix @@ -1,13 +1,4 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: -let - runic_version = "1.5.0"; - runic = pkgs.fetchFromGitHub { - owner = "fredrikekre"; - repo = "Runic.jl"; - rev = "v${runic_version}"; - hash = "sha256-y+kiBA94vUMHH0fEEBg7+c9PEgzjGqh6nCuSRnawhQI="; - }; -in { +{ config, lib, pkgs, pkgs-unstable, custom-pkgs, ... }: { imports = [ ./../programs/shells.nix ./../programs/bat.nix @@ -20,16 +11,6 @@ in { ]; home = { stateVersion = "23.11"; - file = { - ".local/bin/runic" = { - source = runic + "/bin/runic"; - executable = true; - }; - ".local/bin/git-runic" = { - source = runic + "/bin/git-runic"; - executable = true; - }; - }; packages = with pkgs; [ agenix btop @@ -53,6 +34,8 @@ in { pipx python3 zulu17 + custom-pkgs.jlfmt + custom-pkgs.runic ]; sessionVariables = { PAGER = "most"; @@ -87,14 +70,6 @@ in { micromamba = "mamba"; }; sessionPath = [ "$HOME/.local/bin" ]; - activation = { - installRunic = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - run ${pkgs.julia-bin}/bin/julia --project=@runic --startup-file=no -e 'using Pkg; Pkg.add(name="Runic", version="${runic_version}")' - ''; - installJuliaFormatter = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - run ${pkgs.julia-bin}/bin/julia --project=@JuliaFormatter --startup-file=no -e 'using Pkg; Pkg.add(name="JuliaFormatter", version="2.1.6")' - ''; - }; }; programs = { home-manager.enable = true; diff --git a/homes/linux-desktop.nix b/homes/linux-desktop.nix index 6d78716..2516d48 100644 --- a/homes/linux-desktop.nix +++ b/homes/linux-desktop.nix @@ -113,20 +113,12 @@ in { configFile = { "plasma-workspace/env/ZED_WINDOW_DECORATIONS.sh".text = "export ZED_WINDOW_DECORATIONS=server"; - "dolphinrc".source = - mkOutOfStoreSymlink "${home-manager-repo}/dotfiles/dolphinrc"; - "konsolerc".source = - mkOutOfStoreSymlink "${home-manager-repo}/dotfiles/konsolerc"; "onedrive/config".text = '' force_session_upload = "true" delay_inotify_processing = "true" ''; - "yakuakerc".source = - mkOutOfStoreSymlink "${home-manager-repo}/dotfiles/yakuakerc"; }; dataFile = { - "konsole/My Default.profile".source = - mkOutOfStoreSymlink "${home-manager-repo}/dotfiles/MyDefault.profile"; "kio/servicemenus/kate.desktop".source = ./../dotfiles/kate.desktop; "kio/servicemenus/vlc.desktop".source = ./../dotfiles/vlc.desktop; "kio/servicemenus/word-to-pdf.desktop".source = diff --git a/pkgs/default.nix b/pkgs/default.nix index 2e0c11e..8178242 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,6 +1,7 @@ { pkgs, ... }: - -{ - ark = pkgs.callPackage ./ark.nix { }; - sc4pac = pkgs.callPackage ./sc4pac.nix { }; +with pkgs; { + ark = callPackage ./ark.nix { }; + jlfmt = callPackage ./jlfmt.nix { }; + runic = callPackage ./runic.nix { }; + sc4pac = callPackage ./sc4pac.nix { }; } diff --git a/pkgs/jlfmt.nix b/pkgs/jlfmt.nix new file mode 100644 index 0000000..21916a4 --- /dev/null +++ b/pkgs/jlfmt.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +with pkgs; +let + juliaWithPkgs = julia-bin.withPackages.override { setDefaultDepot = false; } + [ "JuliaFormatter" ]; + depotWithPkgs = runCommand "getDepot" { } '' + ${juliaWithPkgs}/bin/julia -e 'println(first(DEPOT_PATH))' | tee $out + ''; +in writeShellScriptBin "jlfmt" '' + export JULIA_DEPOT_PATH=$(< ${depotWithPkgs}) + exec ${juliaWithPkgs}/bin/julia --startup-file=no -e 'using JuliaFormatter; print(format_text(String(read(stdin))));' -- "$@" +'' diff --git a/pkgs/runic.nix b/pkgs/runic.nix new file mode 100644 index 0000000..b91b550 --- /dev/null +++ b/pkgs/runic.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +with pkgs; +let + juliaWithRunic = + julia-bin.withPackages.override { setDefaultDepot = false; } [ "Runic" ]; + depotWithRunic = runCommand "getRunicDepot" { } '' + ${juliaWithRunic}/bin/julia -e 'println(first(DEPOT_PATH))' | tee $out + ''; +in writeShellScriptBin "runic" '' + export JULIA_DEPOT_PATH=$(< ${depotWithRunic}) + exec ${juliaWithRunic}/bin/julia --startup-file=no -e 'using Runic; exit(Runic.main(ARGS))' -- "$@" +'' diff --git a/programs/konsole.nix b/programs/konsole.nix new file mode 100644 index 0000000..66043de --- /dev/null +++ b/programs/konsole.nix @@ -0,0 +1,23 @@ +{ ... }: { + programs.konsole = { + enable = true; + defaultProfile = "millironx"; + profiles.millironx = { + colorScheme = "Breeze"; + font = { + name = "MesloLGS NF"; + size = 10; + }; + extraConfig = { + "Cursor Options".CursorShape = 1; + General.RemoteTabTitleFormat = "[SSH] %H"; + "Interaction Options" = { + CopyTextAsHTML = false; + MouseWheelZoomEnabled = false; + UnderlineFilesEnabled = true; + }; + "Terminal Features".BlinkingCursorEnabled = true; + }; + }; + }; +} diff --git a/programs/plasma.nix b/programs/plasma.nix index ea0b6e7..2fdd769 100644 --- a/programs/plasma.nix +++ b/programs/plasma.nix @@ -1,7 +1,177 @@ { config, ... }: { + + imports = [ ./konsole.nix ./yakuake.nix ]; + programs.plasma = { enable = true; + overrideConfig = true; + shortcuts = { yakuake.toggle-window-state = "Ctrl+`"; }; + configFile = { + dolphinrc = { + DetailsMode.PreviewSize = 16; + General = { + BrowseThroughArchives = true; + EditableUrl = true; + GlobalViewProps = false; + ShowFullPath = true; + ShowStatusBar = "FullWidth"; + ShowZoomSlider = true; + }; + "KFileDialog Settings" = { + "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"; + }; + }; + input.mice = [{ + enable = true; + name = "Logitech M705"; + vendorId = "046d"; + productId = "406d"; + naturalScroll = true; + }]; + kwin = { + cornerBarrier = false; + titlebarButtons = { + left = [ "close" "minimize" "maximize" ]; + right = [ "help" ]; + }; + virtualDesktops = { + number = 2; + rows = 1; + }; + }; + panels = [ + ### Screen 0 panels ### + ##### Top: Fedora menu | App switcher | Menu bar | CPU monitor | Memory monitor | Network monitor | System tray | clock ##### + { + location = "top"; + floating = true; + height = 27; + lengthMode = "fill"; + opacity = "adaptive"; + hiding = "normalpanel"; + screen = 0; + widgets = [ + { kickoff = { icon = "fedora-logo-icon"; }; } + "org.kde.plasma.marginsseparator" + "org.kde.plasma.windowlist" + "org.kde.plasma.appmenu" + "org.kde.plasma.panelspacer" + { + name = "org.kde.plasma.systemmonitor.cpu"; + config = { + Appearance.chartFace = "org.kde.ksysguard.barchart"; + Sensors.highPrioritySensorIds = "[${ + builtins.concatStringsSep "," (builtins.genList + (i: ''"cpu/cpu${builtins.toString i}/usage"'') 12) + }]"; + }; + } + { + name = "org.kde.plasma.systemmonitor.memory"; + config.Appearance.chartFace = "org.kde.ksysguard.horizontalbars"; + } + { + name = "org.kde.plasma.systemmonitor.net"; + config = { + Appearance.chartFace = "org.kde.ksysguard.horizontalbars"; + 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. + # "org.kde.ksysguard.horizontalbars".General = { + # rangeAuto = false; + # rangeFromMultiplier = 1048576; + # rangeFromUnit = 202; + # rangeToMultiplier = 1048576; + # rangeToUnit = 202; + # }; + }; + } + { systemTray = { }; } + { digitalClock = { }; } + ]; + } + ##### Bottom: Virtual desktop pager | Full-name taskbar w/ pins | Downloads folder | Trash folder + { + location = "bottom"; + floating = true; + height = 44; + lengthMode = "fill"; + opacity = "adaptive"; + hiding = "normalpanel"; + screen = 0; + widgets = [ + "org.kde.plasma.pager" + { + iconTasks = { + iconsOnly = false; + behavior.showTasks.onlyInCurrentScreen = true; + launchers = [ + "applications:systemsettings.desktop" + "applications:org.kde.discover.desktop" + "preferred://filemanager" + "preferred://browser" + "applications:net.thunderbird.Thunderbird.desktop" + "applications:io.github.alainm23.planify.desktop" + "applications:dev.zed.Zed.desktop" + "applications:com.logseq.Logseq.desktop" + "applications:net.lutris.Lutris.desktop" + ]; + }; + } + "org.kde.plasma.panelspacer" + "org.kde.plasma.marginsseparator" + { + name = "org.kde.plasma.folder"; + config = { + General.url = "file://${config.home.homeDirectory}/Downloads"; + }; + } + "org.kde.plasma.trash" + ]; + } + + ### Screen 1 panels ### + ##### Top: App switcher | Menu bar ##### + { + location = "top"; + floating = true; + height = 27; + lengthMode = "fill"; + opacity = "adaptive"; + hiding = "normalpanel"; + screen = 1; + widgets = [ "org.kde.plasma.windowlist" "org.kde.plasma.appmenu" ]; + } + ##### Bottom: Virtual desktop pager | Full-name taskbar w/o pins ##### + { + location = "bottom"; + floating = true; + height = 44; + lengthMode = "fill"; + opacity = "adaptive"; + hiding = "normalpanel"; + screen = 1; + widgets = [ + "org.kde.plasma.pager" + { + iconTasks = { + iconsOnly = false; + behavior.showTasks.onlyInCurrentScreen = true; + launchers = [ ]; + }; + } + ]; + } + ]; + powerdevil.AC.autoSuspend.action = "nothing"; workspace = { + lookAndFeel = "org.kde.breezedark.desktop"; wallpaperFillMode = "preserveAspectCrop"; wallpaperSlideShow = { interval = 86400; diff --git a/programs/yakuake.nix b/programs/yakuake.nix new file mode 100644 index 0000000..f8b86a7 --- /dev/null +++ b/programs/yakuake.nix @@ -0,0 +1,19 @@ +# Note: this file uses the lower-level `programs.plasma.configFile` syntax +# since plasma-manager does not yet support a high-level module for Yakuake +{ ... }: { + programs.plasma.configFile.yakuakerc = { + "Desktop Entry".DefaultProfile = "millironx.profile"; + Shortcuts = { + next-session = "Shift+Right; Ctrl+Shift+Tab"; + previous-terminal = "none"; + }; + Window = { + DynamicTabTitles = true; + Height = 60; + Screen = 1; + ShowSystrayIcon = false; + Width = 60; + }; + Dialogs.FirstRun = false; + }; +} diff --git a/programs/zed.nix b/programs/zed.nix index dfbbef0..6985d69 100644 --- a/programs/zed.nix +++ b/programs/zed.nix @@ -43,19 +43,7 @@ } ]; languages = { - Julia = { - formatter = { - external = { - command = "julia"; - arguments = [ - "--project=@JuliaFormatter" - "--startup-file=no" - "-e" - "using JuliaFormatter; print(format_text(String(read(stdin))));" - ]; - }; - }; - }; + Julia = { formatter = { external = { command = "jlfmt"; }; }; }; LaTeX = { formatter = { external = {