diff --git a/configuration.nix b/configuration.nix index 5b71d32..4c89a8e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,12 +18,12 @@ ./system-modules/gpg.nix ./system-modules/hardware-configuration.nix ./system-modules/health_reminder.nix - ./system-modules/hsmw.nix ./system-modules/kanata.nix ./system-modules/terminal.nix ./system-modules/kodi.nix ./system-modules/networking.nix ./system-modules/nixd.nix + ./system-modules/nix.nix ./system-modules/nvidia.nix ./system-modules/obs.nix ./system-modules/ollama.nix @@ -42,7 +42,7 @@ ./system-modules/users.nix ./system-modules/virtualisation.nix ./system-modules/ydotool.nix - ] ++ (if (hyper.host == "NxACE") then [ + ] ++ (if hyper.isServer then [ ./system-modules/nx2site.nix ./system-modules/hugo.nix ./system-modules/postgres.nix @@ -58,13 +58,11 @@ ./system-modules/calendar/lec.nix ./system-modules/calendar/lr.nix ./system-modules/calendar/dicos.nix - ] else [ - ]); + ] else [ ]); environment.systemPackages = import ./system-modules/base-packages.nix pkgs; - systemd.extraConfig = "DefaultLimitNOFILE=2048"; - system.stateVersion = hyper.pkgs-version; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + system.stateVersion = hyper.main-pkgs-version; + programs.bash.shellInit = '' if [[ "$USER" == "${hyper.user}" ]]; then source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh diff --git a/flake-modules/allowed.nix b/flake-modules/allowed.nix index f6bee5c..6762484 100644 --- a/flake-modules/allowed.nix +++ b/flake-modules/allowed.nix @@ -1,43 +1,31 @@ -{ - unfree = [ - "antigravity" - "cursor" - "discord" - "spotify" - "obsidian" - "steam" - "steam-unwrapped" - "zoom-us" - "zoom" +pkgs: rec { + predicate = pkg: ( + builtins.elem (pkgs.lib.getName pkg) unfree.packages || builtins.all ( + license: license.free || builtins.elem license.shortName unfree.licenses + ) (if builtins.isList pkg.meta.license then pkg.meta.license else [ pkg.meta.license ]) + ); + unfree = { + packages = [ + "antigravity" + "cursor" + "discord" + "obsidian" + "spotify" + "steam" + "steam-unwrapped" + "vscode-extension-mhutchie-git-graph" + "zoom" + "zoom-us" - "nvidia-x11" - "nvidia-settings" - "nvidia-persistenced" - "cudatoolkit" - "cuda-merged" - "cuda_cuobjdump" - "cuda_gdb" - "cuda_nvcc" - "cuda_nvdisasm" - "cuda_nvprune" - "cuda_cccl" - "cuda_cudart" - "cuda_cupti" - "cuda_cuxxfilt" - "cuda_nvml_dev" - "cuda_nvrtc" - "cuda_nvtx" - "cuda_profiler_api" - "cuda_sanitizer_api" - "libcublas" - "libcufft" - "libcurand" - "libcusolver" - "libnvjitlink" - "libcusparse" - "libnpp" - - "vscode-extension-mhutchie-git-graph" - ]; - insecure = [ ]; + "nvidia-x11" + "nvidia-settings" + ]; + licenses = [ + "CUDA EULA" + "cuDNN EULA" + "cuTENSOR EULA" + "NVidia OptiX EULA" + ]; + }; + # insecure = [ ]; } diff --git a/flake-modules/colors.json b/flake-modules/colors.json index 642be90..79dccee 100644 --- a/flake-modules/colors.json +++ b/flake-modules/colors.json @@ -1,13 +1,41 @@ { - "base": { - "foreground": "#eddbef", - "background": "#100711" + "NxXPS": { + "base": { + "foreground": "#fecccc", + "background": "#190000" + }, + "to_alter": { + "accent": "#ff3232", + "secondary": "#ff3232", + "tertiary": "#ff3232", + "special": "#31feff", + "weird": "#baff31" + } }, - "to_alter": { - "accent": "#ba71c0", - "secondary": "#3266ff", - "tertiary": "#4bb6e6", - "special": "#76c071", - "weird": "#c08571" + "NxACE": { + "base": { + "foreground": "#dddddd", + "background": "#111111" + }, + "to_alter": { + "accent": "#ff6666", + "secondary": "#ff8866", + "tertiary": "#ff6688", + "special": "#8888ff", + "weird": "#88ff66" + } + }, + "NxNORTH": { + "base": { + "foreground": "#ddccfe", + "background": "#080019" + }, + "to_alter": { + "accent": "#7736fb", + "secondary": "#ff5332", + "tertiary": "#f33e8e", + "special": "#b9fb35", + "weird": "#fb3578" + } } } \ No newline at end of file diff --git a/flake-modules/hyper.nix b/flake-modules/hyper.nix new file mode 100644 index 0000000..096d292 --- /dev/null +++ b/flake-modules/hyper.nix @@ -0,0 +1,46 @@ +let hyper-base = rec { + host = "BaseHost"; + system = "x86_64-linux"; + user = "nx2"; + domain = "nx2.site"; + home = "/home/${user}"; + webroot = "/var/lib/hugo/nx2site/public"; + main-pkgs-version = "25.11"; + isServer = false; + isMobile = false; + isPersonal = false; + isNOD = false; + isWorkstation = false; + nvidia = { + enable = false; + prime = false; + }; +}; in host: if host == "NxNORTH" then hyper-base // { inherit host; + nvidia = { + enable = true; + prime = false; + }; + isPersonal = true; + isWorkstation = true; +} else if host == "NxXPS" then hyper-base // { inherit host; + nvidia = { + enable = true; + prime = true; + }; + isMobile = true; + isPersonal = true; + isWorkstation = true; +} else if host == "NxACE" then hyper-base // { inherit host; + isServer = true; +} else if host == "NxDCS" then hyper-base // { inherit host; + isWorkstation = true; + isMobile = true; +} else if host == "NxS23U" then hyper-base // { inherit host; + isMobile = true; + isNOD = true; + isPersonal = true; + main-pkgs-version = "24.05"; + system = "aarch64-linux"; + user = "nix-on-droid"; + home = "/data/data/com.termux.nix/files/home"; +} else assert false "unkown host"; {} \ No newline at end of file diff --git a/flake-modules/nvidia.nix b/flake-modules/nvidia.nix deleted file mode 100644 index b252a7f..0000000 --- a/flake-modules/nvidia.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - enable = false; - prime = false; -} diff --git a/flake-modules/nxlib/ricelib.nix b/flake-modules/nxlib/ricelib.nix new file mode 100644 index 0000000..5d3c65b --- /dev/null +++ b/flake-modules/nxlib/ricelib.nix @@ -0,0 +1,43 @@ +lib: let + # takes in "ff0044" (no hash!) and returns { r = "ff", g = "00", b = "44" } + slice-hex = hex: with builtins; { r = substring 0 2 hex; g = substring 2 2 hex; b = substring 4 2 hex; }; + + # takes in "44" and returns 64 + drune-to-255 = drune: with builtins; (rune-to-num (substring 0 1 drune)) * 16 + (rune-to-num (substring 1 1 drune)); + num-to-drune = num: "${num-to-rune (num / 16)}${num-to-rune (num - ((num / 16) * 16))}"; + + # takes in "D" and returns 13 + # inspiration from https://github.com/bertof/nix-rice + rune-to-num = rune: let + dict = { "0" = 0; "1" = 1; "2" = 2; "3" = 3; "4" = 4; "5" = 5; "6" = 6; "7" = 7; "8" = 8; "9" = 9; "A" = 10; "B" = 11; "C" = 12; "D" = 13; "E" = 14; "F" = 15; }; + in assert(builtins.hasAttr (lib.strings.toUpper rune) dict); builtins.getAttr (lib.strings.toUpper rune) dict; + + # takes in 15 and returns "F" + num-to-rune = num: let + num-string = builtins.toString num; + dict = { "0" = "0"; "1" = "1"; "2" = "2"; "3" = "3"; "4" = "4"; "5" = "5"; "6" = "6"; "7" = "7"; "8" = "8"; "9" = "9"; "10" = "A"; "11" = "B"; "12" = "C"; "13" = "D"; "14" = "E"; "15" = "F"; }; + in assert(builtins.hasAttr num-string dict); builtins.getAttr num-string dict; + + # Keeps num between 0 and 255 + # Make sure to pass in an int not a float + cap-255 = num: (if (num>255) then 255 else if (num<0) then 0 else num); + nohash = hex: with builtins; assert((stringLength hex) == 7); substring 1 6 hex; +in { + ## USEFUL FUNCTIONS + # takes in a string like "#ff0044" and returns "ff0044" symbol + inherit nohash; + + # This takes in something like "#ff0044" and returns "255,0,64" + hex-to-rgb-comma-string = hex: with (slice-hex (nohash hex)); with builtins; assert(isString hex); "${toString (drune-to-255 r)},${toString (drune-to-255 g)},${toString (drune-to-255 b)}"; + + # This is useful if you have a float (like a transparency value) and want a drune representation of it + # So 0.0 -> "00" and 1.0 -> "FF" + float-to-drune = f: with builtins; assert(isFloat f); "${num-to-rune (floor((255*f) / 16))}${num-to-rune (floor(255*f) - (floor((255*f) / 16) * 16))}"; + + # Takes in hex and a float. 0.5 is +50% brightness and (-0.5) is -50% brightness. + # So "#ff0044": 0.3 -> "#ff0055" + alter-luminace-hex = hex: amount: let + color-num = with (slice-hex (nohash hex)); { r = drune-to-255 r; g = drune-to-255 g; b = drune-to-255 b; }; + alter = num: (num-to-drune (cap-255 (builtins.floor ((125 * amount) + (num * (1+amount))) ))); + in with color-num; "#${alter r}${alter g}${alter b}"; +} diff --git a/flake-modules/pkgs.nix b/flake-modules/pkgs.nix new file mode 100644 index 0000000..16970b5 --- /dev/null +++ b/flake-modules/pkgs.nix @@ -0,0 +1,29 @@ +inputs: simple-pkgs: hyper: let + args = { + system = hyper.system; + config = { + allowUnfreePredicate = (import ./allowed.nix simple-pkgs).predicate; + cudaSupport = hyper.nvidia.enable; + cudaForwardCompat = hyper.nvidia.enable; + }; + }; + overlays = [(final: prev: { + unstable = import inputs.nixpkgs-unstable args; + latest = import inputs.nixpkgs-latest args; + pkgs-version = hyper.main-pkgs-version; + })] ++ (if hyper.isServer then [ + inputs.copyparty.overlays.default + ] else []); +in if !hyper.isNOD then + (import inputs.nixpkgs (args // { inherit overlays; })) +else ( + (import inputs.nixpkgs (args // { inherit overlays; })) // # normal as base + (import inputs.nixpkgs24 (args // { # overwrite with old versions + overlays = [(final: prev: { + pkgs-version = "24.05"; + })]; + })) +) + + + diff --git a/flake-modules/rice.nix b/flake-modules/rice.nix index e204622..9489eac 100644 --- a/flake-modules/rice.nix +++ b/flake-modules/rice.nix @@ -1,6 +1,6 @@ -pkgs: rec { +pkgs: hyper: rec { - lib = import ../nxlib/ricelib.nix pkgs.lib; + lib = import ./nxlib/ricelib.nix pkgs.lib; transparency = 0.8; rounding = 3; @@ -36,17 +36,12 @@ pkgs: rec { red = "#dd4444"; # "#dd1111" "#00aa00"; yellow = "#dddd44"; # "#dddd11" "#ffff00"; }; - facolor = builtins.mapAttrs alter-set (builtins.fromJSON (builtins.readFile ./colors.json)).to_alter; - fbcolor = (builtins.fromJSON (builtins.readFile ./colors.json)).base; + facolor = builtins.mapAttrs alter-set (builtins.fromJSON (builtins.readFile ./colors.json))."${hyper.host}".to_alter; + fbcolor = (builtins.fromJSON (builtins.readFile ./colors.json))."${hyper.host}".base; fcolor = facolor // fbcolor; xcolor = with ccolor; with fcolor; { # background = "#000000"; # foreground = "#dddddd"; - # accent = blue; - # secondary = cyan; - # tertiary = magenta; - # special = yellow; - # weird = green; subtle = { darker = "#111111"; dark = "#444444"; base = "#777777"; bright = "#999999"; brighter = "#cccccc"; }; positive = alter "#00dd00"; negative = alter "#dd0000"; @@ -61,8 +56,6 @@ pkgs: rec { regular-path = "${package}/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFont-Regular.ttf"; }; base = { - # name = "NewComputerModern08"; - # package = pkgs.newcomputermodern; name = "Atkinson Hyperlegible"; package = pkgs.atkinson-hyperlegible-next; }; diff --git a/flake.lock b/flake.lock index 9d72a65..40d2a79 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1762356719, - "narHash": "sha256-qwd/xdoOya1m8FENle+4hWnydCtlXUWLAW/Auk6WL7s=", + "lastModified": 1767024902, + "narHash": "sha256-sMdk6QkMDhIOnvULXKUM8WW8iyi551SWw2i6KQHbrrU=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "6d0b3567584691bf9d8fedb5d0093309e2f979c7", + "rev": "b8a0c5ba5a9fbd2c660be7dd98bdde0ff3798556", "type": "github" }, "original": { @@ -39,11 +39,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1763901903, - "narHash": "sha256-w7YsxTjldwhUBP5ypbcZvWyZgRQqp3NBfyk5BAfrFjQ=", + "lastModified": 1768172937, + "narHash": "sha256-abU6yVB1dNW3fuUpXb5fakyY3JAWJdJSUbuM+LnqH2A=", "owner": "9001", "repo": "copyparty", - "rev": "fb9f0441c99833ab7bc035d76b9a89021270675a", + "rev": "9d223d6ca7c49f57dc8b31a511f4f3ee975f2653", "type": "github" }, "original": { @@ -70,15 +70,15 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1747046372, - "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", - "owner": "edolstra", + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", "repo": "flake-compat", - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", "type": "github" }, "original": { - "owner": "edolstra", + "owner": "NixOS", "repo": "flake-compat", "type": "github" } @@ -102,11 +102,11 @@ "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1761588595, - "narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", + "lastModified": 1765121682, + "narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=", "owner": "edolstra", "repo": "flake-compat", - "rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", + "rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3", "type": "github" }, "original": { @@ -220,16 +220,16 @@ ] }, "locked": { - "lastModified": 1758463745, - "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", + "lastModified": 1767910483, + "narHash": "sha256-MOU5YdVu4DVwuT5ztXgQpPuRRBjSjUGIdUzOQr9iQOY=", "owner": "nix-community", "repo": "home-manager", - "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", + "rev": "82fb7dedaad83e5e279127a38ef410bcfac6d77c", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", + "ref": "release-25.11", "repo": "home-manager", "type": "github" } @@ -300,11 +300,11 @@ ] }, "locked": { - "lastModified": 1762462052, - "narHash": "sha256-6roLYzcDf4V38RUMSqycsOwAnqfodL6BmhRkUtwIgdA=", + "lastModified": 1766946335, + "narHash": "sha256-MRD+Jr2bY11MzNDfenENhiK6pvN+nHygxdHoHbZ1HtE=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "ffc999d980c7b3bca85d3ebd0a9fbadf984a8162", + "rev": "4af02a3925b454deb1c36603843da528b67ded6c", "type": "github" }, "original": { @@ -323,17 +323,18 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", + "hyprwire": "hyprwire", "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems", "xdph": "xdph" }, "locked": { - "lastModified": 1763912895, - "narHash": "sha256-1mdM539nkqTWVHTHPCGHGrLu/UwsxeYWnrnHQaUh1qQ=", + "lastModified": 1768144432, + "narHash": "sha256-lLV0egdN9VF6BjhG6GVEVMviFuM05XCv35YNsfLzS9w=", "ref": "refs/heads/main", - "rev": "2b0fd417d32278159d0ca1d23fb997588c37995b", - "revCount": 6643, + "rev": "fbf421df889ceff3bac08a9f4b9493def5eecc4d", + "revCount": 6805, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -377,11 +378,11 @@ ] }, "locked": { - "lastModified": 1762755186, - "narHash": "sha256-ZjjETUHtoEhVN7JI1Cbt3p/KcXpK8ZQaPHx7UkG1OgA=", + "lastModified": 1767023960, + "narHash": "sha256-R2HgtVS1G3KSIKAQ77aOZ+Q0HituOmPgXW9nBNkpp3Q=", "owner": "hyprwm", "repo": "hyprland-guiutils", - "rev": "66356e20a8ed348aa49c1b9ceace786e224225b3", + "rev": "c2e906261142f5dd1ee0bfc44abba23e2754c660", "type": "github" }, "original": { @@ -402,11 +403,11 @@ ] }, "locked": { - "lastModified": 1759610243, - "narHash": "sha256-+KEVnKBe8wz+a6dTLq8YDcF3UrhQElwsYJaVaHXJtoI=", + "lastModified": 1765214753, + "narHash": "sha256-P9zdGXOzToJJgu5sVjv7oeOGPIIwrd9hAUAP3PsmBBs=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "bd153e76f751f150a09328dbdeb5e4fab9d23622", + "rev": "3f3860b869014c00e8b9e0528c7b4ddc335c21ab", "type": "github" }, "original": { @@ -431,11 +432,11 @@ ] }, "locked": { - "lastModified": 1763254292, - "narHash": "sha256-JNgz3Fz2KMzkT7aR72wsgu/xNeJB//LSmdilh8Z/Zao=", + "lastModified": 1764612430, + "narHash": "sha256-54ltTSbI6W+qYGMchAgCR6QnC1kOdKXN6X6pJhOWxFg=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "deea98d5b61d066bdc7a68163edd2c4bd28d3a6b", + "rev": "0d00dc118981531aa731150b6ea551ef037acddd", "type": "github" }, "original": { @@ -483,11 +484,11 @@ ] }, "locked": { - "lastModified": 1762463729, - "narHash": "sha256-2fYkU/mdz8WKY3dkDPlE/j6hTxIwqultsx4gMMsMns0=", + "lastModified": 1764592794, + "narHash": "sha256-7CcO+wbTJ1L1NBQHierHzheQGPWwkIQug/w+fhTAVuU=", "owner": "hyprwm", "repo": "hyprtoolkit", - "rev": "88483bdee5329ec985f0c8f834c519cd18cfe532", + "rev": "5cfe0743f0e608e1462972303778d8a0859ee63e", "type": "github" }, "original": { @@ -508,11 +509,11 @@ ] }, "locked": { - "lastModified": 1763323331, - "narHash": "sha256-+Z0OfCo1MS8/aIutSAW5aJR9zTae1wz9kcJYMgpwN6M=", + "lastModified": 1766253372, + "narHash": "sha256-1+p4Kw8HdtMoFSmJtfdwjxM4bPxDK9yg27SlvUMpzWA=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "0c6411851cc779d551edc89b83966696201611aa", + "rev": "51a4f93ce8572e7b12b7284eb9e6e8ebf16b4be9", "type": "github" }, "original": { @@ -533,11 +534,11 @@ ] }, "locked": { - "lastModified": 1755184602, - "narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=", + "lastModified": 1763640274, + "narHash": "sha256-Uan1Nl9i4TF/kyFoHnTq1bd/rsWh4GAK/9/jDqLbY5A=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d", + "rev": "f6cf414ca0e16a4d30198fd670ec86df3c89f671", "type": "github" }, "original": { @@ -546,6 +547,35 @@ "type": "github" } }, + "hyprwire": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1767473322, + "narHash": "sha256-RGOeG+wQHeJ6BKcsSB8r0ZU77g9mDvoQzoTKj2dFHwA=", + "owner": "hyprwm", + "repo": "hyprwire", + "rev": "d5e7d6b49fe780353c1cf9a1cf39fa8970bd9d11", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwire", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -627,11 +657,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1763738061, - "narHash": "sha256-VpNRcInaj1MOya8NmcqhFmdO7KGO7SSZelJQmPl6HoQ=", + "lastModified": 1765841014, + "narHash": "sha256-55V0AJ36V5Egh4kMhWtDh117eE3GOjwq5LhwxDn9eHg=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "3bcc267c4e0efa023b98b9c5cfbe11b88ec2dc8f", + "rev": "be4af8042e7a61fa12fda58fe9a3b3babdefe17b", "type": "github" }, "original": { @@ -690,11 +720,11 @@ }, "nixpkgs-latest": { "locked": { - "lastModified": 1763929585, - "narHash": "sha256-uxJ8vJoupgc3oJYOK3UV/kbi1f4mXFsh1BuuozhZpfw=", + "lastModified": 1768173486, + "narHash": "sha256-pZhr2gYGPQeL3DaI1oQlqeI7wUE12pf258LLUMgcWSU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a5f13fe8d33e5dd3585980b288366665d35ed379", + "rev": "cb91fd6650df525625bcf15e7cab3ad50f980c7b", "type": "github" }, "original": { @@ -722,11 +752,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1763678758, - "narHash": "sha256-+hBiJ+kG5IoffUOdlANKFflTT5nO3FrrR2CA3178Y5s=", + "lastModified": 1768127708, + "narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "117cc7f94e8072499b0a7aa4c52084fa4e11cc9b", + "rev": "ffbc9f8cbaacfb331b6017d5a5abb21a492c9a38", "type": "github" }, "original": { @@ -753,11 +783,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1763283776, - "narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=", + "lastModified": 1767379071, + "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a", + "rev": "fb7944c166a3b630f177938e478f0378e64ce108", "type": "github" }, "original": { @@ -785,11 +815,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1762977756, - "narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=", + "lastModified": 1765472234, + "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55", + "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b", "type": "github" }, "original": { @@ -801,26 +831,26 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1763622513, - "narHash": "sha256-1jQnuyu82FpiSxowrF/iFK6Toh9BYprfDqfs4BB+19M=", + "lastModified": 1768028080, + "narHash": "sha256-50aDK+8eLvsLK39TzQhKNq50/HcXyP4hyxOYoPoVxjo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c58bc7f5459328e4afac201c5c4feb7c818d604b", + "rev": "d03088749a110d52a4739348f39a63f84bb0be14", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-25.05", + "ref": "nixos-25.11", "type": "indirect" } }, "nixpkgs_6": { "locked": { - "lastModified": 1762286042, - "narHash": "sha256-OD5HsZ+sN7VvNucbrjiCz7CHF5zf9gP51YVJvPwYIH8=", + "lastModified": 1763806073, + "narHash": "sha256-FHsEKDvfWpzdADWj99z7vBk4D716Ujdyveo5+A048aI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12c1f0253aa9a54fdf8ec8aecaafada64a111e24", + "rev": "878e468e02bfabeda08c79250f7ad583037f2227", "type": "github" }, "original": { @@ -894,11 +924,11 @@ ] }, "locked": { - "lastModified": 1763319842, - "narHash": "sha256-YG19IyrTdnVn0l3DvcUYm85u3PaqBt6tI6VvolcuHnA=", + "lastModified": 1767281941, + "narHash": "sha256-6MkqajPICgugsuZ92OMoQcgSHnD6sJHwk8AxvMcIgTE=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "7275fa67fbbb75891c16d9dee7d88e58aea2d761", + "rev": "f0927703b7b1c8d97511c4116eb9b4ec6645a0fa", "type": "github" }, "original": { @@ -980,11 +1010,11 @@ ] }, "locked": { - "lastModified": 1762396738, - "narHash": "sha256-BarSecuxtzp1boERdABLkkoxQTi6s/V33lJwUbWLrLY=", + "lastModified": 1763952169, + "narHash": "sha256-+PeDBD8P+NKauH+w7eO/QWCIp8Cx4mCfWnh9sJmy9CM=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c63598992afd54d215d54f2b764adc0484c2b159", + "rev": "ab726555a9a72e6dc80649809147823a813fa95b", "type": "github" }, "original": { @@ -1016,11 +1046,11 @@ ] }, "locked": { - "lastModified": 1763870012, - "narHash": "sha256-AHxFfIu73SpNLAOZbu/AvpLhZ/Szhx6gRPj9ufZtaZA=", + "lastModified": 1768104471, + "narHash": "sha256-HdnXWQsA1EI27IJlaENUEEug58trUrh6+MT0cFiDHmY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "4e7d74d92398b933cc0e0e25af5b0836efcfdde3", + "rev": "94f9cbd20f680ebb2ad6cdf39da97cbcfaedf004", "type": "github" }, "original": { @@ -1107,11 +1137,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1763600401, - "narHash": "sha256-druDd9HC3UxZSzCY+qaFp9QDCGfzrhv+Zrytia6lJUE=", + "lastModified": 1768129250, + "narHash": "sha256-jsccfsJpyvkZ8dUMR4rS141vnmHT3qh6HtnP+jE2qq4=", "owner": "sxyazi", "repo": "yazi", - "rev": "a08b345a02c6b4c65239a0522f67e77a0132e88b", + "rev": "41e5717930141c574442ecc53bd4db5f96188d50", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 73b015e..89099ee 100644 --- a/flake.nix +++ b/flake.nix @@ -2,33 +2,22 @@ description = "Multisystem NixOS Flake of Lennart J. Kurzweg"; inputs = { - nixpkgs.url = "nixpkgs/nixos-25.05"; + nixpkgs.url = "nixpkgs/nixos-25.11"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-latest.url = "github:nixos/nixpkgs?ref=master"; nixpkgs24.url = "github:NixOS/nixpkgs/nixos-24.05"; - home-manager = { - url = "github:nix-community/home-manager/release-25.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - home-manager24 ={ - url = "github:nix-community/home-manager/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs24"; - }; + home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + home-manager24 = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs24"; }; nix-on-droid = { url = "github:nix-community/nix-on-droid/release-24.05"; - inputs.nixpkgs.follows = "nixpkgs24"; - inputs.home-manager.follows = "home-manager24"; + inputs = { nixpkgs.follows = "nixpkgs24"; home-manager.follows = "home-manager24"; }; }; nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; - sops-nix ={ - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - + sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; lanzaboote.url = "github:nix-community/lanzaboote/v0.4.2"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; @@ -37,101 +26,63 @@ }; outputs = { ... }@inputs: with inputs; let - system = "x86_64-linux"; simple-pkgs = import nixpkgs { inherit system; }; - config = { allowUnfreePredicate = pkg: builtins.elem (simple-pkgs.lib.getName pkg) (import ./flake-modules/allowed.nix).unfree; }; - - hyper-base = rec { - system = "x86_64-linux"; - user = "nx2"; - domain = "nx2.site"; - home = "/home/${user}"; - webroot = "/var/lib/hugo/nx2site/public"; - pkgs-version = "25.05"; - }; - - get-pkgs = let s = system; in { host, system?s, nixpkgs?inputs.nixpkgs, version?"25.05" }: import nixpkgs { - inherit system config; - overlays = [(final: prev: { - unstable = import nixpkgs-unstable { inherit system config; }; - latest = import nixpkgs-latest { inherit system config; }; - inherit version; - })] ++ (if host == "NxACE" then [ - copyparty.overlays.default - ] else []); - }; - - nvidia-base = import ./flake-modules/nvidia.nix; - secrets = import ./git-crypt/secrets.nix; - rice = import ./flake-modules/rice.nix simple-pkgs; + get-pkgs = import ./flake-modules/pkgs.nix inputs simple-pkgs; + get-hyper = import ./flake-modules/hyper.nix; + secrets = import ./git-crypt/secrets.nix; + get-rice = import ./flake-modules/rice.nix simple-pkgs; in { nixosConfigurations = let - make-nixos-system = host: nvidia-settings: nixpkgs.lib.nixosSystem { - pkgs = get-pkgs { inherit host; }; + make-nixos-system = host: let + hyper = get-hyper host; + rice = get-rice hyeper; + in nixpkgs.lib.nixosSystem { + pkgs = get-pkgs hyper; modules = [ ./configuration.nix ]; - specialArgs = let - hyper = hyper-base // { inherit host; nvidia = (nvidia-base // nvidia-settings); }; - in { inherit inputs hyper rice secrets; }; + specialArgs = { inherit inputs hyper rice secrets; }; }; - make-nixos-wsl-system = host: nixpkgs.lib.nixosSystem { - pkgs = get-pkgs { inherit host; }; + make-nixos-wsl-system = host: let hyper = get-hyper host; in nixpkgs.lib.nixosSystem { + pkgs = get-pkgs hyper; modules = [ ./wsl.nix ]; - specialArgs = let - hyper = hyper-base // { inherit host; }; - rice = import ./flake-modules/rice.nix pkgs; - in { inherit inputs hyper rice; }; + specialArgs = { inherit inputs hyper rice; }; }; in { - NxXPS = make-nixos-system "NxXPS" { enable = true; prime = true; }; - NxNORTH = make-nixos-system "NxNORTH" { enable = true; prime = false; }; - NxACE = make-nixos-system "NxACE" { enable = false; }; - NxDCS = make-nixos-wsl-system "NxDCS"; + NxNORTH = make-nixos-system "NxNORTH"; + NxXPS = make-nixos-system "NxXPS"; + NxACE = make-nixos-system "NxACE"; + NxDCS = make-nixos-wsl-system "NxDCS"; }; nixOnDroidConfigurations = let makeNODConfiguration = host: nix-on-droid.lib.nixOnDroidConfiguration rec { - pkgs = let - options = { inherit host; system = "aarch64-linux"; }; - in (get-pkgs options) // - (get-pkgs (options // { version = "24.05"; nixpkgs = nixpkgs24; } ) - ); + hyper = get-hyper host; + pkgs = get-pkgs hyper; modules = [ ./nod.nix ]; home-manager-path = home-manager24.outPath; - extraSpecialArgs = let - hyper = hyper-base // { - inherit host; - system = "aarch64-linux"; - user = "nix-on-droid"; - home = "/data/data/com.termux.nix/files/home"; - pkgs-version = "24.05"; - }; - rice = import ./flake-modules/rice.nix pkgs; - in { inherit inputs hyper rice; }; + extraSpecialArgs = { inherit inputs hyper rice; }; }; in { NxS23U = makeNODConfiguration "NxS23U"; }; homeConfigurations = let - make-home-configuration = host: user: nvidia-settings: home-manager.lib.homeManagerConfiguration { - pkgs = get-pkgs { inherit host; }; + make-home-configuration = host: let + hyper = get-hyper host; + rice = get-rice hyper; + in home-manager.lib.homeManagerConfiguration { + pkgs = get-pkgs hyper; modules = [ ./home.nix ]; - extraSpecialArgs = let - hyper = hyper-base // { inherit host; nvidia = nvidia-base // nvidia-settings; }; - in { inherit inputs hyper rice secrets; }; + extraSpecialArgs = { inherit inputs hyper rice secrets; }; }; - make-shell-configuration = host: user: home-manager.lib.homeManagerConfiguration { - pkgs = get-pkgs { inherit host; }; + make-shell-configuration = host: let hyper = get-hyper host; in home-manager.lib.homeManagerConfiguration { + pkgs = get-pkgs hyper; modules = [ ./shell-only.nix ]; - extraSpecialArgs = let - hyper = hyper-base // { inherit host; }; - in { inherit inputs hyper rice secrets; }; + extraSpecialArgs = { inherit inputs hyper rice secrets; }; }; in { - "${hyper-base.user}@NxXPS" = make-home-configuration "NxXPS" hyper-base.user { enable = true; prime = true; }; - "${hyper-base.user}@NxNORTH" = make-home-configuration "NxNORTH" hyper-base.user { enable = true; prime = false; }; - "${hyper-base.user}@NxACE" = make-home-configuration "NxACE" hyper-base.user { enable = false; }; - - "${hyper-base.user}@NxDCS" = make-shell-configuration "NxDCS" hyper-base.user; + "nx2@NxXPS" = make-home-configuration "NxXPS"; + "nx2@NxNORTH" = make-home-configuration "NxNORTH"; + "nx2@NxACE" = make-home-configuration "NxACE"; + "nx2@NxDCS" = make-shell-configuration "NxDCS"; }; }; } diff --git a/home-modules/bar/caldav-event.nix b/home-modules/bar/caldav-event.nix index 8a7f9ef..aea4782 100644 --- a/home-modules/bar/caldav-event.nix +++ b/home-modules/bar/caldav-event.nix @@ -59,6 +59,8 @@ def get_ongoing_or_next_event(url, username, password): for calendar in calendars: for event in calendar.search(start=now): + if "VEVENT" not in event.data: + continue calendar_parsed = Calendar(event.data) for ics_event in calendar_parsed.events: event_dict = {} @@ -73,7 +75,7 @@ def get_ongoing_or_next_event(url, username, password): return next_event_dict except Exception as e: - print(f"Error accessing {url}: {str(e)[:30]}...") + print(f"Error accessing {url}: {str(e)}".splitlines()[0]) return None def is_expired(event_dict: dict): @@ -120,7 +122,7 @@ if __name__ == "__main__": else: time_string = "in " + hour_string + "and " + minu_string - print(f"\'{event_dict['event_name']}\' {action_string} {time_string}") + print(f"\'{event_dict['event_name']}\' {action_string} {time_string}".splitlines()[0]) '') ]; } diff --git a/home-modules/bash.nix b/home-modules/bash.nix index 3b29227..432c95e 100644 --- a/home-modules/bash.nix +++ b/home-modules/bash.nix @@ -22,7 +22,7 @@ } // pkgs.lib.mkIf (pkgs.version != "24.05") { shellInit = init; - } // pkgs.lib.mkIf (pkgs.version != "25.05") { + } // pkgs.lib.mkIf (pkgs.version != "25.11") { profileExtra = init; }; } diff --git a/home-modules/bitwarden.nix b/home-modules/bitwarden.nix index 31ee03f..b1fbf58 100644 --- a/home-modules/bitwarden.nix +++ b/home-modules/bitwarden.nix @@ -1,6 +1,6 @@ { pkgs, ... }@all: with all; { home.packages = with pkgs; [ - bitwarden + bitwarden-desktop ]; } diff --git a/home-modules/calendar.nix b/home-modules/calendar.nix index e4104ce..b962ccc 100644 --- a/home-modules/calendar.nix +++ b/home-modules/calendar.nix @@ -33,13 +33,13 @@ read-only = true; type = "ics"; } - # { - # name = "LEC"; - # url = "https://${domain}/lec.ics"; - # color = "#A87000"; - # read-only = true; - # type = "ics"; - # } + { + name = "LEC"; + url = "https://${domain}/lec.ics"; + color = "#A87000"; + read-only = true; + type = "ics"; + } { name = "Feiertage Hessen"; url = "https://ics.tools/Feiertage/hessen.ics"; diff --git a/home-modules/chatterino.nix b/home-modules/chatterino.nix index c2370e4..b989a5b 100644 --- a/home-modules/chatterino.nix +++ b/home-modules/chatterino.nix @@ -7,18 +7,19 @@ let # "Caedrel" # "EintrachtSpandau" # "GamesDoneQuick" - "Odoamne" + # "Odoamne" "iwdominate" - "imls" + # "imls" "gdolphn" "GRONKH" "handofblood" "HisWattson" - "Jankos" + # "Jankos" # "KuruHS" "LEC" "lol_nemesis" # "NASA" + "nattynattlol" "NoWay4u_Sir" # "OfficialMikeShinoda" "Rekkles" @@ -191,7 +192,7 @@ in { }, "misc": { "askOnTabVisibilityToggle": false, - "currentVersion": "2.5.3", + "currentVersion": "2.5.4", "lockNotebookLayout": false }, "similarity": { diff --git a/home-modules/email.nix b/home-modules/email.nix index a5e2b71..9c3150e 100644 --- a/home-modules/email.nix +++ b/home-modules/email.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }@all: with all; -lib.mkIf (hyper.host != "NxACE") -{ +{ pkgs, ... }@all: with all; lib.mkIf (hyper.isPersonal) { home.packages = with pkgs; [ thunderbird ]; @@ -136,36 +134,22 @@ lib.mkIf (hyper.host != "NxACE") settings = OAuth2Settings; }; }; - - # hsmw = with secrets.email.hsmw; { - # address = "${un}@hs-mittweida.de"; - # userName = "${un}@hs-mittweida.de"; + # pnx-nix = { + # address = secrets.email.pnx.mail; # realName = "Lennart J. Kurzweg"; - # imap = { - # port = 993; - # host = "xc.hs-mittweida.de"; - # }; - # smtp = { - # port = 587; - # host = "xc.hs-mittweida.de"; - # tls.useStartTls = true; - # }; + # flavor = "outlook.office365.com"; # signature = { # text = '' - # MatNr: ${mnr} - # SemGr: ${semgr} - # About Me: https://nx2.site/about-me - # Contact: https://nx2.site/contact - # GPG: https://nx2.site/gpg + # Phönix Metallbau GmbH + # Tel: 036374 2270 # ''; # showSignature = "append"; # }; - # thunderbird = { + # thunderbird = mkIf config.thunderbird.enable { # enable = true; # profiles = [ "nx2" ]; - # settings = id: { - # "mail.server.server_${id}.fcc_folder" = "imap://${un}%40hs-mittweida.de@xc.hs-mittweida.de/Sent"; - # }; + # # The id given as argument is an automatically generated account identifier. + # # settings = OAuth2Settings; # }; # }; tuda = with secrets.email.tuda; { @@ -205,3 +189,35 @@ lib.mkIf (hyper.host != "NxACE") + +# hsmw = with secrets.email.hsmw; { +# address = "${un}@hs-mittweida.de"; +# userName = "${un}@hs-mittweida.de"; +# realName = "Lennart J. Kurzweg"; +# imap = { +# port = 993; +# host = "xc.hs-mittweida.de"; +# }; +# smtp = { +# port = 587; +# host = "xc.hs-mittweida.de"; +# tls.useStartTls = true; +# }; +# signature = { +# text = '' +# MatNr: ${mnr} +# SemGr: ${semgr} +# About Me: https://nx2.site/about-me +# Contact: https://nx2.site/contact +# GPG: https://nx2.site/gpg +# ''; +# showSignature = "append"; +# }; +# thunderbird = { +# enable = true; +# profiles = [ "nx2" ]; +# settings = id: { +# "mail.server.server_${id}.fcc_folder" = "imap://${un}%40hs-mittweida.de@xc.hs-mittweida.de/Sent"; +# }; +# }; +# }; diff --git a/home-modules/firefox/userContent.nix b/home-modules/firefox/userContent.nix index 4fa10d9..27aa2f8 100644 --- a/home-modules/firefox/userContent.nix +++ b/home-modules/firefox/userContent.nix @@ -122,7 +122,7 @@ in /* css */ '' background-color: transparent !important; } header, footer { - background-color: rgba(0,0,0,1) !important; + background-color: rgba(0,0,0,0.5) !important; backdrop-filter: blur(100px); border-radius: ${builtins.toString rice.rounding}px; } diff --git a/home-modules/fish.nix b/home-modules/fish.nix index d0d419d..6978e6f 100644 --- a/home-modules/fish.nix +++ b/home-modules/fish.nix @@ -115,7 +115,7 @@ ''; nx_backup = let destination = if hyper.host == "NxNORTH" then "${hyper.home}/shared/" else "${hyper.home}/backups/"; - in pkgs.lib.mkIf (hyper.host == "NxXPS" || hyper.host == "NxNORTH") '' + in pkgs.lib.mkIf (hyper.isPersonal) '' set RPATH (curl -s https://${hyper.domain}/latest-backup) rsync -avz --info=progress2 -e "ssh -p ${builtins.toString secrets.ssh.port}" ${hyper.user}@ssh.${hyper.domain}:"$RPATH" ${destination} ''; diff --git a/home-modules/gimp.nix b/home-modules/gimp.nix index d9eee52..c520a61 100644 --- a/home-modules/gimp.nix +++ b/home-modules/gimp.nix @@ -1,9 +1,5 @@ -{ pkgs, ... }@all: with all; -{ +{ pkgs, ... }@all: with all; { home.packages = with pkgs; [ - # (gimp-with-plugins.override { - # plugins = with gimpPlugins; [ bimp ]; - # }) gimp ]; } diff --git a/home-modules/git.nix b/home-modules/git.nix index 7cd99ae..bcc890b 100644 --- a/home-modules/git.nix +++ b/home-modules/git.nix @@ -5,13 +5,27 @@ (writeShellScriptBin "gst" "awk -vOFS='' 'NR==FNR {all[i++] = $0; difffiles[$1] = $0; next;} ! ($2 in difffiles) {print; next;} {gsub($2, difffiles[$2]); print;} END {if (NR != FNR) {exit;} for (i in all) {print all[i];}}' <(git diff --color --stat=$(($(tput cols) - 3)) HEAD | sed '$d; s/^ //') <(git -c color.status=always status -sb)") ]; - programs.git = { - enable = true; - package = pkgs.gitFull; - userName = ''Lennart J. Kurzweg (Nx2)''; - userEmail = "git@${hyper.domain}"; + programs = { + git = { + enable = true; + package = pkgs.gitFull; + settings = { + user = { + Name = ''Lennart J. Kurzweg (Nx2)''; + Email = "git@${hyper.domain}"; + }; + credential = { + "https://git.da.dicos.de".username = lib.mkIf (hyper.host == "NxDCS") "lkurzweg"; + "https://git.da.dicos.de".password = lib.mkIf (hyper.host == "NxDCS") "Test"; + }; + url."ssh://git@git.da.dicos.de/".insteadOf = lib.mkIf (hyper.host == "NxDCS") "https://git.da.dicos.de/"; + url."ssh://git@github.com/".insteadOf = "https://github.com/"; + pull.rebase = false; # true + }; + }; delta = { enable = true; + enableGitIntegration = true; options = { line-numbers = true; side-by-side = false; @@ -19,36 +33,27 @@ whitespace-error-style = "22 reverse"; }; }; - extraConfig = { - credential = { - "https://git.da.dicos.de".username = lib.mkIf (hyper.host == "NxDCS") "lkurzweg"; - "https://git.da.dicos.de".password = lib.mkIf (hyper.host == "NxDCS") "Test"; - }; - url."ssh://git@git.da.dicos.de/".insteadOf = lib.mkIf (hyper.host == "NxDCS") "https://git.da.dicos.de/"; - url."ssh://git@github.com/".insteadOf = "https://github.com/"; - pull.rebase = false; # true - }; - }; - programs.lazygit = { - enable = true; - package = pkgs.lazygit; - settings = { - windowSize = "normal"; - gui.theme = with rice.color; { - lightTheme = false; - activeBorderColor = [ foreground "bold" ]; - inactiveBorderColor = [ border ]; - optionsTextColor = [ tertiary.base ]; - selectedLineBgColor = [ secondary.base ]; - selectedRangeByColor = [ weird.bright ]; - showRandomTip = true; - animateExplosion = true; - cherryPickedCommitFgColor = [ accent.base ]; # Foreground color of copied commit - cherryPickedCommitBgColor = [ secondary.dark ]; # Background color of copied commit - markedBaseCommitFgColor = [ accent.base ]; # Foreground color of marked base commit (for rebase) - markedBaseCommitBgColor = [ secondary.dark ]; # Background color of marked base commit (for rebase) - unstagedChangesColor = [ negative.base ]; # Color for file with unstaged changes - defaultFgColor = [ "default" ]; # Default text color + lazygit = { + enable = true; + package = pkgs.lazygit; + settings = { + windowSize = "normal"; + gui.theme = with rice.color; { + lightTheme = false; + activeBorderColor = [ foreground "bold" ]; + inactiveBorderColor = [ border ]; + optionsTextColor = [ tertiary.base ]; + selectedLineBgColor = [ secondary.base ]; + selectedRangeByColor = [ weird.bright ]; + showRandomTip = true; + animateExplosion = true; + cherryPickedCommitFgColor = [ accent.base ]; # Foreground color of copied commit + cherryPickedCommitBgColor = [ secondary.dark ]; # Background color of copied commit + markedBaseCommitFgColor = [ accent.base ]; # Foreground color of marked base commit (for rebase) + markedBaseCommitBgColor = [ secondary.dark ]; # Background color of marked base commit (for rebase) + unstagedChangesColor = [ negative.base ]; # Color for file with unstaged changes + defaultFgColor = [ "default" ]; # Default text color + }; }; }; }; diff --git a/home-modules/gpg.nix b/home-modules/gpg.nix index 4980f1b..16d763e 100644 --- a/home-modules/gpg.nix +++ b/home-modules/gpg.nix @@ -1,5 +1,10 @@ { pkgs, ... }@all: with all; { - home.packages = with pkgs; [ pinentry-all ]; + home.packages = with pkgs; [ + # pinentry-all + # pinentry-curses + pinentry-gtk2 + # pinentry-tty + ]; programs.gpg = { enable = true; package = pkgs.gnupg; diff --git a/home-modules/helix.nix b/home-modules/helix.nix index 6287875..43213d3 100644 --- a/home-modules/helix.nix +++ b/home-modules/helix.nix @@ -212,7 +212,8 @@ } { name = "typst"; - language-servers = [ "language-tool" "tinymist" ]; + language-servers = [ "tinymist" ]; + # language-servers = [ "language-tool" "tinymist" ]; } { name = "markdown"; @@ -298,7 +299,7 @@ base16 = with rice.color; { "attributes" = foreground; "comment" = { - fg = black.bright; + fg = subtle.base; modifiers = [ "italic" ]; }; "constant" = accent.bright; @@ -307,7 +308,7 @@ "constructor" = weird.base; "debug" = yellow.base; "diagnostic.modifiers" = [ "underline" ]; - "diff.delta" = blue.bright; + "diff.delta" = subtle.bright; "diff.minus" = negative.bright; "diff.plus" = positive.bright; "error" = red.base; @@ -404,13 +405,13 @@ bg = black.base; }; "ui.selection" = { - bg = white.dark; + bg = accent.dark; }; "ui.selection.primary" = { - bg = black.bright; + bg = accent.dark; }; "ui.statusline" = { - fg = blue.bright; + fg = accent.bright; bg = black.base; }; "ui.statusline.inactive" = { diff --git a/home-modules/hyprland.nix b/home-modules/hyprland.nix index 127f811..7569512 100644 --- a/home-modules/hyprland.nix +++ b/home-modules/hyprland.nix @@ -185,19 +185,27 @@ in { ]; }; - gestures = { - workspace_swipe = true; - workspace_swipe_fingers = "4"; - workspace_swipe_distance = "300"; - workspace_swipe_invert = true; - workspace_swipe_min_speed_to_force = "30"; - workspace_swipe_cancel_ratio = "0.5"; - workspace_swipe_create_new = false; - workspace_swipe_direction_lock = false; - workspace_swipe_direction_lock_threshold = "10"; - workspace_swipe_forever = true; - workspace_swipe_use_r = false; - }; + # gestures = { + # workspace_swipe = true; + # workspace_swipe_fingers = "4"; + # workspace_swipe_distance = "300"; + # workspace_swipe_invert = true; + # workspace_swipe_min_speed_to_force = "30"; + # workspace_swipe_cancel_ratio = "0.5"; + # workspace_swipe_create_new = false; + # workspace_swipe_direction_lock = false; + # workspace_swipe_direction_lock_threshold = "10"; + # workspace_swipe_forever = true; + # workspace_swipe_use_r = false; + # }; + + + gesture = [ + "4, horizontal, workspace" + # "3, down, mod: ALT, close" + # "3, up, mod: SUPER, scale: 1.5, fullscreen" + # "3, left, scale: 1.5, float" + ]; dwindle = { preserve_split = true; # you probably want this @@ -278,7 +286,7 @@ in { "dimaround, title:^(terminal-file-picker)$" "center, title:^(terminal-file-picker)$" "size 80% 80%, title:^(terminal-file-picker)$" - "size: 30% 30%, initialTitle:^(Select Calendar)$" + "size 30% 30%, initialTitle:^(Select Calendar)$" ]; diff --git a/home-modules/latex.nix b/home-modules/latex.nix index 6511849..e9bba57 100644 --- a/home-modules/latex.nix +++ b/home-modules/latex.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }@all: with all; -lib.mkIf (hyper.host != "NxACE") -{ +{ pkgs, ... }@all: with all; { home.packages = with pkgs; [ texlab # LSP (texlive.combine { inherit (texlive) scheme-full xifthen ifmtarg framed paralist titlesec xcolor; }) diff --git a/home-modules/mpv.nix b/home-modules/mpv.nix index 9e1b7e8..1f20f12 100644 --- a/home-modules/mpv.nix +++ b/home-modules/mpv.nix @@ -32,9 +32,11 @@ thumbfast # thumbnails on timeline hover # uosc # custom ui sponsorblock + # visualizer ]; bindings = { "O" = ''no-osd cycle-values glsl-shaders "~~/shaders/invert.glsl" ""; show-text "Invert Shader"''; + "F5" = ''set contrast 0;set brightness 0;set gamma 0;set saturation 0;set hue 0;set sub-pos 100;set sub-scale 1;set panscan 0;set zoom 0;show-text default''; # "tab" = ''script-binding uosc/toggle-ui''; # "space" = ''cycle pause; script-binding uosc/flash-pause-indicator''; # "right" = ''seek 5''; diff --git a/home-modules/nx2site-backup.nix b/home-modules/nx2site-backup.nix index c12dc73..d3c23e5 100644 --- a/home-modules/nx2site-backup.nix +++ b/home-modules/nx2site-backup.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }@all: with all; -{ +{ pkgs, ... }@all: with all; { home.packages = [ (pkgs.writeShellApplication { name = "nx_backup"; diff --git a/home-modules/opencode.nix b/home-modules/opencode.nix index eb4f557..cb43e0e 100644 --- a/home-modules/opencode.nix +++ b/home-modules/opencode.nix @@ -1,29 +1,60 @@ { pkgs, ... }@all: with all; { - home = { - packages = with pkgs; [ - unstable.opencode - ]; - # file.".config/opencode/opencode.json".text = let - # model = "qwen2.5-coder:7b"; - # in builtins.toJSON { - # "$schema" = "https://opencode.ai/config.json"; - # model = "ollama/${model}"; - # theme = "matrix"; - # provider = { - # ollama = { - # name = "Ollama (local)"; - # npm = "@ai-sdk/openai-compatible"; - # options = { - # baseURL = "http://localhost:11434/v1"; - # }; - # models = { - # "${model}" = { - # tools = true; - # }; - # }; - # }; - # }; - # }; - }; + programs.opencode = { + enable = true; + package = pkgs.opencode; + themes.theme = with rice.color; let + dl = color: { dark = color; light = color; }; + in { + accent = dl accent.base; + background = dl background; + backgroundElement = dl subtle.dark; + backgroundPanel = dl subtle.darker; + border = dl subtle.base; + borderActive = dl border; + borderSubtle = dl subtle.dark; + diffAdded = dl positive.base; + diffAddedBg = dl positive.darker; + diffAddedLineNumberBg = dl positive.dark; + diffContext = dl foreground; + diffContextBg = dl subtle.dark; + diffHighlightAdded = dl positive.bright; + diffHighlightRemoved = dl negative.bright; + diffHunkHeader = dl foreground; + diffLineNumber = dl subtle.base; + diffRemoved = dl negative.base; + diffRemovedBg = dl negative.darker; + diffRemovedLineNumberBg = dl negative.dark; + error = dl negative.dark; + info = dl special.base; + markdownBlockQuote = dl accent.base; + markdownCode = dl secondary.base; + markdownCodeBlock = dl secondary.base; + markdownEmph = dl accent.base; + markdownHeading = dl accent.base; + markdownHorizontalRule = dl border; + markdownImage = dl accent.base; + markdownImageText = dl accent.bright; + markdownLink = dl accent.base; + markdownLinkText = dl accent.bright; + markdownListEnumeration = dl foreground; + markdownListItem = dl foreground; + markdownStrong = dl accent.base; + markdownText = dl foreground; + primary = dl accent.base; + secondary = dl secondary.base; + success = dl positive.base; + syntaxComment = dl subtle.base; + syntaxFunction = dl accent.base; + syntaxKeyword = dl special.base; + syntaxNumber = dl tertiary.base; + syntaxOperator = dl accent.base; + syntaxPunctuation = dl foreground; + syntaxString = dl accent.base; + syntaxType = dl tertiary.base; + syntaxVariable = dl accent.base; + text = dl foreground; + textMuted = dl subtle.bright; + warning = dl weird.base; + }; + }; } - diff --git a/home-modules/pkgs-list/desktop.nix b/home-modules/pkgs-list/desktop.nix index f547585..e07ae95 100644 --- a/home-modules/pkgs-list/desktop.nix +++ b/home-modules/pkgs-list/desktop.nix @@ -14,5 +14,6 @@ wl-clipboard xclip wlr-randr + cava ]; } diff --git a/home-modules/pkgs-list/programs.nix b/home-modules/pkgs-list/programs.nix index e08b467..3259da7 100644 --- a/home-modules/pkgs-list/programs.nix +++ b/home-modules/pkgs-list/programs.nix @@ -1,21 +1,23 @@ { pkgs, hyper, ... }: { - home.packages = with pkgs; [ + home.packages = (with pkgs; [ chromium gnome-clocks gnome-calculator gnome-characters gnome-2048 - element-desktop qbittorrent wl-clipboard xfce.thunar - ] ++ (if (hyper.host != "NxACE") then [ + ]) ++ (if hyper.isWorkstation then (with pkgs; [ signal-desktop unstable.code-cursor-fhs latest.antigravity + element-desktop obsidian zoom-us inkscape audacity - ] else []); + gemini-cli + libreoffice + ]) else []); } diff --git a/home-modules/pkgs-list/shell.nix b/home-modules/pkgs-list/shell.nix index 8b394d8..8bc5589 100644 --- a/home-modules/pkgs-list/shell.nix +++ b/home-modules/pkgs-list/shell.nix @@ -5,7 +5,7 @@ cmake cmatrix dig - du-dust + dust dysk exiftool eza diff --git a/home-modules/programming.nix b/home-modules/programming.nix index 886de76..e4a4c21 100644 --- a/home-modules/programming.nix +++ b/home-modules/programming.nix @@ -1,7 +1,7 @@ { ... }: { imports = [ ./programming/c.nix - ./programming/gleam.nix + # ./programming/gleam.nix ./programming/glsl.nix ./programming/go.nix ./programming/java.nix diff --git a/home-modules/programming/gleam.nix b/home-modules/programming/gleam.nix index 93b1594..9c9ce58 100644 --- a/home-modules/programming/gleam.nix +++ b/home-modules/programming/gleam.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }@all: with all; -lib.mkIf (hyper.host != "NxACE") -{ +{ pkgs, ... }@all: with all; { home.packages = with pkgs; [ erlang rebar3 diff --git a/home-modules/programming/go.nix b/home-modules/programming/go.nix index dfa53d1..e5c3ac5 100644 --- a/home-modules/programming/go.nix +++ b/home-modules/programming/go.nix @@ -2,6 +2,6 @@ programs.go = { enable = true; package = pkgs.go; - goPath = "${config.xdg.dataHome}/go"; + env.goPath = "${config.xdg.dataHome}/go"; }; } diff --git a/home-modules/programming/python.nix b/home-modules/programming/python.nix index e55c140..7a7b76d 100644 --- a/home-modules/programming/python.nix +++ b/home-modules/programming/python.nix @@ -1,10 +1,9 @@ -{ pkgs, ... }@all: with all; -{ +{ pkgs, ... }@all: with all; { home = let python-with-packages = pkgs.python3.withPackages (pp: with pp; [ ipython requests - debugpy + # debugpy black uv uv-build @@ -13,7 +12,7 @@ packages = [ python-with-packages ] ++ (with pkgs; [ - python311Packages.python-lsp-server + python313Packages.python-lsp-server ruff pyright ]); diff --git a/home-modules/programming/rust.nix b/home-modules/programming/rust.nix index d00e5dd..e45440a 100644 --- a/home-modules/programming/rust.nix +++ b/home-modules/programming/rust.nix @@ -1,6 +1,7 @@ { pkgs, ... }@all: with all; { home = { packages = with pkgs; [ + gdb cargo clippy rustc diff --git a/home-modules/rofi.nix b/home-modules/rofi.nix index 8121300..ef0eb68 100644 --- a/home-modules/rofi.nix +++ b/home-modules/rofi.nix @@ -1,6 +1,6 @@ { pkgs, ... }@all: with all; { home = { - packages = with pkgs; [ rofi-wayland ]; + packages = with pkgs; [ rofi ]; file = let # the home-manager module sucks trdr = "${rice.lib.float-to-drune rice.transparency}"; ts = builtins.toString; diff --git a/home-modules/ssh.nix b/home-modules/ssh.nix index c34df5e..7bf978b 100644 --- a/home-modules/ssh.nix +++ b/home-modules/ssh.nix @@ -3,31 +3,39 @@ programs.ssh = { enable = true; package = pkgs.openssh; - addKeysToAgent = "yes"; + enableDefaultConfig = false; matchBlocks = let - nxace = name: { + default = { + addKeysToAgent = "yes"; + forwardAgent = false; + compression = false; + serverAliveInterval = 0; + serverAliveCountMax = 3; + hashKnownHosts = false; + userKnownHostsFile = "~/.ssh/known_hosts"; + controlMaster = "no"; + controlPath = "~/.ssh/master-%r@%n:%p"; + controlPersist = "no"; + }; + nxace = name: default // { host = name; hostname = "ssh.${hyper.domain}"; user = "nx2"; port = 50022; - identityFile = "${hyper.home}/vault/ssh/nxace-nx2-${hyper.host}"; + identityFile = [ "${hyper.home}/vault/ssh/nxace-nx2-${hyper.host}" ]; }; in { - "*".identityFile = [ + "*" = default; + "ssh.nx2.site" = default // { identityFile = [ "${hyper.home}/vault/ssh/nxgit-nx2-${hyper.host}" - "${hyper.home}/vault/ssh/github-noggynoggy-${hyper.host}" - "${hyper.home}/vault/ssh/tg-dm-informatik-tuda" - (pkgs.lib.mkIf (hyper.host == "NxDCS") "${hyper.home}/vault/ssh/dcsgit-lkurzweg-${hyper.host}") - ]; - "github.com".identityFile = [ "${hyper.home}/vault/ssh/github-noggynoggy-${hyper.host}" ]; - "nxace" = nxace "nxace"; - "nxacel" = (nxace "nxacel") // { hostname = "10.0.1.1"; }; - "nxrpli" = (nxace "nxrpil") // { hostname = "10.0.1.31"; port = 22; }; - "nxgit" = (nxace "nxgit") // { - user = "git"; - identityFile = "${hyper.home}/vault/ssh/nxgit-nx2-${hyper.host}"; - # addKeysToAgent = "1h"; - }; + "${hyper.home}/vault/ssh/nxace-nx2-${hyper.host}" + ]; }; + "tg.dm.informatik.tu-darmstadt.de" = default // { identityFile = [ "${hyper.home}/vault/ssh/tg-dm-informatik-tuda" ]; }; + "git.da.dicos.de" = default // { identityFile = [ "${hyper.home}/vault/ssh/dcsgit-lkurzweg-${hyper.host}" ]; }; + "github.com" = default // { identityFile = [ "${hyper.home}/vault/ssh/github-noggynoggy-${hyper.host}" ]; }; + "nxace" = (nxace "nxace" ); + "nxacel" = (nxace "nxacel") // { hostname = "10.0.1.1"; }; + "nxrpli" = (nxace "nxrpil") // { hostname = "10.0.1.31"; port = 22; }; }; }; services.ssh-agent = { diff --git a/home-modules/wallpaper-to-colors.nix b/home-modules/wallpaper-to-colors.nix index 6f042b4..c4df971 100644 --- a/home-modules/wallpaper-to-colors.nix +++ b/home-modules/wallpaper-to-colors.nix @@ -1,8 +1,8 @@ { pkgs, ... }@all: with all; { - home.packages = with pkgs; [ - (writers.writePython3Bin "change_colors_json" { - libraries = with python3Packages; [ numpy pillow scikit-learn ]; + home.packages = [ + (pkgs.writers.writePython3Bin "change_colors_json" { + libraries = with pkgs.python3Packages; [ numpy pillow scikit-learn ]; flakeIgnore = [ "E302" "E305" "E226" "E501" ]; } /*python */ '' from colorsys import hls_to_rgb, rgb_to_hls @@ -141,7 +141,10 @@ foreground = alter_l(accent, 0.9) background = alter_l(accent, 0.05) - d = { + with open("${hyper.home}/nix-dots/flake-modules/colors.json", "r") as f: + full_d = json.load(f) + + full_d['${hyper.host}'] = { "base": { "foreground": list_to_hex(foreground), "background": list_to_hex(background) @@ -155,8 +158,8 @@ } } - with open("/home/nx2/nix-dots/flake-modules/colors.json", "w") as f: - f.write(json.dumps(d, indent=4)) + with open("${hyper.home}/nix-dots/flake-modules/colors.json", "w") as f: + f.write(json.dumps(full_d, indent=4)) '') ]; } diff --git a/home-modules/yazi.nix b/home-modules/yazi.nix index 4bc11cd..9947cd6 100644 --- a/home-modules/yazi.nix +++ b/home-modules/yazi.nix @@ -1,5 +1,5 @@ { pkgs, ... }@all: with all; let - nox-var = (pkgs.version != "24.05"); + nox-var = (pkgs.pkgs-version != "24.05"); tfc = pkgs.unstable.xdg-desktop-portal-termfilechooser; in { home.packages = [ @@ -47,7 +47,7 @@ in { { on = [ "g" "t" ]; run = "cd /tmp"; desc = "Go to the /tmp directory"; } { on = [ "g" "v" ]; run = "cd ~/Videos"; desc = "Go to the Videos directory"; } { on = [ "g" "" ]; run = "cd --interactive"; desc = "Go to a directory interactively"; } - (pkgs.lib.mkIf (hyper.host == "NxACE") { on = [ "g" "s" ]; run = "cd /var/lib/hugo/nx2site"; desc = "Go to the Hugo Nx2.Site directory"; }) + (pkgs.lib.mkIf (hyper.isServer) { on = [ "g" "s" ]; run = "cd /var/lib/hugo/nx2site"; desc = "Go to the Hugo Nx2.Site directory"; }) # Navigation { on = "h"; run = "leave"; desc = "Go back to the parent directory"; } { on = "l"; run = "enter"; desc = "Enter the child directory"; } @@ -160,6 +160,9 @@ in { { on = ""; run = "spot"; desc = "Show Spot View"; } # Tasks { on = "w"; run = "tasks:show"; desc = "Show Task View"; } + # Magic + { on = ""; run = "shell 'hx .' --block"; desc = "Open current directoy in Helix"; } + { on = ""; run = "shell 'lazygit' --block"; desc = "Open current directoy in Lazygit"; } ]; tasks.keymap = [ # Task @@ -206,64 +209,62 @@ in { }; opener = { "edit" = [ - { run = ''hx "$0" "$@"''; desc = "Helix"; block = true; } - { run = ''codium "$0" "$@"''; desc = "VS Code"; orphan = true; } - { run = ''antigravity "$0" "$0"''; desc = "Antigravity"; orphan = true; } - { run = ''cat "$0" "$@" | wl-copy''; desc = "Copy Contents"; } + { run = ''hx "$@"''; desc = "Helix"; block = true; } + { run = ''codium "$@"''; desc = "VS Code"; orphan = true; } + { run = ''cat "$@" | wl-copy''; desc = "Copy Contents"; } ]; "play" = [ - { run = ''mpv "$0" "$@"''; desc = "mpv"; orphan = true; } - { run = ''mpv --vf=negate "$0" "$@"''; desc = "mpv inverted"; orphan = true; } - { run = ''mediainfo "$0"; echo "Press enter to return to yazi"; read''; block = true; desc = "Show mediainfo"; } + { run = ''mpv "$@"''; desc = "MPV"; orphan = true; } + { run = ''mpv --vf=negate "$@"''; desc = "MPV inverted"; orphan = true; } + { run = ''mediainfo "$1"; echo "Press enter to return to yazi"; read''; block = true; desc = "Show mediainfo"; } ]; "archive" = [ - { run = ''unar "$0" "$@"''; desc = "Extract here"; } - { run = ''tar -x "$0" "$@"''; desc = "tar -x"; } - { run = ''unzip "$0" "$@"''; desc = "unzip"; } + { run = ''unar "$@"''; desc = "Extract here"; } + { run = ''tar -x "$@"''; desc = "tar -x"; } + { run = ''unzip "$@"''; desc = "unzip"; } ]; "image" = [ - { run = ''imv "$0" "$@"''; desc = "imv"; orphan = true; } - { run = ''gimp "$0" "$@"''; desc = "gimp"; orphan = true; } - { run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$@"''; desc = "swww wallpaper"; } - { run = ''exiftool "$0"; echo "Press enter to return to yazi"; read''; desc = "View Exif Data"; } - { run = ''for f in "$0"; do magick "$f" -auto-orient "''${f%.*}.pdf"; done''; desc = "Convert to PDF"; } + { run = ''imv "$@"''; desc = "IMV"; orphan = true; } + { run = ''gimp "$@"''; desc = "Gimp"; orphan = true; } + { run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$1"''; desc = "swww wallpaper"; } + { run = ''exiftool "$1"; echo "Press enter to return to yazi"; read''; desc = "View Exif Data"; } + { run = ''for f in "$1"; do magick "$f" -auto-orient "''${f%.*}.pdf"; done''; desc = "Convert to PDF"; } ]; "svg" = [ - { run = ''inkscape "$0" "$@"''; desc = "inkscape"; orphan = true; } - { run = ''firefox "$0" "$@"''; desc = "firefox"; orphan = true; } + { run = ''inkscape "$@"''; desc = "Inkscape"; orphan = true; } + { run = ''firefox "$@"''; desc = "Firefox"; orphan = true; } ]; "font" = [ - { run = ''fontpreview "$0" "$@"''; desc = "fontpreview"; orphan = true; } - { run = ''fontforge "$0" "$@"''; desc = "fortforge"; orphan = true; } + { run = ''fontpreview "$@"''; desc = "Fontpreview"; orphan = true; } + { run = ''fontforge "$@"''; desc = "Fortforge"; orphan = true; } ]; "document" = [ - { run = ''zathura "$0" "$@"''; desc = "zathura"; orphan = true; } - { run = ''xournal "$0" "$@"''; desc = "xournal"; orphan = true; } - { run = ''firefox "$0" "$@"''; desc = "firefox"; orphan = true; } - { run = ''nxgs flip "$0" "$@"''; desc = "nxgs flip"; } - { run = ''nxgs rotate "$0" "$@"''; desc = "nxgs rotate"; } - { run = ''nxgs interactive-merge "$0" "$@"''; block = true; desc = "nxgs merge"; } + { run = ''zathura "$@"''; desc = "Zathura"; orphan = true; } + { run = ''firefox "$@"''; desc = "Firefox"; orphan = true; } + { run = ''nxgs flip "$@"''; desc = "nxgs flip"; } + { run = ''nxgs rotate "$@"''; desc = "nxgs rotate"; } + { run = ''nxgs interactive-merge "$@"''; block = true; desc = "nxgs merge"; } ]; "browser" = [ - { run = ''firefox "$0" "$@"''; desc = "firefox"; orphan = true; } - { run = ''chromium --enable-features=UseOzonePlatform --ozone-platform=wayland "$0" "$@"''; desc = "chromium"; orphan = true; } - { run = ''w3m "$0" "$@"''; desc = "w3m"; } - { run = ''lynx "$0" "$@"''; desc = "lynx"; } + { run = ''firefox "$@"''; desc = "Firefox"; orphan = true; } + { run = ''chromium --enable-features=UseOzonePlatform --ozone-platform=wayland "$@"''; desc = "Chromium"; orphan = true; } + { run = ''w3m "$@"''; desc = "w3m"; } + { run = ''lynx "$@"''; desc = "Lynx"; } ]; "office" = [ - { run = ''libreoffice "$0" "$@"''; desc = "libreoffice"; orphan = true; } - { run = ''libreoffice --view "$0" "$@"''; desc = "libreoffice read-only"; orphan = true; } + { run = ''libreoffice "$@"''; desc = "LibreOffice"; orphan = true; } + { run = ''libreoffice --view "$@"''; desc = "LibreOffice read-only"; orphan = true; } ]; "shell" = [ - { run = ''bash -c "$0"; echo "Press enter to return to yazi"; read''; desc = "bash -c"; } - { run = ''fish -c "$0"; echo "Press enter to return to yazi"; read''; desc = "fish -c"; } - { run = ''sh -c "$0"; echo "Press enter to return to yazi"; read''; desc = "sh -c"; } + { run = ''bash -c "$1"; echo "Press enter to return to yazi"; read''; desc = "bash -c"; } + { run = ''fish -c "$1"; echo "Press enter to return to yazi"; read''; desc = "fish -c"; } + { run = ''sh -c "$1"; echo "Press enter to return to yazi"; read''; desc = "sh -c"; } ]; "python" = [ - { run = ''python "$@"; echo "Press enter to return to yazi"; read''; desc = "python"; block = true; } + { run = ''python "$@"; echo "Press enter to return to yazi"; read''; desc = "Python"; block = true; } ]; "directory" = [ - { run = ''lazygit "$0"''; desc = "lazygit"; } + { run = ''lazygit "$1"''; desc = "LazyGit"; } ]; }; open.rules = [ @@ -326,27 +327,73 @@ in { tabs = { active = { fg = secondary.dark; bg = secondary.base; }; inactive = { fg = secondary.base; bg = secondary.dark; }; + # sep_inner = { open = "[", close = "]" }; + # sep_outer = { open = "[", close = "]" }; + }; + mode = { + main_main = { fg = yellow.bright; bg = yellow.dark; }; + select_main = { fg = cyan.bright; bg = cyan.dark; }; + unset_main = { fg = blue.bright; bg = blue.dark; }; + main_alternative = { fg = yellow.brighter; bg = yellow.dark; }; + select_alternative = { fg = cyan.brighter; bg = cyan.dark; }; + unset_alternative = { fg = blue.brighter; bg = blue.dark; }; + }; + confirm = { + border = { fg = border; }; + title = { fg = accent.bright; }; + body = { fg = "#ff0000"; }; + list = { fg = "#ff0000"; }; + btn_yes = { fg = positive.base; bg = positive.dark; }; + btn_no = { fg = negative.base; bg = negative.dark; }; + btn_labels = [ " BET " " HELLNAW " ]; + }; + spot = { + border = { fg = border; }; + title = { fg = accent.bright; }; + tbl_col = { fg = accent.base; }; + tbl_cell = { fg = secondary.base; }; + }; + notify = { + title_info = { fg = accent.base; }; + title_warn = { fg = weird.base; }; + title_error = { fg = special.base; }; + }; + pick = { + border = { fg = border; }; + active = { fg = accent.base; }; + inactive = { fg = subtle.base; }; }; status = { - separator_open = " "; #""; - separator_close = " "; #""; - separator_style = { fg = accent.base; bg = black.base; }; - mode_normal = { fg = yellow.bright; bg = yellow.dark; }; - mode_select = { fg = cyan.bright; bg = cyan.dark; }; - mode_unset = { fg = blue.bright; bg = blue.dark; }; + # sep_right = { open = ""; close = ""; }; + # sep_left = { open = ""; close = ""; }; + sepr_style = { fg = accent.base; bg = black.base; }; progress_label = { fg = secondary.base; bold = true; }; progress_normal = { fg = accent.base; bg = black.base; }; progress_error = { fg = negative.base; bg = black.base; }; - permissions_t = { fg = special.base; }; - permissions_r = { fg = accent.base; }; - permissions_w = { fg = secondary.base; }; - permissions_x = { fg = tertiary.base; }; - permissions_s = { fg = special.base; }; + perm_type = { fg = special.base; }; + perm_read = { fg = accent.base; }; + perm_write = { fg = secondary.base; }; + perm_exec = { fg = tertiary.base; }; + perm_sep = { fg = special.base; }; + }; + indicator = { # your "cursor" + parent = { fg = secondary.darker; bg = secondary.base; }; + current = { fg = accent.darker; bg = accent.base; }; + preview = { fg = secondary.base; bg = secondary.dark; }; + # padding = { open = " "; close = " "; }; + }; + cmp = { + border = { fg = border; }; + active = { fg = accent.base; }; + inactive = { fg = subtle.base; }; + # icon_file = + # icon_folder = + # icon_command }; input = { border = { fg = border; }; - title = {}; - value = {}; + title = { fg = accent.bright; }; + value = { fg = foreground; }; selected = { reversed = true; }; }; select = { @@ -368,11 +415,11 @@ in { separator_style = { fg = foreground; }; }; help = { - on = { fg = "#fe8019"; }; - exec = { fg = "#83a598"; }; - desc = { fg = "#928374"; }; - hovered = { bg = "#504945"; bold = true; }; - footer = { fg = "#3c3836"; bg = "#a89984"; }; + on = { fg = accent.base; }; + run = { fg = secondary.base; }; + desc = { fg = tertiary.base; italic = true; }; + hovered = { bg = accent.bright; bold = true; }; + footer = { fg = accent.base; bg = subtle.dark; }; }; filetype = { rules = [ @@ -380,17 +427,17 @@ in { { mime = "inode/x-empty"; fg = white.dark; } { mime = "inode/directory"; fg = accent.base; } - { name = "*"; is = "link"; fg = tertiary.base; } - { name = "*"; is = "orphan"; fg = negative.base; } - { name = "*"; is = "block"; fg = special.base; } - { name = "*"; is = "char"; fg = special.bright; } - { name = "*"; is = "exec"; fg = secondary.base; } - { name = "*"; is = "fifo"; fg = weird.base; } - { name = "*"; is = "sock"; fg = weird.bright; } - { name = "*"; is = "sticky"; fg = special.base; } + { url = "*"; is = "link"; fg = tertiary.base; } + { url = "*"; is = "orphan"; fg = negative.base; } + { url = "*"; is = "block"; fg = special.base; } + { url = "*"; is = "char"; fg = special.bright; } + { url = "*"; is = "exec"; fg = secondary.base; } + { url = "*"; is = "fifo"; fg = weird.base; } + { url = "*"; is = "sock"; fg = weird.bright; } + { url = "*"; is = "sticky"; fg = special.base; } # Fallback - { name = "*"; fg = foreground; } + { url = "*"; fg = foreground; } ]; }; }; @@ -413,6 +460,13 @@ in { " ", } end, 500, Status.RIGHT) + + Header:children_add(function() + if ya.target_family() ~= "unix" then + return "" + end + return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue") + end, 500, Header.LEFT) ''; plugins = with pkgs; { inherit glow git; @@ -424,11 +478,11 @@ in { force = true; text = '' [filechooser] - cmd=${tfc}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh + cmd=/home/nx2/wrapper.sh default_dir=$HOME env=TERMCMD=ghostty --title="terminal-file-picker -e" open_mode=suggested - save_mode=last + save_mode=suggested ''; }; portal = { diff --git a/home.nix b/home.nix index a35891f..2c5beed 100644 --- a/home.nix +++ b/home.nix @@ -25,7 +25,7 @@ ./home-modules/hyprland-autoname-workspaces.nix ./home-modules/hyprland.nix ./home-modules/kitty.nix - ./home-modules/latex.nix + # ./home-modules/latex.nix ./home-modules/mako.nix # ./home-modules/matrix.nix ./home-modules/mpv.nix @@ -34,7 +34,7 @@ ./home-modules/nvidia.nix ./home-modules/nxgs.nix ./home-modules/obs.nix - ./home-modules/office.nix + # ./home-modules/office.nix ./home-modules/ollama.nix ./home-modules/opencode.nix ./home-modules/pandoc.nix @@ -63,7 +63,7 @@ ./home-modules/yazi.nix ./home-modules/zathura.nix ./home-modules/zoxide.nix - ] ++ (if (hyper.host == "NxACE") then [ + ] ++ (if hyper.isServer then [ ./home-modules/nx2site.nix ./home-modules/nx2site-backup.nix ./home-modules/calendar-campuszeit-fix.nix @@ -71,6 +71,6 @@ home.username = hyper.user; home.homeDirectory = hyper.home; # home.homeDirectory = "/home/${hyper.user}"; - home.stateVersion = hyper.pkgs-version; + home.stateVersion = hyper.main-pkgs-version; programs.home-manager.enable = true; } diff --git a/nxlib/ricelib.nix b/nxlib/ricelib.nix deleted file mode 100644 index 067a060..0000000 --- a/nxlib/ricelib.nix +++ /dev/null @@ -1,96 +0,0 @@ -lib: -let - # takes in "ff0044" (no hash!) and returns { r = "ff", g = "00", b = "44" } - slice-hex = hex: with builtins; { r = substring 0 2 hex; g = substring 2 2 hex; b = substring 4 2 hex; }; - - # takes in "44" and returns 64 - drune-to-255 = drune: with builtins; (rune-to-num (substring 0 1 drune)) * 16 + (rune-to-num (substring 1 1 drune)); - num-to-drune = num: "${num-to-rune (num / 16)}${num-to-rune (num - ((num / 16) * 16))}"; - - # takes in "D" and returns 13 - rune-to-num = rune: # inspiration from https://github.com/bertof/nix-rice - let - dict = { - "0" = 0; - "1" = 1; - "2" = 2; - "3" = 3; - "4" = 4; - "5" = 5; - "6" = 6; - "7" = 7; - "8" = 8; - "9" = 9; - "A" = 10; - "B" = 11; - "C" = 12; - "D" = 13; - "E" = 14; - "F" = 15; - }; - in - assert(builtins.hasAttr (lib.strings.toUpper rune) dict); - builtins.getAttr (lib.strings.toUpper rune) dict; - - # takes in 15 and returns "F" - num-to-rune = num: - let - num-string = builtins.toString num; - dict = { - "0" = "0"; - "1" = "1"; - "2" = "2"; - "3" = "3"; - "4" = "4"; - "5" = "5"; - "6" = "6"; - "7" = "7"; - "8" = "8"; - "9" = "9"; - "10" = "A"; - "11" = "B"; - "12" = "C"; - "13" = "D"; - "14" = "E"; - "15" = "F"; - }; - in - assert(builtins.hasAttr num-string dict); - builtins.getAttr num-string dict; - - # Keeps num between 0 and 255 - # Make sure to pass in an int not a float - cap-255 = num: (if (num>255) then 255 else if (num<0) then 0 else num); - - nohash = hex: with builtins; assert((stringLength hex) == 7); substring 1 6 hex; -in -{ - - ## USEFUL FUNCTIONS - # -------------------------------------------------------------------------------- - # takes in a string like "#ff0044" and returns "ff0044" symbol - inherit nohash; - - # -------------------------------------------------------------------------------- - # This takes in something like "#ff0044" and returns "255,0,64" - hex-to-rgb-comma-string = hex: - with (slice-hex (nohash hex)); - with builtins; - assert(isString hex); - "${toString (drune-to-255 r)},${toString (drune-to-255 g)},${toString (drune-to-255 b)}"; - - # -------------------------------------------------------------------------------- - # This is useful if you have a float (like a transparency value) and want a drune representation of it - # So 0.0 -> "00" and 1.0 -> "FF" - float-to-drune = f: with builtins; assert(isFloat f); "${num-to-rune (floor((255*f) / 16))}${num-to-rune (floor(255*f) - (floor((255*f) / 16) * 16))}"; - - # -------------------------------------------------------------------------------- - # Takes in hex and a float. 0.5 is +50% brightness and (-0.5) is -50% brightness. - # So "#ff0044": 0.3 -> "#ff0055" - alter-luminace-hex = hex: amount: - let - color-num = with (slice-hex (nohash hex)); { r = drune-to-255 r; g = drune-to-255 g; b = drune-to-255 b; }; - alter = num: (num-to-drune (cap-255 (builtins.floor ((125 * amount) + (num * (1+amount))) ))); - in - with color-num; "#${alter r}${alter g}${alter b}"; -} diff --git a/shell-only.nix b/shell-only.nix index 2d37815..b2970ed 100644 --- a/shell-only.nix +++ b/shell-only.nix @@ -30,7 +30,7 @@ home = { username = hyper.user; homeDirectory = hyper.home; - stateVersion = hyper.pkgs-version; + stateVersion = hyper.main-pkgs-version; }; xdg = { enable = true; diff --git a/system-modules/base-packages.nix b/system-modules/base-packages.nix index 6634ce6..aae6b9a 100644 --- a/system-modules/base-packages.nix +++ b/system-modules/base-packages.nix @@ -5,7 +5,7 @@ pkgs: with pkgs; [ git-crypt wget - curlHTTP3 + curl zip unzip p7zip diff --git a/system-modules/calendar/lec.nix b/system-modules/calendar/lec.nix index 7db416a..b00c8fc 100644 --- a/system-modules/calendar/lec.nix +++ b/system-modules/calendar/lec.nix @@ -1,7 +1,7 @@ { pkgs, ... }@all: with all; { systemd.timers."nx_cal_lec" = { - enable = false; + enable = true; wantedBy = [ "timers.target" ]; timerConfig = { OnBootSec = "40m"; diff --git a/system-modules/dm.nix b/system-modules/dm.nix index 13aff1d..0d3d4fd 100644 --- a/system-modules/dm.nix +++ b/system-modules/dm.nix @@ -3,7 +3,7 @@ enable = true; settings = rec { hyprland = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --cmd Hyprland --remember-user-session --window-padding 5"; + command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd Hyprland --remember-user-session --window-padding 5"; user = hyper.user; }; default_session = hyprland; diff --git a/system-modules/fcitx5.nix b/system-modules/fcitx5.nix index 7c90b01..efa5d33 100644 --- a/system-modules/fcitx5.nix +++ b/system-modules/fcitx5.nix @@ -1,88 +1,14 @@ -{ pkgs, ... }@all: with all; -{ - # i18n.inputMethod = { - # type = "fcitx5"; - # enable = true; - # fcitx5.addons = with pkgs; [ - # fcitx5-gtk # alternatively, kdePackages.fcitx5-qt - # fcitx5-chinese-addons # table input method support - # fcitx5-nord # a color theme - # ]; - # }; +{ pkgs, ... }@all: with all; { i18n.inputMethod = { enable = true; type = "fcitx5"; - fcitx5.waylandFrontend = true; - fcitx5.addons = with pkgs; [ - fcitx5-gtk # alternatively, kdePackages.fcitx5-qt - fcitx5-chinese-addons # table input method support - fcitx5-nord # a color theme - ]; + fcitx5 = { + waylandFrontend = true; + addons = with pkgs; [ + fcitx5-gtk + kdePackages.fcitx5-chinese-addons + fcitx5-nord + ]; + }; }; - # i18n.inputMethod = { - # enabled = "fcitx5"; - # ignoreUserConfig = true; - # waylandFrontend = true; - # fcitx5 = { - # addons = with pkgs-unstable; [ - # rime-data - # fcitx5-rime - - # # Chinese - # fcitx5-chinese-addons - # fcitx5-table-extra - # fcitx5-pinyin-moegirl - # fcitx5-pinyin-zhwiki - - # # Japanese - # # fcitx5-mozc - # ]; - # settings = { - # globalOptions = { - # Hotkey = { - # # Enumerate when press trigger key repeatedly - # EnumerateWithTriggerKeys = "True"; - # # Skip first input method while enumerating - # EnumerateSkipFirst = "False"; - # }; - # "Hotkey/EnumerateForwardKeys" = { "0" = "Control+space"; }; - # "Hotkey/EnumerateBackwardKeys" = { "0" = "Control+Shift+space"; }; - # "Hotkey/PrevPage" = { "0" = "Up"; }; - # "Hotkey/NextPage" = { "0" = "Down"; }; - # "Hotkey/PrevCandidate" = { "0" = "Shift+Tab"; }; - # "Hotkey/NextCandidate" = { "0" = "Tab"; }; - # Behavior = { - # ActiveByDefault = "False"; # Active By Default - # ShareInputState = "No"; # Share Input State - # PreeditEnabledByDefault = "True"; # Show preedit in application - # ShowInputMethodInformation = "True"; # Show Input Method Information when switch input method - # showInputMethodInformationWhenFocusIn = "False"; # Show Input Method Information when changing focus - # CompactInputMethodInformation = "True"; # Show compact input method information - # ShowFirstInputMethodInformation = "True"; # Show first input method information - # DefaultPageSize = "5"; # Default page size - # OverrideXkbOption = "False"; # Override Xkb Option - # PreloadInputMethod = "True"; # Preload input method to be used by default - # }; - # }; - # inputMethod = { - # "Groups/0" = { - # "Name" = "Default"; - # "Default Layout" = "us"; - # "DefaultIM" = "mozc"; - # }; - # "Groups/0/Items/0" = { - # "Name" = "keyboard-us"; - # "Layout" = null; - # }; - # "Groups/0/Items/1" = { - # "Name" = "mozc"; - # "Layout" = null; - # }; - # "GroupOrder" = { - # "0" = "Default"; - # }; - # }; - # }; - # }; - # }; } diff --git a/system-modules/fonts.nix b/system-modules/fonts.nix index 5c77519..eeed533 100644 --- a/system-modules/fonts.nix +++ b/system-modules/fonts.nix @@ -4,7 +4,7 @@ noto-fonts noto-fonts-cjk-sans noto-fonts-cjk-serif - noto-fonts-emoji + noto-fonts-color-emoji newcomputermodern atkinson-hyperlegible nerd-fonts.jetbrains-mono diff --git a/system-modules/hsmw.nix b/system-modules/hsmw.nix index 18b1492..d955736 100644 --- a/system-modules/hsmw.nix +++ b/system-modules/hsmw.nix @@ -27,8 +27,6 @@ "hsmw-vpn-secret" = { path = "/etc/ipsec.d/hsmw.secret"; mode = "600"; }; }; - networking.networkmanager.enableStrongSwan = true; - services.strongswan = { enable = true; setup = { diff --git a/system-modules/nix.nix b/system-modules/nix.nix new file mode 100644 index 0000000..651f9ac --- /dev/null +++ b/system-modules/nix.nix @@ -0,0 +1,14 @@ +{ ... }: { + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + substituters = [ + "https://cache.nixos.org/" + "https://cache.nixos-cuda.org" + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" + ]; + }; +} diff --git a/system-modules/nvidia.nix b/system-modules/nvidia.nix index b2d49af..8b4eda1 100644 --- a/system-modules/nvidia.nix +++ b/system-modules/nvidia.nix @@ -1,7 +1,7 @@ { pkgs, ... }@all: with all; lib.mkIf hyper.nvidia.enable { environment.systemPackages = with pkgs; [ lshw - glxinfo + mesa-demos (pkgs.writeShellScriptBin "nvidia-offload" '' export __NV_PRIME_RENDER_OFFLOAD=1 export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 diff --git a/system-modules/nx2site/gitea.nix b/system-modules/nx2site/gitea.nix index 9afb95a..cd90be6 100644 --- a/system-modules/nx2site/gitea.nix +++ b/system-modules/nx2site/gitea.nix @@ -26,7 +26,7 @@ let git-user = "git"; in user = git-user; appName = "NxGit"; stateDir = "/var/lib/gitea"; # default - useWizard = false; # default + # useWizard = false; # default # camoHmacKeyFile = ; database = { createDatabase = false; # default diff --git a/system-modules/nx2site/proxy.nix b/system-modules/nx2site/proxy.nix index 9c620fc..d8b53be 100644 --- a/system-modules/nx2site/proxy.nix +++ b/system-modules/nx2site/proxy.nix @@ -50,7 +50,7 @@ defaultSSLListenPort = 443; enableQuicBPF = true; enableReload = true; - package = pkgs.nginxQuic; + package = pkgs.nginx; proxyResolveWhileRunning = false; proxyTimeout = "20s"; recommendedBrotliSettings = true; @@ -58,7 +58,7 @@ recommendedOptimisation = true; recommendedProxySettings = true; recommendedTlsSettings = true; - recommendedZstdSettings = true; + # recommendedZstdSettings = true; serverTokens = false; sslDhparam = config.sops.secrets."nx2site/dhparams.pem".path; sslProtocols = "TLSv1.2 TLSv1.3"; diff --git a/system-modules/qmk.nix b/system-modules/qmk.nix index 12b97d3..9b7bc90 100644 --- a/system-modules/qmk.nix +++ b/system-modules/qmk.nix @@ -2,12 +2,9 @@ { hardware.keyboard.qmk.enable = true; - # home.packages = with pkgs; [ - # via - # ]; environment.systemPackages = with pkgs; [ - via + # via qmk ]; - services.udev.packages = [ pkgs.via ]; + # services.udev.packages = [ pkgs.via ]; }