diff options
-rw-r--r-- | flake.lock | 93 | ||||
-rw-r--r-- | flake.nix | 13 | ||||
-rw-r--r-- | gui/apps/web.nix | 5 | ||||
-rw-r--r-- | gui/conf/xmonad.hs | 105 | ||||
-rw-r--r-- | gui/gtk.nix | 2 | ||||
-rw-r--r-- | gui/xmonad.nix | 1 | ||||
-rw-r--r-- | host/idefix.nix | 2 | ||||
-rw-r--r-- | module/tasker.nix | 22 | ||||
-rw-r--r-- | tasks/default.nix | 22 |
9 files changed, 90 insertions, 175 deletions
@@ -6,11 +6,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1731315605, - "narHash": "sha256-a38eEP2aWC/XtiIAuR3yX3mXnxBb2C/QCRhWqwlLajQ=", + "lastModified": 1732352436, + "narHash": "sha256-DInAgNnQT0ArMfyZZ4GUIqq8B/wGS/9Y3DEntAbtan4=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "8bb826ff3ad7dd473f69c518272ae56d5f917a52", + "rev": "bb0acd64336552d7ed16bc7e2cd0ddfec65fdcbe", "type": "github" }, "original": { @@ -20,21 +20,6 @@ "type": "github" } }, - "flake-utils": { - "locked": { - "lastModified": 1623660459, - "narHash": "sha256-OTmOsh43po7r5F9s9H6lVCBQ2b0FikWbmiwLbMAGRdw=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "98c8d36b1828009b20f12544214683c7489935a1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -42,47 +27,27 @@ ] }, "locked": { - "lastModified": 1726989464, - "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", + "lastModified": 1732466619, + "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", + "rev": "f3111f62a23451114433888902a55cf0692b408d", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.05", + "ref": "release-24.11", "repo": "home-manager", "type": "github" } }, - "jupyter": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1628121465, - "narHash": "sha256-eQzY+yymJzIVRYx58Kim21AfS1v8eTTkiLj3ZtPW4Nc=", - "owner": "GTrunSec", - "repo": "jupyterWith", - "rev": "efbbc51cf4551cb3625ed47761368f02dcccf39b", - "type": "github" - }, - "original": { - "owner": "GTrunSec", - "ref": "flakes", - "repo": "jupyterWith", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1731139594, - "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", "type": "github" }, "original": { @@ -94,11 +59,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1730963269, - "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=", + "lastModified": 1731797254, + "narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", "type": "github" }, "original": { @@ -110,21 +75,6 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1623393771, - "narHash": "sha256-UMqgWzS0IEqsosffjL0P621dixn5ncE9unNylpUB9Zs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a5d03577f0161c8a6e713b928ca44d9b3feb2c37", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "rev": "a5d03577f0161c8a6e713b928ca44d9b3feb2c37", - "type": "indirect" - } - }, - "nixpkgs_3": { - "locked": { "lastModified": 1629271619, "narHash": "sha256-by9D3OkEKk4rOzJIMbC0uP2wP3Bt81auP5xmbmPg2a8=", "owner": "NixOS", @@ -141,7 +91,7 @@ }, "personal": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1629652608, @@ -161,7 +111,6 @@ "inputs": { "emacs": "emacs", "home-manager": "home-manager", - "jupyter": "jupyter", "personal": "personal", "stable": "stable", "unstable": "unstable" @@ -169,27 +118,27 @@ }, "stable": { "locked": { - "lastModified": 1730963269, - "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=", + "lastModified": 1732981179, + "narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc", + "rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.05", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } }, "unstable": { "locked": { - "lastModified": 1730958623, - "narHash": "sha256-JwQZIGSYnRNOgDDoIgqKITrPVil+RMWHsZH1eE1VGN0=", + "lastModified": 1731890469, + "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "85f7e662eda4fa3a995556527c87b2524b691933", + "rev": "5083ec887760adfe12af64830a66807423a859a7", "type": "github" }, "original": { @@ -2,30 +2,25 @@ description = "Computing environment of Adrian Kummerlaender"; inputs = { - stable.url = github:NixOS/nixpkgs/nixos-24.05; + stable.url = github:NixOS/nixpkgs/nixos-24.11; unstable.url = github:NixOS/nixpkgs/nixpkgs-unstable; personal.url = github:KnairdA/pkgs; home-manager = { - url = github:nix-community/home-manager/release-24.05; + url = github:nix-community/home-manager/release-24.11; inputs = { nixpkgs.follows = "stable"; }; }; emacs.url = github:nix-community/emacs-overlay/master; - jupyter.url = github:GTrunSec/jupyterWith/flakes; }; outputs = { - self, stable, unstable, personal, emacs, home-manager, jupyter, ... + self, stable, unstable, personal, emacs, home-manager, ... }: let system = "x86_64-linux"; - jupyter-overlay = (final: prev: { - jupyterWith = jupyter.defaultPackage."${final.system}"; - }); - pkgs = import stable { inherit system; config = { allowUnfree = true; }; - overlays = [ jupyter-overlay emacs.overlay ]; + overlays = [ emacs.overlay ]; }; pkgs-unstable = import unstable { diff --git a/gui/apps/web.nix b/gui/apps/web.nix index fa09685..41fc878 100644 --- a/gui/apps/web.nix +++ b/gui/apps/web.nix @@ -3,10 +3,11 @@ { home = { packages = [ - pkgs-unstable.tdesktop - pkgs-unstable.zotero + pkgs.tdesktop pkgs.tigervnc pkgs.remmina + + pkgs-unstable.zotero ]; }; diff --git a/gui/conf/xmonad.hs b/gui/conf/xmonad.hs index 3b4b790..7a702ac 100644 --- a/gui/conf/xmonad.hs +++ b/gui/conf/xmonad.hs @@ -17,8 +17,6 @@ import XMonad.Layout.Grid import XMonad.Layout.Groups.Examples import XMonad.Layout.Groups.Helpers -import XMonad.Actions.PhysicalScreens - import XMonad.Layout.NoBorders import XMonad.Layout.Reflect import XMonad.Layout.MultiToggle @@ -34,21 +32,27 @@ import XMonad.Util.Themes import XMonad.Util.NamedScratchpad import XMonad.Util.Dmenu (menuMapArgs) +import XMonad.Actions.PhysicalScreens import XMonad.Actions.SpawnOn import XMonad.Actions.CycleWS import XMonad.Actions.WindowBringer import XMonad.Actions.GroupNavigation import XMonad.Actions.FloatKeys import XMonad.Actions.UpdatePointer +import XMonad.Actions.DynamicWorkspaces + +import XMonad.Prompt import Data.Maybe import Control.Monad (when) import Data.Map (Map, fromList, member) -import Data.List (unionBy) +import Data.List (unionBy, isInfixOf) import System.Exit import System.Posix.Unistd +import Graphics.X11.ExtraTypes + workspaces :: [WorkspaceId] workspaces = map show [1 .. 9 :: Int] @@ -132,11 +136,6 @@ windowBringerDmenuConfig = def { menuCommand = "rofi" , menuArgs = [ "-p", "win", "-dmenu", "-i" ] } hostSpecificKeybindings host = case host of - "asterix" -> [ ("M-i b" , showNotification "Battery" - "`acpi | cut -c 10-`") - , ("M-i c" , showNotification "`acpi --thermal | awk '{print $4}'`°C" - "`cat /proc/acpi/ibm/fan | awk '/speed/{print $2}'` RPM") - , ("M-c n" , spawn "networkmanager_dmenu") ] "athena" -> [ ("M-i b" , showNotification "Battery" "`acpi | cut -c 10-`") , ("M-i c" , showNotification "`acpi --thermal | awk '{print $4}'`°C" @@ -146,11 +145,7 @@ hostSpecificKeybindings host = case host of , ("<XF86MonBrightnessDown>" , spawn "brightnessctl s 5%-") , ("<XF86AudioRaiseVolume>" , spawn "amixer sset Master 10%+") , ("<XF86AudioLowerVolume>" , spawn "amixer sset Master 10%-") - , ("<XF86AudioMute>" , spawn "amixer sset Master toggle") - , ("<Print>" , namedScratchpadAction (scratchpads host) "terminal") - , ("M-c p" , spawn "flameshot gui") ] - "obelix" -> [ ("M-i g" , showNotification "GPU" - "`nvidia-smi --query-gpu=name,temperature.gpu,utilization.gpu,utilization.memory --format=csv,noheader | awk -F',' '{print $1 \" running at\" $2 \"°C due to\" $3 \" load and\" $4 \" memory usage\"}'`") ] + , ("<XF86AudioMute>" , spawn "amixer sset Master toggle") ] "hephaestus" -> [ ("M-i g" , showNotification "GPU" "`nvidia-smi --query-gpu=name,temperature.gpu,utilization.gpu,utilization.memory --format=csv,noheader | awk -F',' '{print $1 \" running at\" $2 \"°C due to\" $3 \" load and\" $4 \" memory usage\"}'`") ] _ -> [ ] @@ -165,6 +160,8 @@ commonKeybindings host = , ("M-<Space>" , spawn "rofi -show combi") , ("M-<Return>" , spawn "kitty") , ("M-S-<Return>" , spawn "emacsclient --create-frame") + + , ("M-c p" , spawn "flameshot gui") , ("<Print>" , spawn "flameshot gui") -- password management @@ -181,6 +178,31 @@ commonKeybindings host = , ("M-S-j" , swapDown) , ("M-S-k" , swapUp) +-- workspace selection + ] ++ [ (p ++ [k] , windows $ f i) | (i, k) <- zip Main.workspaces ['1' .. '9'] + , (p, f) <- [ ("M-" , S.view) + , ("M-S-" , S.shift) ] ] ++ + [ ("C-<Backspace>" , toggleWS' ["NSP"]) + +-- workspace movement + , ("M-s j" , moveTo Next nonEmptyWS) + , ("M-s k" , moveTo Prev nonEmptyWS) + , ("M-S-s j" , shiftTo Next nonEmptyWS >> moveTo Next nonEmptyWS) + , ("M-S-s k" , shiftTo Prev nonEmptyWS >> moveTo Prev nonEmptyWS) + +-- physical screen change + , ("M-<Tab>" , nextScreen) + +-- workspace layout management + , ("M-v" , layoutMenu) + , ("M-s l" , sendMessage NextLayout) + , ("M-s +" , sendMessage $ IncMasterN 1) + , ("M-s -" , sendMessage $ IncMasterN (-1)) + , ("M-s y" , sendMessage $ Toggle REFLECTY) + , ("M-s x" , sendMessage $ Toggle REFLECTX) + , ("M-s f" , sendMessage $ Toggle NBFULL) + + -- group control , ("M-h" , bindOnLayout [ ("groups", focusGroupUp) , ("", sendMessage Shrink) ] ) @@ -205,31 +227,10 @@ commonKeybindings host = , ("M-z" , namedScratchpadAction (scratchpads host) "literature") , ("M-r" , namedScratchpadAction (scratchpads host) "calculator") , ("M-m" , namedScratchpadAction (scratchpads host) "messaging") - , ("M-n" , namedScratchpadAction (scratchpads host) "notes") ] ++ - --- workspace selection - [ (p ++ [k] , windows $ f i) | (i, k) <- zip Main.workspaces ['1' .. '9'] - , (p, f) <- [ ("M-" , S.view) - , ("M-S-" , S.shift) ] ] ++ - [ ("C-<Backspace>" , toggleWS' ["NSP"]) - --- workspace movement - , ("M-s j" , moveTo Next nonEmptyWS) - , ("M-s k" , moveTo Prev nonEmptyWS) - , ("M-S-s j" , shiftTo Next nonEmptyWS >> moveTo Next nonEmptyWS) - , ("M-S-s k" , shiftTo Prev nonEmptyWS >> moveTo Prev nonEmptyWS) + , ("M-n" , namedScratchpadAction (scratchpads host) "notes") --- physical screen change - , ("M-<Tab>" , nextScreen) - --- workspace layout management - , ("M-v" , layoutMenu) - , ("M-s l" , sendMessage NextLayout) - , ("M-s +" , sendMessage $ IncMasterN 1) - , ("M-s -" , sendMessage $ IncMasterN (-1)) - , ("M-s y" , sendMessage $ Toggle REFLECTY) - , ("M-s x" , sendMessage $ Toggle REFLECTX) - , ("M-s f" , sendMessage $ Toggle NBFULL) +-- allow selection of window to HUDify + , ("M-S-f" , spawn "xdotool selectwindow set_window --name hud") -- floating placement , ("M-w t" , withFocused $ windows . S.sink) @@ -288,6 +289,19 @@ customStartupHook host = do checkKeymap def (customKeybindings host) setWMName "LG3D" +promptConfig = def + { position = Bottom + , promptBorderWidth = 0 + , defaultText = "" + , alwaysHighlight = True + , height = 32 + , font = "xft:Iosevka Medium-12" + , fgColor = "#909636" + , bgColor = "#161616" + , bgHLight = "#909636" + , fgHLight = "#161616" + , searchPredicate = isInfixOf } + main = do host <- fmap nodeName getSystemID xmonad $ ewmh @@ -304,8 +318,15 @@ main = do , manageHook = customManageHook host , logHook = customLogHook , layoutHook = customLayoutHook host } + `additionalKeys` - [ ((noModMask, xK_Menu) , namedScratchpadAction (scratchpads host) "terminal") ] + [ ((noModMask, xK_Menu) , namedScratchpadAction (scratchpads host) "terminal") + + -- dynamic workspace management + , ((mod4Mask, xK_dead_circumflex) , selectWorkspace promptConfig) + , ((mod4Mask .|. shiftMask, xK_dead_circumflex) , renameWorkspace promptConfig) + , ((mod4Mask, xK_dead_acute) , removeWorkspace) + ] nonEmptyWS = WSIs $ return (\w -> nonNSP w && nonEmpty w) where nonNSP (S.Workspace tag _ _) = tag /= "NSP" @@ -370,26 +391,18 @@ hideScreenBorder host (S.RationalRect x0 y0 w h) = S.RationalRect (x0-(bw/sw)) ( screenWidthOn host = case host of "hephaestus" -> 1920 "atlas" -> 1920 - "obelix" -> 1280 - "asterix" -> 1366 "athena" -> 1920 screenHeightOn host = case host of "hephaestus" -> 1200 "atlas" -> 1080 - "obelix" -> 1024 - "asterix" -> 768 "athena" -> 1080 borderWidthOn host = case host of "hephaestus" -> 3 "atlas" -> 3 - "obelix" -> 3 - "asterix" -> 3 "athena" -> 3 decoHeightOn host = case host of "hephaestus" -> 20 "atlas" -> 20 - "obelix" -> 20 - "asterix" -> 20 "athena" -> 20 ------------------------------------------------------------------------------- diff --git a/gui/gtk.nix b/gui/gtk.nix index d593a55..31603a7 100644 --- a/gui/gtk.nix +++ b/gui/gtk.nix @@ -58,7 +58,7 @@ home.packages = [ # enable persistent settings in e.g. file chooser dialogs pkgs.dconf - pkgs.gnome3.dconf-editor + pkgs.dconf-editor ]; qt = { diff --git a/gui/xmonad.nix b/gui/xmonad.nix index d0bd1f9..5251bd0 100644 --- a/gui/xmonad.nix +++ b/gui/xmonad.nix @@ -28,6 +28,7 @@ }; home.packages = with pkgs; [ + xdotool # lockscreen i3lock ]; diff --git a/host/idefix.nix b/host/idefix.nix index 484f643..96d2f0b 100644 --- a/host/idefix.nix +++ b/host/idefix.nix @@ -6,6 +6,6 @@ ]; home.packages = with pkgs; [ - gnome3.gnome-tweaks + gnome.gnome-tweaks ]; } diff --git a/module/tasker.nix b/module/tasker.nix index 112da88..4f2e0fe 100644 --- a/module/tasker.nix +++ b/module/tasker.nix @@ -11,22 +11,6 @@ let #!/bin/sh exec ${pkgs.kitty}/bin/kitty -d ${dir} ${cmd} ''; - launchJupyterInDirectory = dir: jupyter: '' - #!/usr/bin/env fish - - for port in (seq 9000 9100) - if not ss --listening --oneline --tcp --no-header | awk '{ split($4, port, ":"); print port[2]+0 }' | grep -q $port - set free_port $port - break - end - end - - set token (head /dev/urandom | tr -dc A-Za-z0-9 | head -c 40) - ${jupyter}/bin/jupyter-lab --no-browser --port=$free_port --NotebookApp.token=$token & - sleep 2 - ${pkgs.chromium}/bin/chromium --app="http://localhost:$free_port/?token=$token" - kill (jobs -lp) - ''; taskivations = pkgs.lib.mapAttrsToList (name: conf: let command = pkgs.writeTextFile { @@ -43,12 +27,6 @@ let environment = launchTerminalInDirectory conf.directory '' nix-shell ${builtins.unsafeDiscardStringContext conf.environment.drvPath} --command fish ''; - - python-console = launchCommandInDirectory "~/" '' - nix-shell ${builtins.unsafeDiscardStringContext conf.environment.drvPath} --command jupyter-qtconsole - ''; - - jupyter-lab = launchJupyterInDirectory conf.directory conf.environment; }; }; diff --git a/tasks/default.nix b/tasks/default.nix index 9e641c3..04013c2 100644 --- a/tasks/default.nix +++ b/tasks/default.nix @@ -12,7 +12,6 @@ let mkPythonShellDerivation = n: ps: init: pkgs.stdenvNoCC.mkDerivation rec { name = n; buildInputs = [(pkgs.python3.withPackages (python-packages: with python-packages; ps ++ [ - jupyterlab qtconsole ]))]; shellHook = let @@ -27,10 +26,6 @@ let ''; }; - mkJupyterEnv = kernel: pkgs.jupyterWith.jupyterlabWith { - kernels = [ kernel ]; - }; - in { custom.tasks = { cpp_shell = { @@ -64,22 +59,5 @@ in { biber ]); }; - - pymath_jupyter = { - description = "Python for mathematics @ Jupyter Lab"; - directory = "~/"; - type = "jupyter-lab"; - environment = mkJupyterEnv ( - pkgs.jupyterWith.kernels.iPythonWith { - name = "python"; - packages = p: with p; [ - numpy - sympy - scipy - matplotlib - ]; - } - ); - }; }; } |