diff --git a/flake.nix b/flake.nix index 31b1ec5..ce5a76d 100755 --- a/flake.nix +++ b/flake.nix @@ -139,6 +139,10 @@ path = ./templates/haskell; description = "Haskell Environment"; }; + typst = { + path = ./templates/typst; + description = "Typst Environment"; + }; }; }; diff --git a/modules/home/default.nix b/modules/home/default.nix index a0a6a5f..fc04e1f 100755 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -31,6 +31,7 @@ in obsidian libreOffice okular + zathura kolourPaint imageViewing obsStudio @@ -54,7 +55,7 @@ in wayland theming polychromatic - nautilus + dolphin ; }; }; @@ -166,7 +167,9 @@ in scrcpy bitwarden emote - desktop + hypr + wayland + theming ; }; }; diff --git a/modules/home/gui/apps/media/docs/docViewing/zathura/default.nix b/modules/home/gui/apps/media/docs/docViewing/zathura/default.nix new file mode 100644 index 0000000..d6043a0 --- /dev/null +++ b/modules/home/gui/apps/media/docs/docViewing/zathura/default.nix @@ -0,0 +1,11 @@ +{ + pkgs, + ... +}: +{ + home.packages = builtins.attrValues { + inherit (pkgs) + zathura + ; + }; +} diff --git a/modules/home/gui/desktop/hypr/land/config/bind.nix b/modules/home/gui/desktop/hypr/land/config/bind-user0.nix similarity index 94% rename from modules/home/gui/desktop/hypr/land/config/bind.nix rename to modules/home/gui/desktop/hypr/land/config/bind-user0.nix index 5e06db2..485a085 100755 --- a/modules/home/gui/desktop/hypr/land/config/bind.nix +++ b/modules/home/gui/desktop/hypr/land/config/bind-user0.nix @@ -1,12 +1,4 @@ -{ - flake, - config, - ... -}: let - inherit (flake.config.people) user0 user1; - user = config.home.username; - superBinds = builtins.map (x: "SUPER, " + x) [ # Apps "Z, exec, obsidian" @@ -15,7 +7,7 @@ let "G, exec, scrcpy" "K, exec, ghostty -e nu -e y" "S, exec, steam" - "R, exec, obs" + "R, exec, ghostty -e zellij a dotfiles" "N, exec, signal-desktop" "T, exec, zeditor" "B, exec, floorp" diff --git a/modules/home/gui/desktop/hypr/land/config/bind-user1.nix b/modules/home/gui/desktop/hypr/land/config/bind-user1.nix new file mode 100755 index 0000000..ca6a4c7 --- /dev/null +++ b/modules/home/gui/desktop/hypr/land/config/bind-user1.nix @@ -0,0 +1,91 @@ +let + superBinds = builtins.map (x: "SUPER, " + x) [ + # Apps + "B, exec, brave" + "E, exec, ghostty -e nu -e y" + "S, exec, steam" + "N, exec, signal-desktop" + "D, exec, discordcanary" + "R, exec, flatpak run org.vinegarhq.Sober" + "T, exec, ghostty" + "P, exec, spotify" + "M, exec, prismlauncher" + "J, exec, jellyfinmediaplayer" + "L, exec, lutris" + # Workspaces + "1, workspace, 1" + "2, workspace, 2" + "3, workspace, 3" + "4, workspace, 4" + "5, workspace, 5" + # Windows + "X, killactive" + "bracketright, splitratio, 0.33" + "bracketleft, splitratio, -0.33" + "Tab, fullscreen, 0" + "F, togglefloating" + # Window Focus + "left, movefocus, l" + "up, movefocus, u" + "down, movefocus, d" + "right, movefocus, r" + # Audio + "PageUp, exec, playerctl next" + "PageDown, exec, playerctl previous" + "Home, exec, playerctl play-pause" + "Space, exec, rm -r /home/$USER/.cache/tofi* ; tofi-drun" + ]; + + superShiftBinds = builtins.map (x: "SUPER SHIFT, " + x) [ + # Super+shift binds + # Window Move + "left, movewindow, l" + "up, movewindow, u" + "down, movewindow, d" + "right, movewindow, r" + # Quick Action + "S, exec, flameshot gui" + "period, exec, emote" + "Backspace, layoutmsg, togglesplit" + "P, pin, enable" + # "Print, exec, grim -g \"$(slurp)\"" + # Utility + "End, exec, shutdown now" + "Insert, exec, systemctl reboot" + "Home, exec, swaylock" + "1, movetoworkspacesilent, 1" + "2, movetoworkspacesilent, 2" + "3, movetoworkspacesilent, 3" + "4, movetoworkspacesilent, 4" + "5, movetoworkspacesilent, 5" + ]; + superCtrlBinds = builtins.map (x: "SUPER CTRL, " + x) [ + # Super+shift binds + ]; + + altBinds = builtins.map (x: "ALT, " + x) [ + # Alt binds + ]; + + shiftBinds = builtins.map (x: "SHIFT, " + x) [ + # Shift binds + ]; + + ctrlBinds = builtins.map (x: "CTRL, " + x) [ + # Ctrl binds + ]; + + ctrlShiftBinds = builtins.map (x: "CTRL SHIFT, " + x) [ + # Ctrl+shift binds + # "End, exec, shutdown now" + ]; +in +superBinds +++ superShiftBinds +++ superCtrlBinds +++ altBinds +++ ctrlBinds +++ ctrlShiftBinds +++ shiftBinds +# Docs +# https://wiki.hyprland.org/Getting-Started/Master-Tutorial/ diff --git a/modules/home/gui/desktop/hypr/land/default.nix b/modules/home/gui/desktop/hypr/land/default.nix index 3ec6ec8..c33e346 100755 --- a/modules/home/gui/desktop/hypr/land/default.nix +++ b/modules/home/gui/desktop/hypr/land/default.nix @@ -6,10 +6,12 @@ }: let + inherit (flake.config.people) user0; + user = config.home.username; + configPath = ./config; configImports = { animations = import (configPath + /animations.nix); - bind = import (configPath + /bind.nix) { inherit flake config; }; bindm = import (configPath + /bindm.nix); binds = import (configPath + /binds.nix); # bindl = import (configPath + /bindl.nix); @@ -21,6 +23,15 @@ let misc = import (configPath + /misc.nix); windowrulev2 = import (configPath + /windowrulev2.nix); xwayland = import (configPath + /xwayland.nix); + bind = + let + bindConfig = + if user == user0 then + import (configPath + /bind-user0.nix) + else + import (configPath + /bind-user1.nix); + in + bindConfig; }; in { diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index aad138b..0f37717 100755 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -14,6 +14,7 @@ in searx wayland xserver + flatpak ; }; }; @@ -31,7 +32,9 @@ in deimos = { imports = builtins.attrValues { inherit (modules) - gnome + hypr + wayland + flatpak xserver ; }; @@ -53,7 +56,6 @@ in searx vaultwarden forgejo - wayland xserver ; }; diff --git a/modules/nixos/core/flatpak/default.nix b/modules/nixos/services/flatpak/default.nix similarity index 100% rename from modules/nixos/core/flatpak/default.nix rename to modules/nixos/services/flatpak/default.nix diff --git a/modules/nixos/services/ollama/default.nix b/modules/nixos/services/ollama/default.nix index 6077616..8616bcb 100755 --- a/modules/nixos/services/ollama/default.nix +++ b/modules/nixos/services/ollama/default.nix @@ -65,14 +65,14 @@ in // ( if hostname == mars.name then { - models = service.paths.path1; - # acceleration = "rocm"; - # package = pkgs.ollama.override { - # config = { - # rocmSupport = true; - # cudaSupport = false; - # }; - # }; + # models = service.paths.path1; + acceleration = "rocm"; + package = pkgs.ollama.override { + config = { + rocmSupport = true; + cudaSupport = false; + }; + }; } else { diff --git a/modules/nixos/services/searx/default.nix b/modules/nixos/services/searx/default.nix index f694da7..48a577a 100755 --- a/modules/nixos/services/searx/default.nix +++ b/modules/nixos/services/searx/default.nix @@ -158,19 +158,12 @@ in virtualHosts = { "${host}" = { extraConfig = '' - # Use the uwsgi socket directly instead of reverse_proxy to HTTP - reverse_proxy unix//run/searx/searx.sock { - transport unix { - dial_timeout 5s - } - header_up Host {host} - header_up X-Forwarded-For {remote} - header_up X-Forwarded-Proto {scheme} - header_up X-Script-Name / - } + redir /.well-known/carddav /remote.php/dav/ 301 + redir /.well-known/caldav /remote.php/dav/ 301 + + reverse_proxy ${localhost}:${toString service.ports.port0} tls ${service.ssl.cert} ${service.ssl.key} - encode zstd gzip ''; }; }; diff --git a/systems/mars/config/filesystem.nix b/systems/mars/config/filesystem.nix index 1cb70b1..5574d13 100755 --- a/systems/mars/config/filesystem.nix +++ b/systems/mars/config/filesystem.nix @@ -71,11 +71,11 @@ in in { "/" = { - device = "/dev/disk/by-uuid/57e88a48-00eb-46ca-9e2a-855de7e066b2"; + device = "/dev/disk/by-uuid/1de87c26-c123-44c0-9c9b-6d2480bdeb7d"; fsType = "ext4"; }; "/boot" = { - device = "/dev/disk/by-uuid/F095-17B7"; + device = "/dev/disk/by-uuid/6A1F-3641"; fsType = "vfat"; options = mars.boot.options; }; @@ -85,7 +85,7 @@ in // (builtins.listToAttrs (map sambaMounts sambaDrives)); swapDevices = [ - { device = "/dev/disk/by-uuid/56c84b5e-83b4-4ea1-b6ec-a29fc057292d"; } + { device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; } ]; systemd.tmpfiles.rules = [ diff --git a/systems/mars/config/networking.nix b/systems/mars/config/networking.nix index 2304177..ffb1c73 100755 --- a/systems/mars/config/networking.nix +++ b/systems/mars/config/networking.nix @@ -23,7 +23,7 @@ in 3131 # Deskreen 1234 # Elm-land server 5037 # ADB Server - 52006 + 44363 ]; }; }; diff --git a/templates/typst/.envrc b/templates/typst/.envrc new file mode 100755 index 0000000..8392d15 --- /dev/null +++ b/templates/typst/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/templates/typst/.gitignore b/templates/typst/.gitignore new file mode 100755 index 0000000..5c063be --- /dev/null +++ b/templates/typst/.gitignore @@ -0,0 +1,4 @@ +.direnv +.pre-commit-config.yaml +.vscode +*.pdf diff --git a/templates/typst/flake.nix b/templates/typst/flake.nix new file mode 100755 index 0000000..5115b35 --- /dev/null +++ b/templates/typst/flake.nix @@ -0,0 +1,28 @@ +{ + description = "Typst Environment"; + + inputs = { + devshell.url = "github:numtide/devshell"; + flake-root.url = "github:srid/flake-root"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; + }; + + outputs = + inputs@{ + nixpkgs, + flake-parts, + self, + ... + }: + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + inputs.devshell.flakeModule + inputs.flake-root.flakeModule + inputs.pre-commit-hooks-nix.flakeModule + ./parts + ]; + + systems = nixpkgs.lib.systems.flakeExposed; + }; +} diff --git a/templates/typst/parts/config/devshells.nix b/templates/typst/parts/config/devshells.nix new file mode 100755 index 0000000..0c1ca46 --- /dev/null +++ b/templates/typst/parts/config/devshells.nix @@ -0,0 +1,26 @@ +{ + pkgs, + config, + ... +}: +{ + devShells = { + default = pkgs.mkShell { + packages = builtins.attrValues { + inherit (pkgs) + just + nil + typst + tinymist + typstyle + yamlfmt + nixfmt-rfc-style + ; + inherit (pkgs.nodePackages) + "@commitlint/config-conventional" + ; + }; + }; + shellHook = "${config.pre-commit.installationScript}"; + }; +} diff --git a/templates/typst/parts/config/pre-commit.nix b/templates/typst/parts/config/pre-commit.nix new file mode 100755 index 0000000..a41ffa6 --- /dev/null +++ b/templates/typst/parts/config/pre-commit.nix @@ -0,0 +1,7 @@ +{ + pre-commit.settings.hooks = { + nixfmt.enable = true; + commitizen.enable = true; + statix.enable = true; + }; +} diff --git a/templates/typst/parts/default.nix b/templates/typst/parts/default.nix new file mode 100755 index 0000000..93ccb77 --- /dev/null +++ b/templates/typst/parts/default.nix @@ -0,0 +1,24 @@ +{ + perSystem = + { + pkgs, + lib, + config, + self', + ... + }: + let + configPath = ./config; + + devshellImports = + let + files = builtins.attrNames (builtins.readDir configPath); + in + map (name: configPath + "/${name}") ( + builtins.filter (name: builtins.match ".*\\.nix$" name != null) files + ); + in + { + imports = devshellImports; + }; +} diff --git a/templates/typst/src/refs.yml b/templates/typst/src/refs.yml new file mode 100755 index 0000000..7beab72 --- /dev/null +++ b/templates/typst/src/refs.yml @@ -0,0 +1,8 @@ +citizen: + author: John Zerilli + chapter: 3 + date: 2021 + isbn: 9780262044813 + publisher: The MIT Press + title: A Citizen's Guide To Artificial Intelligence + type: Book diff --git a/templates/typst/src/template.typ b/templates/typst/src/template.typ new file mode 100755 index 0000000..5698ab3 --- /dev/null +++ b/templates/typst/src/template.typ @@ -0,0 +1,63 @@ +// Catppuccin Latte + +#let catppuccinLatteRosewater = rgb("#dc8a78") +#let catppuccinLatteFlamingo = rgb("#dd7878") +#let catppuccinLattePink = rgb("#ea76cb") +#let catppuccinLatteMauve = rgb("#8839ef") +#let catppuccinLatteRed = rgb("#d20f39") +#let catppuccinLatteMaroon = rgb("#e64553") +#let catppuccinLattePeach = rgb("#fe640b") +#let catppuccinLatteYellow = rgb("#df8e1d") +#let catppuccinLatteGreen = rgb("#40a02b") +#let catppuccinLatteTeal = rgb("#179299") +#let catppuccinLatteSky = rgb("#04a5e5") +#let catppuccinLatteSapphire = rgb("#209fb5") +#let catppuccinLatteBlue = rgb("#1e66f5") +#let catppuccinLatteLavender = rgb("#7287fd") +#let catppuccinLatteText = rgb("#4c4f69") +#let catppuccinLatteSubtext1 = rgb("#5c5f77") +#let catppuccinLatteSubtext0 = rgb("#6c6f85") +#let catppuccinLatteOverlay2 = rgb("#7c7f93") +#let catppuccinLatteOverlay1 = rgb("#8c8fa1") +#let catppuccinLatteOverlay0 = rgb("#9ca0b0") +#let catppuccinLatteSurface2 = rgb("#acb0be") +#let catppuccinLatteSurface1 = rgb("#bcc0cc") +#let catppuccinLatteSurface0 = rgb("#ccd0da") +#let catppuccinLatteBase = rgb("#eff1f5") +#let catppuccinLatteMantle = rgb("#e6e9ef") +#let catppuccinLatteCrust = rgb("#dce0e8") + +// General: + +#let project(author: (:), title: (), body) = { + show figure.caption: it => it.body + + set quote(attribution: "content", block: true) + + set document(author: author.firstName + " " + author.lastName, title: title) + + set text(fill: catppuccinLatteText, font: ("New Computer Modern"), lang: "en") + + let title = { + align(center)[ + #block[ + #text(size: 25pt, weight: "medium")[#title] + ] + ] + } + + let name = { + align( + center, + )[ + #block[ + #text(size: 12pt, weight: "regular")[#author.firstName #author.lastName] + ] + ] + } + + title + name + body +} + diff --git a/templates/typst/src/typst.typ b/templates/typst/src/typst.typ new file mode 100755 index 0000000..749defb --- /dev/null +++ b/templates/typst/src/typst.typ @@ -0,0 +1,12 @@ +#import "template.typ": * + +#show: project.with(author: (firstName: "First", lastName: "Last"), title: "Title") + +Test + +#quote( + attribution: , +)[ Fact is, you can't satisfy both calibration and error rate balance if the base + rates differ... ] + +#bibliography("refs.yml", style: "ieee")