From 9786eb8672213344d8d1b7bdef12bc94510b20db Mon Sep 17 00:00:00 2001 From: outremonde Date: Tue, 10 Jun 2025 20:32:00 -0400 Subject: initialized repository Former-commit-id: 84647f22b951a957b2b83885b612115d473f6626 --- docs/home-server.md | 53 + docs/layout.md | 74 + docs/todo.md | 25 + features/system/cli/shells/nushell.nix | 10 + features/system/cli/utils/nh.nix | 17 + features/system/global/agenix.nix | 7 + features/system/global/nix.nix | 13 + features/system/global/noxterm.nix | 3 + features/system/gui/apps/steam.nix | 27 + features/system/gui/apps/vmware.nix | 8 + features/system/gui/desktops/niri.nix | 9 + features/system/server/cloud/syncthing.nix | 1 + features/system/server/core/ssh.nix | 15 + features/system/server/development/git-server.nix | 1 + features/system/server/gaming/minecraft.nix | 1 + features/system/server/media/calibre.nix | 1 + features/system/server/media/invidious.nix | 1 + features/system/services/bundles/printing.nix | 13 + features/system/services/core/systemd-boot.nix | 11 + features/system/services/extra/plymouth.nix | 36 + features/system/services/extra/sddm.nix | 23 + features/system/services/extra/ssh.nix | 14 + .../system/services/extra/syncthing-client.nix | 35 + features/system/services/extra/udisks2.nix | 12 + features/system/services/hardware/bluetooth.nix | 23 + features/system/services/hardware/iwd.nix | 19 + .../system/services/hardware/networkmanager.nix | 11 + features/system/services/hardware/pipewire.nix | 15 + features/user/cli/apps/btop.nix | 15 + features/user/cli/apps/helix.nix | 71 + features/user/cli/apps/zellij.nix | 22 + features/user/cli/bundles/go-env.nix | 14 + features/user/cli/scripts/spiral/default.nix | 10 + features/user/cli/scripts/spiral/plan.md | 47 + features/user/cli/scripts/spiral/spiral.nu | 329 +++ features/user/cli/shells/nushell/completion.nu | 17 + features/user/cli/shells/nushell/default.nix | 93 + .../shells/nushell/direnv-project-template/.envrc | 1 + .../nushell/direnv-project-template/flake.nix | 29 + features/user/cli/shells/nushell/prompt.nu | 95 + features/user/cli/utils/git.nix | 12 + features/user/cli/utils/pandoc.nix | 13 + features/user/cli/utils/ssh.nix | 20 + features/user/global/home-manager.nix | 3 + features/user/global/nixpkgs.nix | 3 + features/user/gui/apps/foot.nix | 14 + features/user/gui/apps/librewolf.nix | 19 + features/user/gui/apps/mpv.nix | 28 + features/user/gui/apps/obs.nix | 10 + features/user/gui/apps/qutebrowser/default.nix | 81 + .../gui/apps/qutebrowser/scripts/yt-ad-skip.js | 29 + .../apps/qutebrowser/scripts/yt-dislike-viewer.js | 704 +++++++ .../apps/qutebrowser/scripts/yt-shorts-blocker.js | 23 + .../apps/qutebrowser/scripts/yt-sponsor-skip.js | 51 + features/user/gui/apps/vesktop.nix | 8 + features/user/gui/bundles/video.nix | 11 + features/user/gui/desktops/niri/default.nix | 126 ++ features/user/gui/desktops/niri/keybinds.nix | 165 ++ features/user/gui/desktops/niri/parts/fuzzel.nix | 30 + features/user/gui/desktops/niri/parts/hyprlock.nix | 46 + .../user/gui/desktops/niri/parts/ignis/default.nix | 21 + features/user/gui/desktops/niri/parts/mako.nix | 26 + .../user/gui/desktops/niri/parts/selectors.nix | 117 ++ features/user/gui/desktops/niri/parts/swww.nix | 8 + features/user/gui/desktops/niri/parts/waybar.nix | 136 ++ features/user/gui/desktops/niri/parts/wl-kbptr.nix | 14 + features/user/gui/desktops/niri/parts/wluma.nix | 11 + features/user/gui/desktops/niri/readme.md | 9 + features/user/services/flatpak.nix | 27 + features/user/services/udiskie.nix | 17 + features/user/services/wluma.nix | 11 + flake.lock | 533 +++++ flake.nix | 53 + lib/helper.nix | 80 + lib/umport.nix | 52 + ...yzgalov-phmgfNIITL8-unsplash.jpg.REMOVED.git-id | 1 + modules/system/general-settings/default.nix | 45 + modules/user/aesthetics/default.nix | 91 + modules/user/aesthetics/readme.md | 15 + modules/user/aesthetics/targets/foot.nix | 55 + modules/user/aesthetics/targets/gtk.nix | 119 ++ modules/user/aesthetics/targets/helix.nix | 28 + modules/user/aesthetics/targets/mako.nix | 23 + modules/user/aesthetics/targets/qutebrowser.nix | 213 ++ modules/user/aesthetics/targets/vesktop.nix | 65 + modules/user/aesthetics/targets/zellij.nix | 28 + .../user/aesthetics/themes/oxocarbon/default.nix | 67 + .../aesthetics/themes/oxocarbon/helix-theme.toml | 52 + .../autumn/aerial-autumn-road.jpg.REMOVED.git-id | 1 + .../autumn/autumn-leaves.jpg.REMOVED.git-id | 1 + .../autumn/autumn-silhouette.jpg.REMOVED.git-id | 1 + .../autumn/autumnal-mountain.jpg.REMOVED.git-id | 1 + .../autumn/autumnal-road.jpg.REMOVED.git-id | 1 + .../oxocarbon/wallpapers/autumn/maple-leaf.jpg | Bin 0 -> 562254 bytes .../wallpapers/lake/forest-lake.jpg.REMOVED.git-id | 1 + .../wallpapers/lake/lake-island.jpg.REMOVED.git-id | 1 + .../wallpapers/lake/purple-lake.jpg.REMOVED.git-id | 1 + .../lake/sunset-lake-off-dock.jpg.REMOVED.git-id | 1 + .../lake/warm-lakeside-village.jpg.REMOVED.git-id | 1 + .../wallpapers/landscape/aerial-dark-marsh.jpg | Bin 0 -> 874630 bytes .../landscape/bridge-on-cliff.jpg.REMOVED.git-id | 1 + .../landscape/bright-night-sky.jpg.REMOVED.git-id | 1 + .../landscape/cloudy-mountains.jpeg.REMOVED.git-id | 1 + .../landscape/cloudy-valley.jpg.REMOVED.git-id | 1 + .../dramatic-mountains.jpg.REMOVED.git-id | 1 + .../landscape/forested-mountain.jpg.REMOVED.git-id | 1 + .../forested-mountainside.jpg.REMOVED.git-id | 1 + .../landscape/green-mountains.jpg.REMOVED.git-id | 1 + .../landscape/hillside-village.jpg.REMOVED.git-id | 1 + .../monochrome-mountain-sky.jpg.REMOVED.git-id | 1 + .../mountain-glowing-sky.jpg.REMOVED.git-id | 1 + .../mountain-sky-streak.jpg.REMOVED.git-id | 1 + .../landscape/mountain-sunset.jpg.REMOVED.git-id | 1 + .../mountain-through-valley.jpg.REMOVED.git-id | 1 + .../landscape/night-mountain-silhouette.jpg | Bin 0 -> 1032442 bytes .../wallpapers/landscape/pink-hill-silhouette.jpg | Bin 0 -> 967994 bytes .../landscape/purple-mountains.jpg.REMOVED.git-id | 1 + .../landscape/red-ridges.jpg.REMOVED.git-id | 1 + .../landscape/red-rock.jpg.REMOVED.git-id | 1 + .../landscape/salt-flats.jpg.REMOVED.git-id | 1 + .../landscape/sea-of-clouds.jpg.REMOVED.git-id | 1 + .../landscape/seaside-mountain.jpg.REMOVED.git-id | 1 + .../landscape/tree-mountain.jpg.REMOVED.git-id | 1 + .../landscape/yellow-mountains.jpg.REMOVED.git-id | 1 + .../landscape/yosemite-valley.jpg.REMOVED.git-id | 1 + .../wallpapers/nature/crags.jpg.REMOVED.git-id | 1 + .../nature/dusk-rocky-beach.jpg.REMOVED.git-id | 1 + .../themes/oxocarbon/wallpapers/nature/flowers.png | Bin 0 -> 999159 bytes .../nature/foggy-forest.jpg.REMOVED.git-id | 1 + .../nature/forest-trail.jpg.REMOVED.git-id | 1 + .../nature/narrow-waterfall.jpg.REMOVED.git-id | 1 + .../nature/purple-sky.jpg.REMOVED.git-id | 1 + .../nature/snowy-slope.jpg.REMOVED.git-id | 1 + .../ocean/aerial-island.jpg.REMOVED.git-id | 1 + .../ocean/beached-ship.jpg.REMOVED.git-id | 1 + .../wallpapers/ocean/beachfront.jpg.REMOVED.git-id | 1 + .../ocean/seaside-village.jpg.REMOVED.git-id | 1 + .../ocean/sunset-seaside-city.jpg.REMOVED.git-id | 1 + .../wallpapers/other/grey-dune.jpeg.REMOVED.git-id | 1 + .../other/yellow-moon-in-sky.jpg.REMOVED.git-id | 1 + modules/user/default-apps.nix | 49 + pkgs/custom-hello.nix | 26 + pkgs/custom-neovim/.direnv/bin/nix-direnv-reload | 19 + .../01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source | 1 + .../12rkh25dglxx42bkk3b4drahn482xsn5-source | 1 + .../9cdyyswz19r66knbyscl7l42k69vhbib-source | 1 + .../yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source | 1 + ...rofile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa | 1 + ...ile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc | 2089 ++++++++++++++++++++ pkgs/custom-neovim/.envrc | 1 + pkgs/custom-neovim/flake.lock | 64 + pkgs/custom-neovim/flake.nix | 29 + pkgs/default.nix | 9 + pkgs/old-neovim/config/init.lua | 24 + pkgs/old-neovim/config/lua/autocommands.lua | 36 + pkgs/old-neovim/config/lua/mappings.lua | 29 + pkgs/old-neovim/config/lua/options.lua | 70 + .../config/lua/plugins/actions-preview.lua | 1 + pkgs/old-neovim/config/lua/plugins/lspconfig.lua | 91 + pkgs/old-neovim/config/lua/plugins/mini-clue.lua | 51 + .../old-neovim/config/lua/plugins/mini-comment.lua | 1 + .../config/lua/plugins/mini-completion.lua | 1 + pkgs/old-neovim/config/lua/plugins/mini-deps.lua | 8 + pkgs/old-neovim/config/lua/plugins/mini-icons.lua | 1 + pkgs/old-neovim/config/lua/plugins/mini-notify.lua | 1 + pkgs/old-neovim/config/lua/plugins/mini-pick.lua | 24 + .../config/lua/plugins/mini-sessions.lua | 31 + .../config/lua/plugins/mini-snippets.lua | 10 + .../old-neovim/config/lua/plugins/mini-starter.lua | 17 + .../config/lua/plugins/mini-statusline.lua | 1 + pkgs/old-neovim/config/lua/plugins/presence.lua | 3 + pkgs/old-neovim/config/lua/plugins/tabby.lua | 2 + pkgs/old-neovim/default.nix | 48 + pkgs/old-neovim/plan.md | 29 + pkgs/setup-manager/default.nix | 17 + pkgs/setup-manager/setup.nu | 55 + readme.md | 32 + secrets/culsans-user-password.age | 7 + secrets/lucas-user-password.age | Bin 0 -> 338 bytes secrets/secrets.nix | 16 + systems/ideapad-laptop/hardware.nix | 39 + systems/ideapad-laptop/system.nix | 66 + systems/nzxt-desktop/hardware.nix | 40 + systems/nzxt-desktop/system.nix | 66 + systems/prodesk-server/hardware.nix | 0 systems/prodesk-server/system.nix | 0 systems/steam-deck/system.nix | 71 + users/ideapad-laptop/lucas.nix | 60 + users/nzxt-desktop/culsans.nix | 63 + users/prodesk-server/server.nix | 0 users/steam-deck/culsans.nix | 59 + 191 files changed, 7942 insertions(+) create mode 100644 docs/home-server.md create mode 100644 docs/layout.md create mode 100644 docs/todo.md create mode 100644 features/system/cli/shells/nushell.nix create mode 100644 features/system/cli/utils/nh.nix create mode 100644 features/system/global/agenix.nix create mode 100644 features/system/global/nix.nix create mode 100644 features/system/global/noxterm.nix create mode 100644 features/system/gui/apps/steam.nix create mode 100644 features/system/gui/apps/vmware.nix create mode 100644 features/system/gui/desktops/niri.nix create mode 100644 features/system/server/cloud/syncthing.nix create mode 100644 features/system/server/core/ssh.nix create mode 100644 features/system/server/development/git-server.nix create mode 100644 features/system/server/gaming/minecraft.nix create mode 100644 features/system/server/media/calibre.nix create mode 100644 features/system/server/media/invidious.nix create mode 100644 features/system/services/bundles/printing.nix create mode 100644 features/system/services/core/systemd-boot.nix create mode 100644 features/system/services/extra/plymouth.nix create mode 100644 features/system/services/extra/sddm.nix create mode 100644 features/system/services/extra/ssh.nix create mode 100644 features/system/services/extra/syncthing-client.nix create mode 100644 features/system/services/extra/udisks2.nix create mode 100644 features/system/services/hardware/bluetooth.nix create mode 100644 features/system/services/hardware/iwd.nix create mode 100644 features/system/services/hardware/networkmanager.nix create mode 100644 features/system/services/hardware/pipewire.nix create mode 100644 features/user/cli/apps/btop.nix create mode 100644 features/user/cli/apps/helix.nix create mode 100644 features/user/cli/apps/zellij.nix create mode 100644 features/user/cli/bundles/go-env.nix create mode 100644 features/user/cli/scripts/spiral/default.nix create mode 100644 features/user/cli/scripts/spiral/plan.md create mode 100755 features/user/cli/scripts/spiral/spiral.nu create mode 100644 features/user/cli/shells/nushell/completion.nu create mode 100644 features/user/cli/shells/nushell/default.nix create mode 100644 features/user/cli/shells/nushell/direnv-project-template/.envrc create mode 100644 features/user/cli/shells/nushell/direnv-project-template/flake.nix create mode 100644 features/user/cli/shells/nushell/prompt.nu create mode 100644 features/user/cli/utils/git.nix create mode 100644 features/user/cli/utils/pandoc.nix create mode 100644 features/user/cli/utils/ssh.nix create mode 100644 features/user/global/home-manager.nix create mode 100644 features/user/global/nixpkgs.nix create mode 100644 features/user/gui/apps/foot.nix create mode 100644 features/user/gui/apps/librewolf.nix create mode 100644 features/user/gui/apps/mpv.nix create mode 100644 features/user/gui/apps/obs.nix create mode 100644 features/user/gui/apps/qutebrowser/default.nix create mode 100644 features/user/gui/apps/qutebrowser/scripts/yt-ad-skip.js create mode 100644 features/user/gui/apps/qutebrowser/scripts/yt-dislike-viewer.js create mode 100644 features/user/gui/apps/qutebrowser/scripts/yt-shorts-blocker.js create mode 100644 features/user/gui/apps/qutebrowser/scripts/yt-sponsor-skip.js create mode 100644 features/user/gui/apps/vesktop.nix create mode 100644 features/user/gui/bundles/video.nix create mode 100755 features/user/gui/desktops/niri/default.nix create mode 100644 features/user/gui/desktops/niri/keybinds.nix create mode 100755 features/user/gui/desktops/niri/parts/fuzzel.nix create mode 100755 features/user/gui/desktops/niri/parts/hyprlock.nix create mode 100755 features/user/gui/desktops/niri/parts/ignis/default.nix create mode 100755 features/user/gui/desktops/niri/parts/mako.nix create mode 100644 features/user/gui/desktops/niri/parts/selectors.nix create mode 100755 features/user/gui/desktops/niri/parts/swww.nix create mode 100755 features/user/gui/desktops/niri/parts/waybar.nix create mode 100644 features/user/gui/desktops/niri/parts/wl-kbptr.nix create mode 100644 features/user/gui/desktops/niri/parts/wluma.nix create mode 100644 features/user/gui/desktops/niri/readme.md create mode 100644 features/user/services/flatpak.nix create mode 100644 features/user/services/udiskie.nix create mode 100644 features/user/services/wluma.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 lib/helper.nix create mode 100755 lib/umport.nix create mode 100644 modules/artem-bryzgalov-phmgfNIITL8-unsplash.jpg.REMOVED.git-id create mode 100644 modules/system/general-settings/default.nix create mode 100644 modules/user/aesthetics/default.nix create mode 100644 modules/user/aesthetics/readme.md create mode 100644 modules/user/aesthetics/targets/foot.nix create mode 100644 modules/user/aesthetics/targets/gtk.nix create mode 100644 modules/user/aesthetics/targets/helix.nix create mode 100644 modules/user/aesthetics/targets/mako.nix create mode 100644 modules/user/aesthetics/targets/qutebrowser.nix create mode 100644 modules/user/aesthetics/targets/vesktop.nix create mode 100644 modules/user/aesthetics/targets/zellij.nix create mode 100644 modules/user/aesthetics/themes/oxocarbon/default.nix create mode 100644 modules/user/aesthetics/themes/oxocarbon/helix-theme.toml create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/aerial-autumn-road.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-leaves.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-silhouette.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-mountain.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-road.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/maple-leaf.jpg create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/forest-lake.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/lake-island.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/purple-lake.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/sunset-lake-off-dock.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/warm-lakeside-village.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/aerial-dark-marsh.jpg create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bridge-on-cliff.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bright-night-sky.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-mountains.jpeg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-valley.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/dramatic-mountains.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountain.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountainside.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/green-mountains.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/hillside-village.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/monochrome-mountain-sky.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-glowing-sky.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sky-streak.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sunset.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-through-valley.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/night-mountain-silhouette.jpg create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/pink-hill-silhouette.jpg create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/purple-mountains.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-ridges.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-rock.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/salt-flats.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/sea-of-clouds.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/seaside-mountain.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/tree-mountain.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yellow-mountains.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yosemite-valley.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/crags.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/dusk-rocky-beach.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/flowers.png create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/foggy-forest.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/forest-trail.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/narrow-waterfall.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/purple-sky.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/snowy-slope.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/aerial-island.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beached-ship.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beachfront.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/seaside-village.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/sunset-seaside-city.jpg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/other/grey-dune.jpeg.REMOVED.git-id create mode 100644 modules/user/aesthetics/themes/oxocarbon/wallpapers/other/yellow-moon-in-sky.jpg.REMOVED.git-id create mode 100644 modules/user/default-apps.nix create mode 100644 pkgs/custom-hello.nix create mode 100755 pkgs/custom-neovim/.direnv/bin/nix-direnv-reload create mode 120000 pkgs/custom-neovim/.direnv/flake-inputs/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source create mode 120000 pkgs/custom-neovim/.direnv/flake-inputs/12rkh25dglxx42bkk3b4drahn482xsn5-source create mode 120000 pkgs/custom-neovim/.direnv/flake-inputs/9cdyyswz19r66knbyscl7l42k69vhbib-source create mode 120000 pkgs/custom-neovim/.direnv/flake-inputs/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source create mode 120000 pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa create mode 100644 pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc create mode 100644 pkgs/custom-neovim/.envrc create mode 100644 pkgs/custom-neovim/flake.lock create mode 100644 pkgs/custom-neovim/flake.nix create mode 100644 pkgs/default.nix create mode 100644 pkgs/old-neovim/config/init.lua create mode 100644 pkgs/old-neovim/config/lua/autocommands.lua create mode 100644 pkgs/old-neovim/config/lua/mappings.lua create mode 100644 pkgs/old-neovim/config/lua/options.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/actions-preview.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/lspconfig.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-clue.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-comment.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-completion.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-deps.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-icons.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-notify.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-pick.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-sessions.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-snippets.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-starter.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/mini-statusline.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/presence.lua create mode 100644 pkgs/old-neovim/config/lua/plugins/tabby.lua create mode 100644 pkgs/old-neovim/default.nix create mode 100644 pkgs/old-neovim/plan.md create mode 100644 pkgs/setup-manager/default.nix create mode 100644 pkgs/setup-manager/setup.nu create mode 100644 readme.md create mode 100644 secrets/culsans-user-password.age create mode 100644 secrets/lucas-user-password.age create mode 100755 secrets/secrets.nix create mode 100644 systems/ideapad-laptop/hardware.nix create mode 100644 systems/ideapad-laptop/system.nix create mode 100644 systems/nzxt-desktop/hardware.nix create mode 100644 systems/nzxt-desktop/system.nix create mode 100644 systems/prodesk-server/hardware.nix create mode 100644 systems/prodesk-server/system.nix create mode 100644 systems/steam-deck/system.nix create mode 100644 users/ideapad-laptop/lucas.nix create mode 100644 users/nzxt-desktop/culsans.nix create mode 100644 users/prodesk-server/server.nix create mode 100644 users/steam-deck/culsans.nix diff --git a/docs/home-server.md b/docs/home-server.md new file mode 100644 index 0000000..fd2de2c --- /dev/null +++ b/docs/home-server.md @@ -0,0 +1,53 @@ +# Home Server + +## Programs: + +Categories: + +- core: Uncontainerized services like ssh, backups, and caddy. +- cloud: File storage services like syncthing. +- development: Developer operations services like gitolite and cgit. +- gaming: Game servers like minecraft. +- media: Media services like calibre-web, invidious, and plex. +- networking: Networking services like Wireguard, firewall, etc. +### Services + +#### Uncontainerized: + +- SSH +- Backups +- Caddy + +#### Containerized: + +- Git Server (Gitolite, Cgit) +- Calibre +- Invidious +- Syncthing +- Minecraft +- Wireguard + +#### Considering: + +- Plex +- File Storage? + +### Directory Layout + +/srv/ + www/: Personal website. + sync/: Syncronized files. + git/: Repos and data for Gitolite and Cgit. + minecraft/: Minecraft servers. + +### Checklist + +- [ ] Setup SSH +- [ ] Setup Syncthing +- [ ] Setup Caddy +- [ ] Setup Https Website +- [ ] Setup Minecraft Server +- [ ] Setup Git Server +- [ ] Setup Wireguard +- [ ] Setup Invidious +- [ ] Setup Calibre diff --git a/docs/layout.md b/docs/layout.md new file mode 100644 index 0000000..4c38883 --- /dev/null +++ b/docs/layout.md @@ -0,0 +1,74 @@ +# Layout + +features/: Simple reusable configurations (only create an enable option and maybe one other). + system/ + gui/: Graphical configurations. + desktops/: Desktop environments, compositors, window managers, etc. + apps/: Graphical apps. + bundles/: Collections of gui configurations. + cli/: Commandline configurations. + scripts/: Custom scripts. + apps/: Commandline apps (TUIs). + utils/: Commandline utils. + shells/: Shell configurations. + bundles/: Collections of cli configs. + services/: Service configurations. + core/: Highest importance services. + extra/: Medium importance services. + misc/: Miscellaneous services. + hardware/: Hardware services. + bundles: Collections of service configs. + global/: Always enabled on every device. + server/: Server configurations. + core/: Core server configs (e.g. SSH, Backups, system monitoring). + media/: Server apps for managing media (books, videos, etc) (e.g. Calibre or Invidious). + cloud/: Server apps for file storage (e.g. Syncthing, Nextcloud). + development/: Server apps to assist in development (e.g. Git server setup). + gaming/: Game servers (e.g. Minecraft). + user/ + gui/: Graphical configurations. + desktops/ + apps/ + bundles/ + cli/ + scripts/ + apps/ + utils/ + bundles/ + services/ + global/ + home-manager.nix +modules/: Custom nix modules (Can create any amount of options). + system/: Custom nixos modules. + user/: Custom home-manager modules. + aesthetics/ + default.nix + targets/ + themes/ +secrets/: Age-encrypted secrets integrated with nixos. + user-passwords/ + culsans.age + lucas.age + server.age +users/: User specific home manager configurations + nzxt-desktop/ + culsans.nix + ideapad-laptop/ + lucas.nix + prodesk-server/ + server.nix + pendrive-iso/ + pendrive.nix +systems/: System-specific nixos configurations. + nzxt-desktop/ + system.nix + hardware.nix + ideapad-laptop/ + system.nix + hardware.nix + prodesk-server/ + system.nix + hardware.nix + pendrive-iso/ + system.nix + hardware.nix diff --git a/docs/todo.md b/docs/todo.md new file mode 100644 index 0000000..22a6977 --- /dev/null +++ b/docs/todo.md @@ -0,0 +1,25 @@ +# Setup + +## Todo + +- add new workspace keybind to niri +- add niri mode to make it hard to watch yt +- Setup swayidle +- make swww use default wallpaper if it has none applied +- create modular server setup +- set up the default apps module. +- set a terminal to use with fuzzel +- add OSD to niri +- add a qutebrowser keybind to open a link in tor +- find a password manager +- disable touch gestures in niri +- set = to zoom in in qutebrowser +- make qr tool not use tempfiles cluttering homedir +- make private tor vm + +## Issues + +- Apps won't open terminal when they try to open a file manager (show in folder does not work) (maybe xdg-open doesn't see foot?). +- Steam is a black window on ideapad-laptop. +- Ideapad-laptop wakes immediately when suspended. +- Unclear whether niri lid switch events are actually happening when laptop closes. diff --git a/features/system/cli/shells/nushell.nix b/features/system/cli/shells/nushell.nix new file mode 100644 index 0000000..0974e9a --- /dev/null +++ b/features/system/cli/shells/nushell.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.cli.shells.nushell; +in { + options.features.cli.shells.nushell.enable = lib.mkEnableOption "nushell"; + config = lib.mkIf cfg.enable { + environment.shells = [ pkgs.nushell ]; + users.defaultUserShell = pkgs.nushell; + environment.systemPackages = [ pkgs.nushell ]; + }; +} diff --git a/features/system/cli/utils/nh.nix b/features/system/cli/utils/nh.nix new file mode 100644 index 0000000..e34157e --- /dev/null +++ b/features/system/cli/utils/nh.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: let + cfg = config.features.cli.utils.nh; +in { + options.features.cli.utils.nh = { + enable = lib.mkEnableOption "nh"; + flake = lib.mkOption { + type = lib.types.str; + description = "Absolute path to the flake."; + }; + }; + config = lib.mkIf cfg.enable { + programs.nh = { + enable = true; + flake = cfg.flake; + }; + }; +} diff --git a/features/system/global/agenix.nix b/features/system/global/agenix.nix new file mode 100644 index 0000000..f232886 --- /dev/null +++ b/features/system/global/agenix.nix @@ -0,0 +1,7 @@ +{ pkgs, inputs, ...}: { + imports = [ inputs.agenix.nixosModules.default ]; + environment.systemPackages = [ + inputs.agenix.packages.${pkgs.system}.default + ]; + age.identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; +} diff --git a/features/system/global/nix.nix b/features/system/global/nix.nix new file mode 100644 index 0000000..a0ece02 --- /dev/null +++ b/features/system/global/nix.nix @@ -0,0 +1,13 @@ +{ ... }: { + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + gc = { + automatic = true; + dates = "daily"; + options = "-d 5"; + }; + }; +} diff --git a/features/system/global/noxterm.nix b/features/system/global/noxterm.nix new file mode 100644 index 0000000..44c0917 --- /dev/null +++ b/features/system/global/noxterm.nix @@ -0,0 +1,3 @@ +{ pkgs, ... }: { + services.xserver.excludePackages = [ pkgs.xterm ]; +} diff --git a/features/system/gui/apps/steam.nix b/features/system/gui/apps/steam.nix new file mode 100644 index 0000000..de17f43 --- /dev/null +++ b/features/system/gui/apps/steam.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.features.gui.apps.steam; +in { + options.features.gui.apps.steam.enable = lib.mkEnableOption "steam"; + config = lib.mkIf cfg.enable { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + gamescopeSession.enable = true; + }; + hardware.steam-hardware.enable = true; + programs.gamemode.enable = true; + environment.systemPackages = [pkgs.mangohud]; + + # Steam Launch Options + # Add this to 3D games: + # LD_PRELOAD="" gamescope --force-grab-cursor --backend sdl -bf -W 1600 -H 900 -- %command% + # Add this to 2D games: + # LD_PRELOAD="" gamescope -bf -W 1600 -H 900 -- %command% + }; +} diff --git a/features/system/gui/apps/vmware.nix b/features/system/gui/apps/vmware.nix new file mode 100644 index 0000000..4da3f09 --- /dev/null +++ b/features/system/gui/apps/vmware.nix @@ -0,0 +1,8 @@ +{ config, lib, ... }: let + cfg = config.features.gui.apps.vmware; +in { + options.features.gui.apps.vmware.enable = lib.mkEnableOption "vmware"; + config = lib.mkIf cfg.enable { + virtualisation.vmware.host.enable = true; + }; +} diff --git a/features/system/gui/desktops/niri.nix b/features/system/gui/desktops/niri.nix new file mode 100644 index 0000000..c68a4b6 --- /dev/null +++ b/features/system/gui/desktops/niri.nix @@ -0,0 +1,9 @@ +{ config, lib, inputs, ... }: let + cfg = config.features.gui.desktops.niri; +in { + imports = [ inputs.niri.nixosModules.niri ]; + options.features.gui.desktops.niri.enable = lib.mkEnableOption "niri"; + config = lib.mkIf cfg.enable { + programs.niri.enable = true; + }; +} diff --git a/features/system/server/cloud/syncthing.nix b/features/system/server/cloud/syncthing.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/features/system/server/cloud/syncthing.nix @@ -0,0 +1 @@ +{} diff --git a/features/system/server/core/ssh.nix b/features/system/server/core/ssh.nix new file mode 100644 index 0000000..16fec48 --- /dev/null +++ b/features/system/server/core/ssh.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: let + cfg = config.features.server.ssh; +in { + options.features.server.ssh.enable = lib.mkEnableOption "sshd"; + config = lib.mkIf cfg.enable { + services.openssh = { + enable = true; + ports = [ 2200 ]; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + }; +} diff --git a/features/system/server/development/git-server.nix b/features/system/server/development/git-server.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/features/system/server/development/git-server.nix @@ -0,0 +1 @@ +{} diff --git a/features/system/server/gaming/minecraft.nix b/features/system/server/gaming/minecraft.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/features/system/server/gaming/minecraft.nix @@ -0,0 +1 @@ +{} diff --git a/features/system/server/media/calibre.nix b/features/system/server/media/calibre.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/features/system/server/media/calibre.nix @@ -0,0 +1 @@ +{} diff --git a/features/system/server/media/invidious.nix b/features/system/server/media/invidious.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/features/system/server/media/invidious.nix @@ -0,0 +1 @@ +{} diff --git a/features/system/services/bundles/printing.nix b/features/system/services/bundles/printing.nix new file mode 100644 index 0000000..ea255be --- /dev/null +++ b/features/system/services/bundles/printing.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: let + cfg = config.features.services.bundles.printing; +in { + options.features.services.bundles.printing.enable = lib.mkEnableOption "printing"; + config = lib.mkIf cfg.enable { + services.printing.enable = true; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + }; +} diff --git a/features/system/services/core/systemd-boot.nix b/features/system/services/core/systemd-boot.nix new file mode 100644 index 0000000..2826f1b --- /dev/null +++ b/features/system/services/core/systemd-boot.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: let + cfg = config.features.services.core.systemd-boot; +in { + options.features.services.core.systemd-boot.enable = lib.mkEnableOption "systemd-boot"; + config = lib.mkIf cfg.enable { + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; +} diff --git a/features/system/services/extra/plymouth.nix b/features/system/services/extra/plymouth.nix new file mode 100644 index 0000000..07f00cd --- /dev/null +++ b/features/system/services/extra/plymouth.nix @@ -0,0 +1,36 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.extra.plymouth; +in { + options.features.services.extra.plymouth.enable = lib.mkEnableOption "plymouth"; + config = lib.mkIf cfg.enable { + boot = { + plymouth = { + enable = true; + theme = "dark_planet"; + themePackages = with pkgs; [ + # By default we would install all themes + (adi1090x-plymouth-themes.override { + selected_themes = [ "dark_planet" ]; + }) + ]; + }; + + # Enable "Silent Boot" + consoleLogLevel = 0; + initrd.verbose = false; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "loglevel=3" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + # Hide the OS choice for bootloaders. + # It's still possible to open the bootloader list by pressing any key + # It will just not appear on screen unless a key is pressed + loader.timeout = 0; + }; + }; +} diff --git a/features/system/services/extra/sddm.nix b/features/system/services/extra/sddm.nix new file mode 100644 index 0000000..f266575 --- /dev/null +++ b/features/system/services/extra/sddm.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.extra.sddm; + sddm-astronaut = pkgs.sddm-astronaut.override { + themeConfig = { + # Background = ./background.png; + }; + }; +in { + options.features.services.extra.sddm.enable = lib.mkEnableOption "sddm"; + config = lib.mkIf cfg.enable { + services = { + displayManager.sddm = { + enable = true; + wayland.enable = true; + package = pkgs.kdePackages.sddm; + theme = "sddm-astronaut-theme"; + extraPackages = [ sddm-astronaut ]; + }; + # xserver.enable = true; + }; + environment.systemPackages = [ sddm-astronaut ]; + }; +} diff --git a/features/system/services/extra/ssh.nix b/features/system/services/extra/ssh.nix new file mode 100644 index 0000000..d1cee26 --- /dev/null +++ b/features/system/services/extra/ssh.nix @@ -0,0 +1,14 @@ +{ config, lib, ... }: let + cfg = config.features.services.extra.ssh; +in { + options.features.services.extra.ssh.enable = lib.mkEnableOption "ssh"; + config = lib.mkIf cfg.enable { + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + }; +} diff --git a/features/system/services/extra/syncthing-client.nix b/features/system/services/extra/syncthing-client.nix new file mode 100644 index 0000000..6d3d3d3 --- /dev/null +++ b/features/system/services/extra/syncthing-client.nix @@ -0,0 +1,35 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.extra.syncthing-client; +in { + options.features.services.extra.syncthing-client = { + enable = lib.mkEnableOption "syncthing"; + username = lib.mkOption { + type = lib.types.str; + description = "The username of syncthing's user"; + }; + }; + config = lib.mkIf cfg.enable { + services.syncthing = { + enable = true; + user = cfg.username; + dataDir = "/home/${cfg.username}/Sync"; + configDir = "/home/${cfg.username}/.config/syncthing"; + overrideDevices = true; + overrideFolders = true; + settings = { + devices = { + "prodesk-server" = { + id = "SBH4S2T-B7KVAAI-BKBOQKZ-YSNQDSM-TKXPV6O-OSZUD3O-N6USL6L-DHL3BAK"; + }; + }; + folders = { + "Main" = { + path = "/home/${cfg.username}/Sync"; + devices = [ "prodesk-server" ]; + }; + }; + }; + }; + environment.systemPackages = [ pkgs.syncthing ]; + }; +} diff --git a/features/system/services/extra/udisks2.nix b/features/system/services/extra/udisks2.nix new file mode 100644 index 0000000..2ec2fa4 --- /dev/null +++ b/features/system/services/extra/udisks2.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + ... +}: let + cfg = config.features.services.extra.udisks2; +in { + options.features.services.extra.udisks2.enable = lib.mkEnableOption "udisks2"; + config = lib.mkIf cfg.enable { + services.udisks2.enable = true; + }; +} diff --git a/features/system/services/hardware/bluetooth.nix b/features/system/services/hardware/bluetooth.nix new file mode 100644 index 0000000..a9829ac --- /dev/null +++ b/features/system/services/hardware/bluetooth.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.hardware.bluetooth; +in { + options.features.services.hardware.bluetooth.enable = lib.mkEnableOption "bluetooth"; + config = lib.mkIf cfg.enable { + environment.systemPackages = [ pkgs.bluetui ]; + services.blueman = { + enable = true; + }; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.pulseaudio = { + package = pkgs.pulseaudioFull; + }; + hardware.bluetooth.settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; +} diff --git a/features/system/services/hardware/iwd.nix b/features/system/services/hardware/iwd.nix new file mode 100644 index 0000000..c2394bc --- /dev/null +++ b/features/system/services/hardware/iwd.nix @@ -0,0 +1,19 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.hardware.iwd; +in { + options.features.services.hardware.iwd.enable = lib.mkEnableOption "iwd"; + config = lib.mkIf cfg.enable { + environment.systemPackages = [ pkgs.impala ]; + networking.wireless.iwd = { + enable = true; + settings = { + IPv6 = { + Enabled = true; + }; + Settings = { + AutoConnect = true; + }; + }; + }; + }; +} diff --git a/features/system/services/hardware/networkmanager.nix b/features/system/services/hardware/networkmanager.nix new file mode 100644 index 0000000..49cc7bc --- /dev/null +++ b/features/system/services/hardware/networkmanager.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: let + cfg = config.features.services.hardware.networkmanager; +in { + options.features.services.hardware.networkmanager.enable = lib.mkEnableOption "networkmanager"; + config = lib.mkIf cfg.enable { + networking.networkmanager = { + enable = true; + }; + systemd.services.NetworkManager-wait-online.enable = false; + }; +} diff --git a/features/system/services/hardware/pipewire.nix b/features/system/services/hardware/pipewire.nix new file mode 100644 index 0000000..f36a0e9 --- /dev/null +++ b/features/system/services/hardware/pipewire.nix @@ -0,0 +1,15 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.hardware.pipewire; +in { + options.features.services.hardware.pipewire.enable = lib.mkEnableOption "pipewire"; + config = lib.mkIf cfg.enable { + security.rtkit.enable = true; + environment.systemPackages = [ pkgs.git ]; # Fixes a weird error + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + }; +} diff --git a/features/user/cli/apps/btop.nix b/features/user/cli/apps/btop.nix new file mode 100644 index 0000000..5bb2499 --- /dev/null +++ b/features/user/cli/apps/btop.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: let + cfg = config.features.cli.apps.btop; +in { + options.features.cli.apps.btop.enable = lib.mkEnableOption "btop"; + config = lib.mkIf cfg.enable { + programs.btop = { + enable = true; + settings = { + color_theme = "TTY"; + theme_background = false; + update_ms = 500; + }; + }; + }; +} diff --git a/features/user/cli/apps/helix.nix b/features/user/cli/apps/helix.nix new file mode 100644 index 0000000..a267b23 --- /dev/null +++ b/features/user/cli/apps/helix.nix @@ -0,0 +1,71 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.features.cli.apps.helix; +in { + options.features.cli.apps.helix.enable = lib.mkEnableOption "helix"; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + wl-clipboard + ]; + programs.helix = { + enable = true; + extraPackages = with pkgs; [ + markdown-oxide + python312Packages.black + vscode-langservers-extracted + nil + ]; + settings = { + editor = { + color-modes = true; + true-color = true; + line-number = "relative"; + mouse = false; + lsp.display-messages = true; + statusline = { + left = ["file-name" "file-modification-indicator"]; + center = []; + right = []; + mode = { + normal = "NORMAL"; + insert = "INSERT"; + select = "SELECT"; + }; + }; + cursor-shape = { + normal = "block"; + insert = "bar"; + select = "underline"; + }; + soft-wrap = { + enable = true; + wrap-indicator = ""; + }; + }; + keys = { + normal = { + esc = ["collapse_selection" "keep_primary_selection"]; + space = { + v = "file_picker_in_current_buffer_directory"; + h = ":lsp-workspace-command"; + }; + }; + }; + }; + languages = { + language = [ + { + name = "nix"; + auto-format = true; + formatter.command = "${pkgs.alejandra}/bin/alejandra"; + language-servers = ["nil"]; + } + ]; + }; + }; + }; +} diff --git a/features/user/cli/apps/zellij.nix b/features/user/cli/apps/zellij.nix new file mode 100644 index 0000000..8942771 --- /dev/null +++ b/features/user/cli/apps/zellij.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: let + cfg = config.features.cli.apps.zellij; +in { + options.features.cli.apps.zellij.enable = lib.mkEnableOption "zellij"; + config = lib.mkIf cfg.enable { + programs.zellij = { + enable = true; + settings = { + pane_frames = true; + ui.pane_frames.rounded_corners = true; + simplified_ui = true; + default_layout = "compact"; + hide_session_name = true; + + mouse_mode = false; + + on_force_close = "detach"; + session_serialization = true; + }; + }; + }; +} diff --git a/features/user/cli/bundles/go-env.nix b/features/user/cli/bundles/go-env.nix new file mode 100644 index 0000000..6e103a3 --- /dev/null +++ b/features/user/cli/bundles/go-env.nix @@ -0,0 +1,14 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.cli.bundles.go-env; +in { + options.features.cli.bundles.go-env.enable = lib.mkEnableOption "go-env"; + config = lib.mkIf cfg.enable { + home.sessionVariables = { + GOPATH = "~/.go"; + }; + home.packages = with pkgs; [ + go + gopls + ]; + }; +} diff --git a/features/user/cli/scripts/spiral/default.nix b/features/user/cli/scripts/spiral/default.nix new file mode 100644 index 0000000..780c207 --- /dev/null +++ b/features/user/cli/scripts/spiral/default.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.cli.scripts.spiral; +in { + options.features.cli.scripts.spiral.enable = lib.mkEnableOption "spiral"; + config = lib.mkIf cfg.enable { + home.packages = [ + (pkgs.writers.writeNuBin "sp" (builtins.readFile ./spiral.nu)) + ]; + }; +} diff --git a/features/user/cli/scripts/spiral/plan.md b/features/user/cli/scripts/spiral/plan.md new file mode 100644 index 0000000..adbcba0 --- /dev/null +++ b/features/user/cli/scripts/spiral/plan.md @@ -0,0 +1,47 @@ +# Spiral Plan + +## Main Functions + +Are ran by the user. + +- `main new (--no-frontmatter (-n)) (title: )` +- `main open (--by-title (-t)) (--by-contents (-c)) (title: )` +- `main tags (tag: )` +- `main remove (--by-title (-t)) (--by-contents (-c)) (title: )` +- `main list` +- `main restore (--by-title (-t)) (--by-contents (-c)) (title: )` +- `main journal (date: )` + +## Action Functions + +Accept parameters and perform an action. + +- `create_note (--no-frontmatter) --title ` +- `create_journal_entry --title ` +- `open_file_in_editor --dir ` + +## Interface Functions + +Accept a prompt and other data and return a value from the user. + +- `get_confirmation --prompt -> bool` +- `get_string_input --prompt -> string` +- `get_choice_from_list --list -> string` +- `get_choice_from_dir --dir -> path` +- `get_choice_from_dir_file_contents --dir -> path: line number` +- `get_choice_from_note_titles --dir -> path` + +## String Manipulation Functions + +Accept, modify, and return strings. + +- `title_to_path title: -> path` +- `strip_line_number string: -> string` +- `generate_note_text (--no-frontmatter) --title -> string` + +## File Manipulation Functions + +Read, write, or otherwise manipulate files. + +- `parse_note_frontmatter path: -> record` +- `list_notes -> table` diff --git a/features/user/cli/scripts/spiral/spiral.nu b/features/user/cli/scripts/spiral/spiral.nu new file mode 100755 index 0000000..399dace --- /dev/null +++ b/features/user/cli/scripts/spiral/spiral.nu @@ -0,0 +1,329 @@ +#!/usr/bin/env nu + +# +---------------+ +# | Configuration | +# +---------------+ + +# Default config options. +mut config = { + notebook_dir: "~/Sync/notebook" + journal_dir: "~/Sync/notebook/journal" + trash_dir: "~/Sync/notebook/.trash" +} + +# Read config options from environment variables. +if ((try {$env.spiral_notebook_dir}) != null) { + $config.notebook_dir = $env.spiral_notebook_dir +} +if ((try {$env.spiral_journal_dir}) != null) { + $config.journal_dir = $env.spiral_journal_dir +} +if ((try {$env.spiral_trash_dir}) != null) { + $config.trash_dir = $env.spiral_trash_dir +} + +# Make config immutable. +let config = $config + +# +-------------+ +# | Subcommands | +# +-------------+ + +# A commandline utility written in nushell to manage your markdown notebook! +def "main" [] {} + +# Create a new note. +def "main new" [ + title?: string # The title of the new note. + --no-frontmatter (-n) # Don't add a frontmatter to the note. +] { + mut title = $title + if ($title == null) { + $title = get_string_input "Enter a title: " + } + if $no_frontmatter { + create_note --no-frontmatter $title + } else { + create_note $title + } +} + +# Open a pre-existing note. +def "main open" [ + --by-title (-t) # Filter notes by their title (disables preview) + --by-contents (-c) # Search through the contents of the notebook. + title?: string # The title of the note to open. +] { + if ($by_title and $by_contents) { + error make {msg: "Only one flag can be used at a time."} + } + if ($title != null) { + if ((title_to_path $title) | path exists) { + return (title_to_path $title) + } else { + if (confirm $"The note ($title) does not exist. Would you like to create it? ") { + create_note $title + } + } + } else if $by_title { + edit $"(get_choice_from_note_titles --dir $config.notebook_dir)" + } else if $by_contents { + edit (get_choice_from_dir_file_contents --dir $config.notebook_dir) + } else { + edit $"(get_choice_from_dir --dir $config.notebook_dir)" + } +} + +# Open a note based on the tag. +def "main tags" [ + tag?: string # The tag to select a note from. +] { + # This section of code creates nested records with tags and notes and stores them in $tag_record. + let note_table = list_notes --dir $config.notebook_dir + + let tag_list = $note_table + | get tags + | flatten + | where (($it != null) and ($it != "")) + + mut tag_record = {} + + print $tag_list + for tag in $tag_list { + mut notes = {} + for note_path in ($note_table | get path) { + let note_tags = ($note_table | where path == $note_path | get tags | flatten) + let note_title = ($note_table | where path == $note_path | get title | to text | str trim) + if ($note_tags != []) { + for note_tag in $note_tags { + if ($note_tag == $tag) { + $notes = $notes | insert $note_title { $note_path } + } + } + } + } + let notes = $notes + # $tag_record = $tag_record | insert $tag { $notes } + } + + # Actual logic of the subcommand + if ($tag == null) { + let user_tag_choice = get_choice_from_list --list $tag_list + if ($user_tag_choice != "") { + let note_record = $tag_record | get $user_tag_choice + let user_note_title_choice = get_choice_from_list --list ($note_record | columns) + if ($user_note_title_choice != "") { + edit ($note_record | get $user_note_title_choice) + } + } + } else { + if ($tag_list | any {|item| $item == $tag}) { + let note_record = $tag_record | get $tag + let user_note_title_choice = get_choice_from_list --list ($note_record | columns) + if ($user_note_title_choice != "") { + edit ($note_record | get $user_note_title_choice) + } + } else { + print $"The tag '($tag)' does not exist." + } + } +} + +# Get a table of notes and their properties. +def "main list" [] { + return (list_notes --dir $config.notebook_dir) +} + +# Send a note to the trash. +def "main remove" [ + --by-title (-t) # Filter notes by their title (disables preview) + --by-contents (-c) # Search through the contents of the notebook. + title?: string # The title of the note to send to the trash. +] { + if ($by_title and $by_contents) { + error make {msg: "Only one flag can be used at a time."} + } + if ($title != null) { + if ((title_to_path $title) | path exists) { + return (title_to_path $title) + } else { + if (confirm $"The note ($title) does not exist. Would you like to create it? ") { + create_note $title + } + } + } else if $by_title { + mv (select_note --by-title --dir $config.notebook_dir) + } else if $by_contents { + ^$env.editor (select_note --by-contents --dir $config.notebook_dir) + } else { + ^$env.editor (select_note --dir $config.notebook_dir) + } +} + +# Explains how to configural Spiral. +def "main config" [] { + print "The default options:" + print $config + print "These can be modified by editing the environment variables corresponding to each option. For example, to change the notebook directory, set $env.spiral_notebook_dir='~/custom-dir/notebook'." +} + +# +------------------+ +# | Action Functions | +# +------------------+ + +def create_note [--no-frontmatter, title: string] { + let note_path = title_to_path $title + if ($note_path | path exists) { + if (confirm "This note already exists. Would you like to open it?") { + edit $note_path + } else {exit} + } else { + if $no_frontmatter { + generate_note_text --no-frontmatter --title $title | save $note_path + } else { + generate_note_text --title $title | save $note_path + } + edit $"($note_path):100:100" + } +} + +def create_journal_entry [ + +] { + +} + +def edit [ + file_path: string +] { + if (($file_path | path type) == file) { + ^$env.editor ($file_path | path expand) + } +} + +# +---------------------+ +# | Interface Functions | +# +---------------------+ + +def get_string_input [prompt: string] { + print $prompt + return (input) +} + +def get_confirmation [prompt: string] { + print $"($prompt) \(Y/n)" + let confirmation = (input | str downcase) + if ($confirmation == "n" ) { + return false + } else {return true} +} + +def get_choice_from_list [ --list: list ] { + return (($list | to text) | tv) +} # -> string + +def get_choice_from_dir [ --dir: string ] { + return $"($config.notebook_dir | path expand)/(tv files ($dir | path expand))" +} # -> full path + +def get_choice_from_dir_file_contents [ --dir: string ] { + return $"($config.notebook_dir | path expand)/(tv text ($dir | path expand))" +} # -> full path: line number + +def get_choice_from_note_titles [ --dir: string ] { + let note_table = list_notes --dir $config.notebook_dir + let user_choice = get_choice_from_list --list ($note_table | get title) + let user_choice_path = ( + $note_table + | where title == $user_choice + | get path + | to text + | str trim + ) + if (($user_choice_path | path type) == file) { + return $user_choice_path + } +} # -> full path + +# +-------------------------------+ +# | String Manipulation Functions | +# +-------------------------------+ + +def title_to_path [title: string] { + return ( + $"($config.notebook_dir)/($title | str kebab-case).md" + | path expand + ) +} # -> full path + +def strip_line_number [string: string] { + return ( + $string + | split row ":" + | select 0 + | to text + | str trim + ) +} # -> string + +def generate_note_text [ + --no-frontmatter + --title: string +] { + if $no_frontmatter { + return $"# ($title)\n" + } else { + let frontmatter_info = { + title: $title + date: (date now) + lang: "en-US" + tags: ['note'] + } + return $"---\n($frontmatter_info | to yaml)---\n\n# ($title)" + } +} # -> string + +# +-----------------------------+ +# | File Manipulation Functions | +# +-----------------------------+ + +def list_notes [--dir: string] { + return (( + ls ($dir | path expand) + | where type == file + | get name + ) | par-each { + |note_path| + let frontmatter = parse_frontmatter $note_path + if ($frontmatter != null) { + return { + title: (try {$frontmatter.title}) + path: $note_path + tags: (try {$frontmatter.tags}) + date: (try {$frontmatter.date}) + lang: (try {$frontmatter.lang}) + } + } + }) +} # -> table + +def parse_frontmatter [path: string] { + let frontmatter = try { + open ($path | path expand) + | split row "---" + | get 1 + | from yaml + } + if ($frontmatter == null) { + let title = try { + open ($path | path expand) + | split row "#" + | get 1 + | split row "\n" + | get 0 + | str trim + } + return {title: $title} + } + return $frontmatter +} # -> record diff --git a/features/user/cli/shells/nushell/completion.nu b/features/user/cli/shells/nushell/completion.nu new file mode 100644 index 0000000..b25d387 --- /dev/null +++ b/features/user/cli/shells/nushell/completion.nu @@ -0,0 +1,17 @@ +# Carapace Autocomplete +let carapace_completer = {|spans| + carapace $spans.0 nushell ...$spans | from json +} +$env.config = { + completions: { + case_sensitive: false + quick: true + partial: true + algorithm: fuzzy + external: { + enable: true + max_results: 100 + completer: $carapace_completer + } + } +} diff --git a/features/user/cli/shells/nushell/default.nix b/features/user/cli/shells/nushell/default.nix new file mode 100644 index 0000000..7df34e8 --- /dev/null +++ b/features/user/cli/shells/nushell/default.nix @@ -0,0 +1,93 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.features.cli.shells.nushell; +in { + options.features.cli.shells.nushell.enable = lib.mkEnableOption "nushell"; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + television + gitprompt-rs + ]; + programs.nushell = { + enable = true; + plugins = with pkgs.nushellPlugins; [ + gstat + ]; + shellAliases = { + "nix-shell" = "nix-shell --command 'SHELL=nu nu'"; + "cd" = "z"; + "ze" = "zellij"; + "bk" = "cd $env.OLDPWD"; + "fg" = "job unfreeze"; + }; + configFile.text = + /* + nu + */ + '' + # Source modularized configs. + source ${./prompt.nu} + source ${./completion.nu} + + # General Config + $env.config = { + show_banner: false + edit_mode: 'vi' + + history: { + isolation: true # Isolate the history of each nushell session + file_format: sqlite # Required for isolation + } + } + $env.editor = "hx" + + # go should use a hidden directory + $env.gopath = "${config.home.homeDirectory}/.go" + + # Use direnv if present. + { || + if (which direnv | is-empty) { + return + } + direnv export json | from json | default {} | load-env + + } + + # define a function to initialize a direnv project + def projinit [path?: string] { + mut path = $path + if ($path == null) { + $path = "./" + } + let path = $path | path expand + cp -r ${./direnv-project-template}/* ./ + direnv allow + } + + # Quicker nix shells. + def qs [...pkgs] { + if $pkgs == [] { + print "Please use a package name" + return + } + let pkgs_string = $pkgs + | each {|pkg| return $"nixpkgs#($pkg) "} + | str join + | str trim + nu -c $"nix shell ($pkgs_string)" + } + ''; + }; + programs.zoxide.enable = true; + programs.carapace.enable = true; + programs.direnv = { + enable = true; + nix-direnv.enable = true; + silent = true; + }; + }; +} diff --git a/features/user/cli/shells/nushell/direnv-project-template/.envrc b/features/user/cli/shells/nushell/direnv-project-template/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/features/user/cli/shells/nushell/direnv-project-template/.envrc @@ -0,0 +1 @@ +use flake diff --git a/features/user/cli/shells/nushell/direnv-project-template/flake.nix b/features/user/cli/shells/nushell/direnv-project-template/flake.nix new file mode 100644 index 0000000..4bab14a --- /dev/null +++ b/features/user/cli/shells/nushell/direnv-project-template/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Project flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + systems.url = "github:nix-systems/default"; + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + }; + + outputs = { + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + hello + ]; + }; + } + ); +} diff --git a/features/user/cli/shells/nushell/prompt.nu b/features/user/cli/shells/nushell/prompt.nu new file mode 100644 index 0000000..9e04ed5 --- /dev/null +++ b/features/user/cli/shells/nushell/prompt.nu @@ -0,0 +1,95 @@ +# +---------------+ +# | Prompt Config | +# +---------------+ + +# define segmants +def path_segment [] { + let current_dir = pwd + let truncated_current_dir = $current_dir + return (pwd | str replace $env.home '~') +} +def git_segment [] { + return (gitprompt-rs) +} +let do_newline = false # whether to do the newline thing +$env.PROMPT_COMMAND = {|| + # add a newline at the beginning if it isn't the first prompt + mut newline = "" + if ($env.CMD_DURATION_MS != '0823') and $do_newline { + $newline = "\n" + } + # define the prompt + return $"($newline)(ansi white) â•­ (ansi green_bold)(path_segment)(ansi reset) (git_segment)\n " +} + +# remove right prompt section +$env.PROMPT_COMMAND_RIGHT = { "" } + +# set default prompt indicator +$env.PROMPT_INDICATOR = $'(ansi white)â•° (ansi red_bold)> ' +# $env.TRANSIENT_PROMPT_INDICATOR = $' (ansi red_bold)> ' +$env.PROMPT_MULTILINE_INDICATOR = " : " + +# change prompt to a lambda if in a nix shell +let in_nix_shell = $env.path | str contains "/nix/store" | any {|el| $el} +if $in_nix_shell { + $env.PROMPT_INDICATOR = $'(ansi white)â•° (ansi red_bold)λ ' +} + +# replace vi insert and normal mode prompt indicators with cursor changes +$env.PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR +$env.PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR +$env.config.cursor_shape.vi_insert = "line" +$env.config.cursor_shape.vi_normal = "block" + +# customize menus to match +$env.config.menus = [ + { + name: help_menu + only_buffer_difference: true # Search is done on the text written after activating the menu + marker: $env.PROMPT_INDICATOR # Indicator that appears with the menu is active + type: { + layout: description # Type of menu + columns: 4 # Number of columns where the options are displayed + col_width: 20 # Optional value. If missing all the screen width is used to calculate column width + col_padding: 2 # Padding between columns + selection_rows: 4 # Number of rows allowed to display found options + description_rows: 10 # Number of rows allowed to display command description + } + style: { + text: green # Text style + selected_text: green_reverse # Text style for selected option + description_text: yellow # Text style for description + } + } + { + name: completion_menu + only_buffer_difference: false # Search is done on the text written after activating the menu + marker: $env.PROMPT_INDICATOR # Indicator that appears with the menu is active + type: { + layout: columnar # Type of menu + columns: 4 # Number of columns where the options are displayed + col_width: 20 # Optional value. If missing all the screen width is used to calculate column width + col_padding: 2 # Padding between columns + } + style: { + text: green # Text style + selected_text: green_reverse # Text style for selected option + description_text: yellow # Text style for description + } + } + { + name: history_menu + only_buffer_difference: true # Search is done on the text written after activating the menu + marker: $env.PROMPT_INDICATOR # Indicator that appears with the menu is active + type: { + layout: list # Type of menu + page_size: 10 # Number of entries that will presented when activating the menu + } + style: { + text: green # Text style + selected_text: green_reverse # Text style for selected option + description_text: yellow # Text style for description + } + } +] diff --git a/features/user/cli/utils/git.nix b/features/user/cli/utils/git.nix new file mode 100644 index 0000000..8d202d1 --- /dev/null +++ b/features/user/cli/utils/git.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: let + cfg = config.features.cli.utils.git; +in { + options.features.cli.utils.git.enable = lib.mkEnableOption "git"; + config = lib.mkIf cfg.enable { + programs.git = { + enable = true; + userEmail = "culsans@vivaldi.net"; + userName = "culsans"; + }; + }; +} diff --git a/features/user/cli/utils/pandoc.nix b/features/user/cli/utils/pandoc.nix new file mode 100644 index 0000000..899bd4b --- /dev/null +++ b/features/user/cli/utils/pandoc.nix @@ -0,0 +1,13 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.cli.utils.pandoc; +in { + options.features.cli.utils.pandoc.enable = lib.mkEnableOption "pandoc"; + config = lib.mkIf cfg.enable { + programs.pandoc = { + enable = true; + }; + home.packages = with pkgs; [ + texliveSmall + ]; + }; +} diff --git a/features/user/cli/utils/ssh.nix b/features/user/cli/utils/ssh.nix new file mode 100644 index 0000000..f10d0b2 --- /dev/null +++ b/features/user/cli/utils/ssh.nix @@ -0,0 +1,20 @@ +{ config, lib, ... }: let + cfg = config.features.cli.utils.ssh; +in { + options.features.cli.utils.ssh.enable = lib.mkEnableOption "ssh"; + config = lib.mkIf cfg.enable { + programs.ssh = { + enable = true; + matchBlocks = { + "culsans.site" = { + hostname = "culsans.site"; + user = "server"; + port = 2200; + }; + "git.culsans.site" = { + hostname = "culsans.site"; + }; + }; + }; + }; +} diff --git a/features/user/global/home-manager.nix b/features/user/global/home-manager.nix new file mode 100644 index 0000000..4be0d07 --- /dev/null +++ b/features/user/global/home-manager.nix @@ -0,0 +1,3 @@ +{ ... }: { + programs.home-manager.enable = true; +} diff --git a/features/user/global/nixpkgs.nix b/features/user/global/nixpkgs.nix new file mode 100644 index 0000000..b19d5e0 --- /dev/null +++ b/features/user/global/nixpkgs.nix @@ -0,0 +1,3 @@ +{...}: { + nixpkgs.config.allowUnfree = true; +} diff --git a/features/user/gui/apps/foot.nix b/features/user/gui/apps/foot.nix new file mode 100644 index 0000000..d099e16 --- /dev/null +++ b/features/user/gui/apps/foot.nix @@ -0,0 +1,14 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.gui.apps.foot; +in { + options.features.gui.apps.foot.enable = lib.mkEnableOption "foot"; + config = lib.mkIf cfg.enable { + programs.foot = { + enable = true; + server.enable = true; + settings = { + main.pad = "0x4"; + }; + }; + }; +} diff --git a/features/user/gui/apps/librewolf.nix b/features/user/gui/apps/librewolf.nix new file mode 100644 index 0000000..fc6c2c4 --- /dev/null +++ b/features/user/gui/apps/librewolf.nix @@ -0,0 +1,19 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.features.gui.apps.librewolf; +in { + options.features.gui.apps.librewolf.enable = lib.mkEnableOption "librewolf"; + config = lib.mkIf cfg.enable { + # programs.librewolf = { + # enable = true; + # settings = { + # "browser.tabs.inTitlebar" = 0; + # }; + # }; + home.packages = [ pkgs.librewolf-bin ]; + }; +} diff --git a/features/user/gui/apps/mpv.nix b/features/user/gui/apps/mpv.nix new file mode 100644 index 0000000..562d151 --- /dev/null +++ b/features/user/gui/apps/mpv.nix @@ -0,0 +1,28 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.gui.apps.mpv; +in { + options.features.gui.apps.mpv.enable = lib.mkEnableOption "mpv"; + config = lib.mkIf cfg.enable { + programs.mpv = { + enable = true; + config = { + # Change youtube downloader to yt-dlp for faster downloads. + script-opts = "ytdl_hook-ytdl_path=${lib.getExe pkgs.yt-dlp}"; + # Download videos at 720p or lower. + ytdl-format = "bestvideo[height<=720]+bestaudio/best[height<=720]"; + + save-position-on-quit = false; # makes mpv audio only when true? + + osd-bar = false; + }; + bindings = { + "tab" = "script-binding uosc/toggle-ui"; + }; + scripts = with pkgs.mpvScripts; [ + uosc + thumbfast + sponsorblock + ]; + }; + }; +} diff --git a/features/user/gui/apps/obs.nix b/features/user/gui/apps/obs.nix new file mode 100644 index 0000000..916f11e --- /dev/null +++ b/features/user/gui/apps/obs.nix @@ -0,0 +1,10 @@ +{ config, lib, ... }: let + cfg = config.features.gui.apps.obs; +in { + options.features.gui.apps.obs.enable = lib.mkEnableOption "obs"; + config = lib.mkIf cfg.enable { + programs.obs-studio = { + enable = true; + }; + }; +} diff --git a/features/user/gui/apps/qutebrowser/default.nix b/features/user/gui/apps/qutebrowser/default.nix new file mode 100644 index 0000000..e12c9f3 --- /dev/null +++ b/features/user/gui/apps/qutebrowser/default.nix @@ -0,0 +1,81 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.gui.apps.qutebrowser; +in { + options.features.gui.apps.qutebrowser.enable = lib.mkEnableOption "qutebrowser"; + config = lib.mkIf cfg.enable { + programs.qutebrowser = { + enable = true; + settings = { + content = { + autoplay = false; + tls.certificate_errors = "ask-block-thirdparty"; + }; + scrolling.bar = "never"; + window.transparent = true; + keyhint.delay = 0; + tabs = { + position = "left"; + width = "10%"; + }; + url = { + default_page = "https://web.tabliss.io"; + start_pages = "https://web.tabliss.io"; + }; + input.insert_mode.auto_load = true; + }; + keyBindings = { + normal = { + # Tab Movement Keys + "" = "tab-move +"; + "" = "tab-move -"; + + # Universal Scrolling Keys + "" = "scroll-px 0 50"; + "" = "scroll-px 0 -50"; + + # Open Tab Relatively + "" = "cmd-set-text -s :open -tr"; + + # Move Tab to Another Window + "gc" = "cmd-set-text -s :tab-give"; + + # Hide UI + "z" = lib.mkMerge [ + "config-cycle tabs.show never always" + "config-cycle statusbar.show in-mode always" + "config-cycle scrolling.bar never always" + ]; + }; + }; + searchEngines = { + # Default Search Engine + DEFAULT = "https://search.brave.com/search?q={}"; + + # General Search Engines + g = "https://www.google.com/search?q={}"; + b = "https://www.bing.com/search?q={}"; + + # Other Search Engines + w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1"; + y = "https://youtube.com/results?search_query={}"; + t = "https://www.wordreference.com/es/translation.asp?tranword={}"; + p = "https://thangs.com/search/{}?scope=all"; + + # Nix Search Engines + n = "https://mynixos.com/search?q={}"; + nw = "https://wiki.nixos.org/index.php?search={}"; + np = "https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query={}"; + no = "https://search.nixos.org/options?channel=unstable&size=50&sort=relevance&type=packages&query={}"; + nh = "https://home-manager-options.extranix.com/?query={}&release=master"; + }; + greasemonkey = let + mkGmScript = name: ( pkgs.writeText "${name}.js" (builtins.readFile ./scripts/${name}.js) ); + in [ + (mkGmScript "yt-ad-skip") + (mkGmScript "yt-sponsor-skip") + (mkGmScript "yt-shorts-blocker") + (mkGmScript "yt-dislike-viewer") + ]; + }; + }; +} diff --git a/features/user/gui/apps/qutebrowser/scripts/yt-ad-skip.js b/features/user/gui/apps/qutebrowser/scripts/yt-ad-skip.js new file mode 100644 index 0000000..56336df --- /dev/null +++ b/features/user/gui/apps/qutebrowser/scripts/yt-ad-skip.js @@ -0,0 +1,29 @@ +// ==UserScript== +// @name Youtube Ad Skip +// @version 0.0.7 +// @description Make Youtube more tolerable by automatically skipping ads +// @author Adcott +// @match *://*.youtube.com/* +// ==/UserScript== + +GM_addStyle(` +#player-ads, +.adDisplay, +.ad-container, +.ytd-display-ad-renderer, +.video-ads, +ytd-rich-item-renderer:has(ytd-ad-slot-renderer), +ytd-ad-slot-renderer, +#masthead-ad, +*[class^="ytd-ad-"], +#panels.ytd-watch-flexy { + display: none !important; +}`); + +document.addEventListener('load', () => { + let ad = document.querySelector('.ad-showing:has(.ytp-ad-persistent-progress-bar-container) video'); + let skipButton = document.querySelector('.ytp-ad-skip-button'); + + if (ad) ad.currentTime = 99999; + if (skipButton) skipButton.click(); +}, true); diff --git a/features/user/gui/apps/qutebrowser/scripts/yt-dislike-viewer.js b/features/user/gui/apps/qutebrowser/scripts/yt-dislike-viewer.js new file mode 100644 index 0000000..50f3eff --- /dev/null +++ b/features/user/gui/apps/qutebrowser/scripts/yt-dislike-viewer.js @@ -0,0 +1,704 @@ +// ==UserScript== +// @name Return YouTube Dislike +// @namespace https://www.returnyoutubedislike.com/ +// @homepage https://www.returnyoutubedislike.com/ +// @version 3.1.5 +// @encoding utf-8 +// @description Return of the YouTube Dislike, Based off https://www.returnyoutubedislike.com/ +// @icon https://github.com/Anarios/return-youtube-dislike/raw/main/Icons/Return%20Youtube%20Dislike%20-%20Transparent.png +// @author Anarios & JRWR +// @match *://*.youtube.com/* +// @exclude *://music.youtube.com/* +// @exclude *://*.music.youtube.com/* +// @compatible chrome +// @compatible firefox +// @compatible opera +// @compatible safari +// @compatible edge +// @grant GM.xmlHttpRequest +// @connect youtube.com +// @grant GM_addStyle +// @run-at document-end +// @downloadURL https://update.greasyfork.org/scripts/436115/Return%20YouTube%20Dislike.user.js +// @updateURL https://update.greasyfork.org/scripts/436115/Return%20YouTube%20Dislike.meta.js +// ==/UserScript== + +const extConfig = { + // BEGIN USER OPTIONS + // You may change the following variables to allowed values listed in the corresponding brackets (* means default). Keep the style and keywords intact. + showUpdatePopup: false, // [true, false*] Show a popup tab after extension update (See what's new) + disableVoteSubmission: false, // [true, false*] Disable like/dislike submission (Stops counting your likes and dislikes) + disableLogging: true, // [true*, false] Disable Logging API Response in JavaScript Console. + coloredThumbs: false, // [true, false*] Colorize thumbs (Use custom colors for thumb icons) + coloredBar: false, // [true, false*] Colorize ratio bar (Use custom colors for ratio bar) + colorTheme: "classic", // [classic*, accessible, neon] Color theme (red/green, blue/yellow, pink/cyan) + numberDisplayFormat: "compactShort", // [compactShort*, compactLong, standard] Number format (For non-English locale users, you may be able to improve appearance with a different option. Please file a feature request if your locale is not covered) + numberDisplayRoundDown: true, // [true*, false] Round down numbers (Show rounded down numbers) + tooltipPercentageMode: "none", // [none*, dash_like, dash_dislike, both, only_like, only_dislike] Mode of showing percentage in like/dislike bar tooltip. + numberDisplayReformatLikes: false, // [true, false*] Re-format like numbers (Make likes and dislikes format consistent) + rateBarEnabled: false, // [true, false*] Enables ratio bar under like/dislike buttons + // END USER OPTIONS +}; + +const LIKED_STATE = "LIKED_STATE"; +const DISLIKED_STATE = "DISLIKED_STATE"; +const NEUTRAL_STATE = "NEUTRAL_STATE"; +let previousState = 3; //1=LIKED, 2=DISLIKED, 3=NEUTRAL +let likesvalue = 0; +let dislikesvalue = 0; +let preNavigateLikeButton = null; + +let isMobile = location.hostname == "m.youtube.com"; +let isShorts = () => location.pathname.startsWith("/shorts"); +let mobileDislikes = 0; +function cLog(text, subtext = "") { + if (!extConfig.disableLogging) { + subtext = subtext.trim() === "" ? "" : `(${subtext})`; + console.log(`[Return YouTube Dislikes] ${text} ${subtext}`); + } +} + +function isInViewport(element) { + const rect = element.getBoundingClientRect(); + const height = innerHeight || document.documentElement.clientHeight; + const width = innerWidth || document.documentElement.clientWidth; + return ( + // When short (channel) is ignored, the element (like/dislike AND short itself) is + // hidden with a 0 DOMRect. In this case, consider it outside of Viewport + !(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) && + rect.top >= 0 && + rect.left >= 0 && + rect.bottom <= height && + rect.right <= width + ); +} + +function getButtons() { + if (isShorts()) { + let elements = document.querySelectorAll( + isMobile ? "ytm-like-button-renderer" : "#like-button > ytd-like-button-renderer", + ); + for (let element of elements) { + if (isInViewport(element)) { + return element; + } + } + } + if (isMobile) { + return ( + document.querySelector(".slim-video-action-bar-actions .segmented-buttons") ?? + document.querySelector(".slim-video-action-bar-actions") + ); + } + if (document.getElementById("menu-container")?.offsetParent === null) { + return ( + document.querySelector("ytd-menu-renderer.ytd-watch-metadata > div") ?? + document.querySelector("ytd-menu-renderer.ytd-video-primary-info-renderer > div") + ); + } else { + return document.getElementById("menu-container")?.querySelector("#top-level-buttons-computed"); + } +} + +function getDislikeButton() { + if (getButtons().children[0].tagName === "YTD-SEGMENTED-LIKE-DISLIKE-BUTTON-RENDERER") { + if (getButtons().children[0].children[1] === undefined) { + return document.querySelector("#segmented-dislike-button"); + } else { + return getButtons().children[0].children[1]; + } + } else { + if (getButtons().querySelector("segmented-like-dislike-button-view-model")) { + const dislikeViewModel = getButtons().querySelector("dislike-button-view-model"); + if (!dislikeViewModel) cLog("Dislike button wasn't added to DOM yet..."); + return dislikeViewModel; + } else { + return getButtons().children[1]; + } + } +} + +function getLikeButton() { + return getButtons().children[0].tagName === "YTD-SEGMENTED-LIKE-DISLIKE-BUTTON-RENDERER" + ? document.querySelector("#segmented-like-button") !== null + ? document.querySelector("#segmented-like-button") + : getButtons().children[0].children[0] + : getButtons().querySelector("like-button-view-model") ?? getButtons().children[0]; +} + +function getLikeTextContainer() { + return ( + getLikeButton().querySelector("#text") ?? + getLikeButton().getElementsByTagName("yt-formatted-string")[0] ?? + getLikeButton().querySelector("span[role='text']") + ); +} + +function getDislikeTextContainer() { + const dislikeButton = getDislikeButton(); + let result = + dislikeButton?.querySelector("#text") ?? + dislikeButton?.getElementsByTagName("yt-formatted-string")[0] ?? + dislikeButton?.querySelector("span[role='text']"); + if (result === null) { + let textSpan = document.createElement("span"); + textSpan.id = "text"; + textSpan.style.marginLeft = "6px"; + dislikeButton?.querySelector("button").appendChild(textSpan); + if (dislikeButton) dislikeButton.querySelector("button").style.width = "auto"; + result = textSpan; + } + return result; +} + +function createObserver(options, callback) { + const observerWrapper = new Object(); + observerWrapper.options = options; + observerWrapper.observer = new MutationObserver(callback); + observerWrapper.observe = function (element) { + this.observer.observe(element, this.options); + }; + observerWrapper.disconnect = function () { + this.observer.disconnect(); + }; + return observerWrapper; +} + +let shortsObserver = null; + +if (isShorts() && !shortsObserver) { + cLog("Initializing shorts mutation observer"); + shortsObserver = createObserver( + { + attributes: true, + }, + (mutationList) => { + mutationList.forEach((mutation) => { + if ( + mutation.type === "attributes" && + mutation.target.nodeName === "TP-YT-PAPER-BUTTON" && + mutation.target.id === "button" + ) { + cLog("Short thumb button status changed"); + if (mutation.target.getAttribute("aria-pressed") === "true") { + mutation.target.style.color = + mutation.target.parentElement.parentElement.id === "like-button" + ? getColorFromTheme(true) + : getColorFromTheme(false); + } else { + mutation.target.style.color = "unset"; + } + return; + } + cLog("Unexpected mutation observer event: " + mutation.target + mutation.type); + }); + }, + ); +} + +function isVideoLiked() { + if (isMobile) { + return getLikeButton().querySelector("button").getAttribute("aria-label") == "true"; + } + return getLikeButton().classList.contains("style-default-active"); +} + +function isVideoDisliked() { + if (isMobile) { + return getDislikeButton()?.querySelector("button").getAttribute("aria-label") == "true"; + } + return getDislikeButton()?.classList.contains("style-default-active"); +} + +function isVideoNotLiked() { + if (isMobile) { + return !isVideoLiked(); + } + return getLikeButton().classList.contains("style-text"); +} + +function isVideoNotDisliked() { + if (isMobile) { + return !isVideoDisliked(); + } + return getDislikeButton()?.classList.contains("style-text"); +} + +function checkForUserAvatarButton() { + if (isMobile) { + return; + } + if (document.querySelector("#avatar-btn")) { + return true; + } else { + return false; + } +} + +function getState() { + if (isVideoLiked()) { + return LIKED_STATE; + } + if (isVideoDisliked()) { + return DISLIKED_STATE; + } + return NEUTRAL_STATE; +} + +function setLikes(likesCount) { + if (isMobile) { + getButtons().children[0].querySelector(".button-renderer-text").innerText = likesCount; + return; + } + getLikeTextContainer().innerText = likesCount; +} + +function setDislikes(dislikesCount) { + if (isMobile) { + mobileDislikes = dislikesCount; + return; + } + + const _container = getDislikeTextContainer(); + _container?.removeAttribute("is-empty"); + if (_container?.innerText !== dislikesCount) { + _container.innerText = dislikesCount; + } +} + +function getLikeCountFromButton() { + try { + if (isShorts()) { + //Youtube Shorts don't work with this query. It's not necessary; we can skip it and still see the results. + //It should be possible to fix this function, but it's not critical to showing the dislike count. + return false; + } + let likeButton = + getLikeButton().querySelector("yt-formatted-string#text") ?? getLikeButton().querySelector("button"); + + let likesStr = likeButton.getAttribute("aria-label").replace(/\D/g, ""); + return likesStr.length > 0 ? parseInt(likesStr) : false; + } catch { + return false; + } +} + +(typeof GM_addStyle != "undefined" + ? GM_addStyle + : (styles) => { + let styleNode = document.createElement("style"); + styleNode.type = "text/css"; + styleNode.innerText = styles; + document.head.appendChild(styleNode); + })(` + #return-youtube-dislike-bar-container { + background: var(--yt-spec-icon-disabled); + border-radius: 2px; + } + + #return-youtube-dislike-bar { + background: var(--yt-spec-text-primary); + border-radius: 2px; + transition: all 0.15s ease-in-out; + } + + .ryd-tooltip { + position: absolute; + display: block; + height: 2px; + bottom: -10px; + } + + .ryd-tooltip-bar-container { + width: 100%; + height: 2px; + position: absolute; + padding-top: 6px; + padding-bottom: 12px; + top: -6px; + } + + ytd-menu-renderer.ytd-watch-metadata { + overflow-y: visible !important; + } + + #top-level-buttons-computed { + position: relative !important; + } + `); + +function createRateBar(likes, dislikes) { + if (isMobile || !extConfig.rateBarEnabled) { + return; + } + let rateBar = document.getElementById("return-youtube-dislike-bar-container"); + + const widthPx = getLikeButton().clientWidth + (getDislikeButton()?.clientWidth ?? 52); + + const widthPercent = likes + dislikes > 0 ? (likes / (likes + dislikes)) * 100 : 50; + + var likePercentage = parseFloat(widthPercent.toFixed(1)); + const dislikePercentage = (100 - likePercentage).toLocaleString(); + likePercentage = likePercentage.toLocaleString(); + + var tooltipInnerHTML; + switch (extConfig.tooltipPercentageMode) { + case "dash_like": + tooltipInnerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}  -  ${likePercentage}%`; + break; + case "dash_dislike": + tooltipInnerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}  -  ${dislikePercentage}%`; + break; + case "both": + tooltipInnerHTML = `${likePercentage}% / ${dislikePercentage}%`; + break; + case "only_like": + tooltipInnerHTML = `${likePercentage}%`; + break; + case "only_dislike": + tooltipInnerHTML = `${dislikePercentage}%`; + break; + default: + tooltipInnerHTML = `${likes.toLocaleString()} / ${dislikes.toLocaleString()}`; + } + + if (!rateBar && !isMobile) { + let colorLikeStyle = ""; + let colorDislikeStyle = ""; + if (extConfig.coloredBar) { + colorLikeStyle = "; background-color: " + getColorFromTheme(true); + colorDislikeStyle = "; background-color: " + getColorFromTheme(false); + } + + getButtons().insertAdjacentHTML( + "beforeend", + ` +
+
+
+
+
+
+ + ${tooltipInnerHTML} + +
+`, + ); + let descriptionAndActionsElement = document.getElementById("top-row"); + descriptionAndActionsElement.style.borderBottom = "1px solid var(--yt-spec-10-percent-layer)"; + descriptionAndActionsElement.style.paddingBottom = "10px"; + } else { + document.querySelector(".ryd-tooltip").style.width = widthPx + "px"; + document.getElementById("return-youtube-dislike-bar").style.width = widthPercent + "%"; + + if (extConfig.coloredBar) { + document.getElementById("return-youtube-dislike-bar-container").style.backgroundColor = getColorFromTheme(false); + document.getElementById("return-youtube-dislike-bar").style.backgroundColor = getColorFromTheme(true); + } + } +} + +function setState() { + cLog("Fetching votes..."); + let statsSet = false; + + fetch(`https://returnyoutubedislikeapi.com/votes?videoId=${getVideoId()}`).then((response) => { + response.json().then((json) => { + if (json && !("traceId" in response) && !statsSet) { + const { dislikes, likes } = json; + cLog(`Received count: ${dislikes}`); + likesvalue = likes; + dislikesvalue = dislikes; + setDislikes(numberFormat(dislikes)); + if (extConfig.numberDisplayReformatLikes === true) { + const nativeLikes = getLikeCountFromButton(); + if (nativeLikes !== false) { + setLikes(numberFormat(nativeLikes)); + } + } + createRateBar(likes, dislikes); + if (extConfig.coloredThumbs === true) { + const dislikeButton = getDislikeButton(); + if (isShorts()) { + // for shorts, leave deactived buttons in default color + const shortLikeButton = getLikeButton().querySelector("tp-yt-paper-button#button"); + const shortDislikeButton = dislikeButton?.querySelector("tp-yt-paper-button#button"); + if (shortLikeButton.getAttribute("aria-pressed") === "true") { + shortLikeButton.style.color = getColorFromTheme(true); + } + if (shortDislikeButton && shortDislikeButton.getAttribute("aria-pressed") === "true") { + shortDislikeButton.style.color = getColorFromTheme(false); + } + shortsObserver.observe(shortLikeButton); + shortsObserver.observe(shortDislikeButton); + } else { + getLikeButton().style.color = getColorFromTheme(true); + if (dislikeButton) dislikeButton.style.color = getColorFromTheme(false); + } + } + } + }); + }); +} + +function updateDOMDislikes() { + setDislikes(numberFormat(dislikesvalue)); + createRateBar(likesvalue, dislikesvalue); +} + +function likeClicked() { + if (checkForUserAvatarButton() == true) { + if (previousState == 1) { + likesvalue--; + updateDOMDislikes(); + previousState = 3; + } else if (previousState == 2) { + likesvalue++; + dislikesvalue--; + updateDOMDislikes(); + previousState = 1; + } else if (previousState == 3) { + likesvalue++; + updateDOMDislikes(); + previousState = 1; + } + if (extConfig.numberDisplayReformatLikes === true) { + const nativeLikes = getLikeCountFromButton(); + if (nativeLikes !== false) { + setLikes(numberFormat(nativeLikes)); + } + } + } +} + +function dislikeClicked() { + if (checkForUserAvatarButton() == true) { + if (previousState == 3) { + dislikesvalue++; + updateDOMDislikes(); + previousState = 2; + } else if (previousState == 2) { + dislikesvalue--; + updateDOMDislikes(); + previousState = 3; + } else if (previousState == 1) { + likesvalue--; + dislikesvalue++; + updateDOMDislikes(); + previousState = 2; + if (extConfig.numberDisplayReformatLikes === true) { + const nativeLikes = getLikeCountFromButton(); + if (nativeLikes !== false) { + setLikes(numberFormat(nativeLikes)); + } + } + } + } +} + +function setInitialState() { + setState(); +} + +function getVideoId() { + const urlObject = new URL(window.location.href); + const pathname = urlObject.pathname; + if (pathname.startsWith("/clip")) { + return (document.querySelector("meta[itemprop='videoId']") || document.querySelector("meta[itemprop='identifier']")).content; + } else { + if (pathname.startsWith("/shorts")) { + return pathname.slice(8); + } + return urlObject.searchParams.get("v"); + } +} + +function isVideoLoaded() { + if (isMobile) { + return document.getElementById("player").getAttribute("loading") == "false"; + } + const videoId = getVideoId(); + + return ( + // desktop: spring 2024 UI + document.querySelector(`ytd-watch-grid[video-id='${videoId}']`) !== null || + // desktop: older UI + document.querySelector(`ytd-watch-flexy[video-id='${videoId}']`) !== null || + // mobile: no video-id attribute + document.querySelector('#player[loading="false"]:not([hidden])') !== null + ); +} + +function roundDown(num) { + if (num < 1000) return num; + const int = Math.floor(Math.log10(num) - 2); + const decimal = int + (int % 3 ? 1 : 0); + const value = Math.floor(num / 10 ** decimal); + return value * 10 ** decimal; +} + +function numberFormat(numberState) { + let numberDisplay; + if (extConfig.numberDisplayRoundDown === false) { + numberDisplay = numberState; + } else { + numberDisplay = roundDown(numberState); + } + return getNumberFormatter(extConfig.numberDisplayFormat).format(numberDisplay); +} + +function getNumberFormatter(optionSelect) { + let userLocales; + if (document.documentElement.lang) { + userLocales = document.documentElement.lang; + } else if (navigator.language) { + userLocales = navigator.language; + } else { + try { + userLocales = new URL( + Array.from(document.querySelectorAll("head > link[rel='search']")) + ?.find((n) => n?.getAttribute("href")?.includes("?locale=")) + ?.getAttribute("href"), + )?.searchParams?.get("locale"); + } catch { + cLog("Cannot find browser locale. Use en as default for number formatting."); + userLocales = "en"; + } + } + + let formatterNotation; + let formatterCompactDisplay; + switch (optionSelect) { + case "compactLong": + formatterNotation = "compact"; + formatterCompactDisplay = "long"; + break; + case "standard": + formatterNotation = "standard"; + formatterCompactDisplay = "short"; + break; + case "compactShort": + default: + formatterNotation = "compact"; + formatterCompactDisplay = "short"; + } + + const formatter = Intl.NumberFormat(userLocales, { + notation: formatterNotation, + compactDisplay: formatterCompactDisplay, + }); + return formatter; +} + +function getColorFromTheme(voteIsLike) { + let colorString; + switch (extConfig.colorTheme) { + case "accessible": + if (voteIsLike === true) { + colorString = "dodgerblue"; + } else { + colorString = "gold"; + } + break; + case "neon": + if (voteIsLike === true) { + colorString = "aqua"; + } else { + colorString = "magenta"; + } + break; + case "classic": + default: + if (voteIsLike === true) { + colorString = "lime"; + } else { + colorString = "red"; + } + } + return colorString; +} + +let smartimationObserver = null; + +function setEventListeners(evt) { + let jsInitChecktimer; + + function checkForJS_Finish() { + //console.log(); + if (isShorts() || (getButtons()?.offsetParent && isVideoLoaded())) { + const buttons = getButtons(); + const dislikeButton = getDislikeButton(); + + if (preNavigateLikeButton !== getLikeButton() && dislikeButton) { + cLog("Registering button listeners..."); + try { + getLikeButton().addEventListener("click", likeClicked); + dislikeButton?.addEventListener("click", dislikeClicked); + getLikeButton().addEventListener("touchstart", likeClicked); + dislikeButton?.addEventListener("touchstart", dislikeClicked); + dislikeButton?.addEventListener("focusin", updateDOMDislikes); + dislikeButton?.addEventListener("focusout", updateDOMDislikes); + preNavigateLikeButton = getLikeButton(); + + if (!smartimationObserver) { + smartimationObserver = createObserver( + { + attributes: true, + subtree: true, + childList: true, + }, + updateDOMDislikes, + ); + smartimationObserver.container = null; + } + + const smartimationContainer = buttons.querySelector("yt-smartimation"); + if (smartimationContainer && smartimationObserver.container != smartimationContainer) { + cLog("Initializing smartimation mutation observer"); + smartimationObserver.disconnect(); + smartimationObserver.observe(smartimationContainer); + smartimationObserver.container = smartimationContainer; + } + } catch { + return; + } //Don't spam errors into the console + } + if (dislikeButton) { + setInitialState(); + clearInterval(jsInitChecktimer); + } + } + } + + cLog("Setting up..."); + jsInitChecktimer = setInterval(checkForJS_Finish, 111); +} + +(function () { + "use strict"; + window.addEventListener("yt-navigate-finish", setEventListeners, true); + setEventListeners(); +})(); +if (isMobile) { + let originalPush = history.pushState; + history.pushState = function (...args) { + window.returnDislikeButtonlistenersSet = false; + setEventListeners(args[2]); + return originalPush.apply(history, args); + }; + setInterval(() => { + const dislikeButton = getDislikeButton(); + if (dislikeButton?.querySelector(".button-renderer-text") === null) { + getDislikeTextContainer().innerText = mobileDislikes; + } else { + if (dislikeButton) dislikeButton.querySelector(".button-renderer-text").innerText = mobileDislikes; + } + }, 1000); +} diff --git a/features/user/gui/apps/qutebrowser/scripts/yt-shorts-blocker.js b/features/user/gui/apps/qutebrowser/scripts/yt-shorts-blocker.js new file mode 100644 index 0000000..383fec3 --- /dev/null +++ b/features/user/gui/apps/qutebrowser/scripts/yt-shorts-blocker.js @@ -0,0 +1,23 @@ +// ==UserScript== +// @name YouTube Shorts Blocker +// @namespace http://tampermonkey.net/ +// @version 0.1.2 +// @description Blocks the YouTube shorts from appearing. +// @author Aiden Charles +// @license MIT +// @match https://www.youtube.com/* +// @require https://code.jquery.com/jquery-3.4.1.slim.min.js +// @grant none +// ==/UserScript== + +(function() { + console.log("YouTube Shorts blocker script is running!"); + + setInterval(function() { + $("ytd-reel-shelf-renderer").hide(); + $("a[title='Shorts']").hide(); + $('a[href^="/shorts/"]').closest('ytd-video-renderer').hide(); + $('span:contains("Shorts")').closest('#content.ytd-rich-section-renderer').hide(); + }, 1000); +})(); + diff --git a/features/user/gui/apps/qutebrowser/scripts/yt-sponsor-skip.js b/features/user/gui/apps/qutebrowser/scripts/yt-sponsor-skip.js new file mode 100644 index 0000000..3779cbf --- /dev/null +++ b/features/user/gui/apps/qutebrowser/scripts/yt-sponsor-skip.js @@ -0,0 +1,51 @@ +// ==UserScript== +// @name Sponsorblock +// @version 1.1.0 +// @description Skip sponsor segments automatically +// @author afreakk +// @author vongaisberg +// @match *://*.youtube.com/* +// @exclude *://*.youtube.com/subscribe_embed?* +// ==/UserScript== +const delay = 1000; + +const tryFetchSkipSegments = (videoID) => + + fetch(`https://sponsor.ajay.app/api/skipSegments?videoID=${videoID}`) + .then((r) => r.json()) + .then((rJson) => + rJson.filter((a) => a.actionType === 'skip').map((a) => a.segment) + ) + .catch( + (e) => + console.log( + `Sponsorblock: failed fetching skipSegments for ${videoID}, reason: ${e}` + ) || [] + ); + +const skipSegments = async () => { + const videoID = new URL(document.location).searchParams.get('v'); + if (!videoID) { + return; + } + const key = `segmentsToSkip-${videoID}`; + window[key] = window[key] || (await tryFetchSkipSegments(videoID)); + for (const v of document.querySelectorAll('video')) { + if (Number.isNaN(v.duration)) continue; + for (const [start, end] of window[key]) { + if (v.currentTime < end && v.currentTime >= start) { + console.log(`Sponsorblock: skipped video @${v.currentTime} from ${start} to ${end}`); + v.currentTime = end; + return + } + const timeToSponsor = (start - v.currentTime) / v.playbackRate; + if (v.currentTime < start && timeToSponsor < (delay / 1000)) { + console.log(`Sponsorblock: Almost at sponsor segment, sleep for ${timeToSponsor * 1000}ms`); + setTimeout(skipSegments, timeToSponsor * 1000); + } + } + } +}; +if (!window.skipSegmentsIntervalID) { + window.skipSegmentsIntervalID = setInterval(skipSegments, delay); +} diff --git a/features/user/gui/apps/vesktop.nix b/features/user/gui/apps/vesktop.nix new file mode 100644 index 0000000..f28d719 --- /dev/null +++ b/features/user/gui/apps/vesktop.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.gui.apps.vesktop; +in { + options.features.gui.apps.vesktop.enable = lib.mkEnableOption "vesktop"; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [(vesktop.override { withSystemVencord = false; })]; + }; +} diff --git a/features/user/gui/bundles/video.nix b/features/user/gui/bundles/video.nix new file mode 100644 index 0000000..491bf21 --- /dev/null +++ b/features/user/gui/bundles/video.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.gui.bundles.video; +in { + options.features.gui.bundles.video.enable = lib.mkEnableOption "video"; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + kdePackages.kdenlive + ]; + features.gui.apps.obs.enable = true; + }; +} diff --git a/features/user/gui/desktops/niri/default.nix b/features/user/gui/desktops/niri/default.nix new file mode 100755 index 0000000..cd904de --- /dev/null +++ b/features/user/gui/desktops/niri/default.nix @@ -0,0 +1,126 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: let + cfg = config.features.gui.desktops.niri; + aes = config.aesthetics; +in { + imports = [ + inputs.niri.homeModules.niri + ./keybinds.nix + ]; + options.features.gui.desktops.niri.enable = lib.mkEnableOption "niri"; + config = lib.mkIf cfg.enable { + features.gui.desktops.niri.parts = { + waybar.enable = true; + fuzzel.enable = true; + selectors.enable = true; + swww.enable = true; + mako.enable = true; + ignis.enable = true; + hyprlock.enable = true; + }; + programs.niri = { + enable = true; + package = inputs.niri.packages.${pkgs.system}.niri-unstable; + settings = { + outputs = { + "Samsung Electric Company SAMSUNG 0x00000001" = { + enable = true; + scale = 1.5; + }; + }; + spawn-at-startup = [ + # Status Bar + {command = ["waybar"];} + + # Wallpaper Daemon + {command = ["swww-daemon"];} + + # Allows x apps to be used in wayland. + {command = ["${lib.getExe pkgs.xwayland-satellite}"];} + + # Logs the clipboard for use in utilities. + {command = ["${pkgs.wl-clipboard}/bin/wl-paste" "--watch" "${pkgs.cliphist}/bin/cliphist" "store"];} + ]; + environment = { + DISPLAY = ":0"; # Important for Xwayland. + }; + window-rules = [ + { + geometry-corner-radius = let + radius = 4.0; + in { + top-left = radius; + top-right = radius; + bottom-left = radius; + bottom-right = radius; + }; + clip-to-geometry = true; + default-column-width.proportion = 1. / 3.; + } + { + # Prevent Tor from being screen captured. + matches = [{app-id = "Tor Browser";}]; + block-out-from = "screen-capture"; + } + ]; + switch-events = { + lid-close.action.spawn = ["hyprlock"]; + }; + prefer-no-csd = true; + overview = { + backdrop-color = "#${aes.scheme.base01}"; + }; + layout = { + gaps = 14; + insert-hint.enable = false; + shadow = { + enable = true; + softness = 10; + spread = 5; + offset = { + x = 0; + y = 0; + }; + }; + focus-ring = { + enable = true; + width = 3; + active.color = "#${aes.scheme.base09}"; + }; + border = { + enable = false; + width = 3; + inactive.color = "#${aes.scheme.base03}"; + active.color = "#${aes.scheme.base08}"; + }; + struts = { + # left = -1; + # right = -1; + + left = 20; + right = 20; + top = 20; + bottom = 20; + }; + always-center-single-column = false; + empty-workspace-above-first = true; + }; + input.keyboard.xkb.options = '' + caps:escape, + compose:ins + ''; + hotkey-overlay.skip-at-startup = true; + input = { + touchpad = { + click-method = "clickfinger"; + }; + }; + }; + }; + }; +} diff --git a/features/user/gui/desktops/niri/keybinds.nix b/features/user/gui/desktops/niri/keybinds.nix new file mode 100644 index 0000000..5426ee6 --- /dev/null +++ b/features/user/gui/desktops/niri/keybinds.nix @@ -0,0 +1,165 @@ +{ + config, + pkgs, + lib, + ... +}: { + config = lib.mkIf config.features.gui.desktops.niri.enable { + programs.niri.settings.binds = let + left = "h"; + down = "j"; + up = "k"; + right = "l"; + in { + # App Launching Keys + "Mod+Q".action.spawn = ["footclient"]; + "Mod+W".action.spawn = ["qutebrowser"]; + "Mod+Shift+W".action.spawn = ["librewolf"]; + "Mod+E".action.spawn = ["neovide"]; + + # Clear Notifications + "Mod+B".action.spawn = ["makoctl" "dismiss" "-a"]; + + # Selectors + "Mod+R".action.spawn = ["fuzzel"]; + "Mod+T".action.spawn = ["tool-selector"]; + "Mod+Y".action.spawn = ["clipboard-selector"]; + "Mod+U".action.spawn = ["wallpaper-selector" "--all-outputs"]; + "Mod+Shift+U".action.spawn = ["wallpaper-selector"]; + "Mod+Control+U".action.spawn = ["wallpaper-selector" "--randomize" "--all-outputs"]; + "Mod+Control+Shift+U".action.spawn = ["wallpaper-selector" "--randomize"]; + + # Screenshot Keys + "Mod+P".action.screenshot = []; + "Shift+Mod+P".action.screenshot-screen = []; + "Control+Mod+P".action.screenshot-window = []; + + # Power Keys + "Mod+comma".action.spawn = ["${lib.getExe (pkgs.writers.writeNuBin "nirilock" "systemctl suspend ; hyprlock")}"]; + + # Horizontal Tiling Keys + "Mod+A".action.maximize-column = []; + "Mod+S".action.switch-preset-column-width = []; + + # Vertical Tiling Keys + "Mod+Shift+A".action.reset-window-height = []; + "Mod+Shift+S".action.switch-preset-window-height = []; + "Mod+D".action.consume-or-expel-window-right = []; + + # Floating Window Management Keys + "Mod+Z".action.switch-focus-between-floating-and-tiling = []; + "Mod+X".action.toggle-window-floating = []; + + # Other Window Management Keys + "Mod+C".action.close-window = []; + "Mod+V".action.fullscreen-window = []; + + # Overlay Keys + "Mod+F".action.toggle-overview = []; + + # +---------------------+ + # | Arrow Movement Keys | + # +---------------------+ + + # Window Focus Keys + "Mod+Left".action.focus-column-left = []; + "Mod+Right".action.focus-column-right = []; + "Mod+Up".action.focus-window-up = []; + "Mod+Down".action.focus-window-down = []; + + # Monitor Focus Keys + "Mod+Shift+Left".action.focus-monitor-left = []; + "Mod+Shift+Right".action.focus-monitor-right = []; + + # Workspace Focus Keys + "Mod+Shift+Up".action.focus-workspace-up = []; + "Mod+Shift+Down".action.focus-workspace-down = []; + + # Window Motion Keys + "Mod+Control+Left".action.move-column-left = []; + "Mod+Control+Right".action.move-column-right = []; + "Mod+Control+Up".action.move-window-up = []; + "Mod+Control+Down".action.move-window-down = []; + + # Window - Monitor Motion Keys + "Mod+Control+Shift+Left".action.move-column-to-monitor-left = []; + "Mod+Control+Shift+Right".action.move-column-to-monitor-right = []; + + # Window - Workspace Motion Keys + "Mod+Control+Shift+Up".action.move-window-to-workspace-up = []; + "Mod+Control+Shift+Down".action.move-window-to-workspace-down = []; + + # Workspace Motion Keys + "Mod+Alt+Shift+Up".action.move-workspace-up = []; + "Mod+Alt+Shift+Down".action.move-workspace-down = []; + + # Workspace - Monitor Motion Keys + "Mod+Alt+Shift+Left".action.move-workspace-to-monitor-left = []; + "Mod+Alt+Shift+Right".action.move-workspace-to-monitor-right = []; + + # +-------------------+ + # | Vim Movement Keys | + # +-------------------+ + + # Window Focus Keys + "Mod+${left}".action.focus-column-left = []; + "Mod+${right}".action.focus-column-right = []; + "Mod+${up}".action.focus-window-up = []; + "Mod+${down}".action.focus-window-down = []; + + # Monitor Focus Keys + "Mod+Shift+${left}".action.focus-monitor-left = []; + "Mod+Shift+${right}".action.focus-monitor-right = []; + + # Workspace Focus Keys + "Mod+Shift+${up}".action.focus-workspace-up = []; + "Mod+Shift+${down}".action.focus-workspace-down = []; + + # Monitor Motion Keys + "Mod+Control+Shift+${left}".action.move-column-to-monitor-left = []; + "Mod+Control+Shift+${right}".action.move-column-to-monitor-right = []; + + # Workspace Motion Keys + "Mod+Control+Shift+${up}".action.move-window-to-workspace-up = []; + "Mod+Control+Shift+${down}".action.move-window-to-workspace-down = []; + + # Window Motion Keys + "Mod+Control+${left}".action.move-column-left = []; + "Mod+Control+${right}".action.move-column-right = []; + "Mod+Control+${up}".action.move-window-up = []; + "Mod+Control+${down}".action.move-window-down = []; + + # Workspace Motion Keys + "Mod+Alt+Shift+${up}".action.move-workspace-up = []; + "Mod+Alt+Shift+${down}".action.move-workspace-down = []; + + # Workspace - Monitor Motion Keys + "Mod+Alt+Shift+${left}".action.move-workspace-to-monitor-left = []; + "Mod+Alt+Shift+${right}".action.move-workspace-to-monitor-right = []; + + # +-------------------+ + + # Numbered Workspace Movement Keys + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+0".action.focus-workspace = 0; + + # XF86 Keys + "XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"]; + "XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"]; + "XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"]; + + "XF86MonBrightnessUp".action.spawn = ["${lib.getExe pkgs.brightnessctl}" "s" "+5%"]; + "XF86MonBrightnessDown".action.spawn = ["${lib.getExe pkgs.brightnessctl}" "s" "5%-"]; + + "XF86LaunchB".action.spawn = ["fuzzel"]; + }; + }; +} diff --git a/features/user/gui/desktops/niri/parts/fuzzel.nix b/features/user/gui/desktops/niri/parts/fuzzel.nix new file mode 100755 index 0000000..e939f88 --- /dev/null +++ b/features/user/gui/desktops/niri/parts/fuzzel.nix @@ -0,0 +1,30 @@ +{ config, lib, ... }: let + cfg = config.features.gui.desktops.niri.parts.fuzzel; + aes = config.aesthetics; +in { + options.features.gui.desktops.niri.parts.fuzzel.enable = lib.mkEnableOption "fuzzel"; + config = lib.mkIf cfg.enable { + programs.fuzzel = { + enable = true; + settings = { + main = { + width = 20; + #terminal = config.custom.libraries.default-applications.terminal-emulator.command; + }; + border = { + width = 3; + radius = 4; + }; + colors = with aes.scheme; { + background = "${base00}ff"; + selection = "${base00}ff"; + selection-text = "${base0C}ff"; + selection-match = "${base0E}ff"; + match = "${base0E}ff"; + border = "${base0C}ff"; + text = "${base05}ff"; + }; + }; + }; + }; +} diff --git a/features/user/gui/desktops/niri/parts/hyprlock.nix b/features/user/gui/desktops/niri/parts/hyprlock.nix new file mode 100755 index 0000000..f8a50e3 --- /dev/null +++ b/features/user/gui/desktops/niri/parts/hyprlock.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: let + cfg = config.features.gui.desktops.niri.parts.hyprlock; +in { + options.features.gui.desktops.niri.parts.hyprlock.enable = lib.mkEnableOption "hyprlock"; + config = lib.mkIf cfg.enable { + home.packages = [( + pkgs.writers.writeNuBin "nirilock" /*nu*/ '' + niri msg action do-screen-transition --delay-ms 500 + systemctl suspend + hyprlock + '' + )]; + programs.niri.settings.window-rules = [ + { + matches = [{ title = "hyprlock"; }]; + draw-border-with-background = false; + } + ]; + programs.hyprlock = { + enable = true; + settings = { + background = { + monitor = ""; + path = "${config.aesthetics.wallpaper}"; + blur_passes = 0; + blur_size = 5; + }; + label = { + text = "$TIME"; + font_size = 65; + font_family = "Cantarell Bold"; + + position = "0, 0"; + halign = "center"; + valign = "center"; + }; + input-field = { + size = "250, 50"; + position = "0, -80"; + outline_thickness = 0; + placeholder_text = ""; + }; + }; + }; + }; +} diff --git a/features/user/gui/desktops/niri/parts/ignis/default.nix b/features/user/gui/desktops/niri/parts/ignis/default.nix new file mode 100755 index 0000000..c609ca9 --- /dev/null +++ b/features/user/gui/desktops/niri/parts/ignis/default.nix @@ -0,0 +1,21 @@ +{ config, pkgs, lib, inputs, ... }: let + cfg = config.features.gui.desktops.niri.parts.ignis; +in { + options.features.gui.desktops.niri.parts.ignis.enable = lib.mkEnableOption "ignis"; + config = lib.mkIf cfg.enable { + home.packages = [ + inputs.ignis.packages.${pkgs.system}.ignis + pkgs.python3 + ]; + # home.file."ignis-config" = { + # target = ".config/ignis/config.py"; + # src = ./config.py; + # }; + # home.file."ignis-style" = { + # target = ".config/ignis/style.scss"; + # text = /*scss*/ '' + + # ''; + # }; + }; +} diff --git a/features/user/gui/desktops/niri/parts/mako.nix b/features/user/gui/desktops/niri/parts/mako.nix new file mode 100755 index 0000000..e5bc3b8 --- /dev/null +++ b/features/user/gui/desktops/niri/parts/mako.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + ... +}: let + cfg = config.features.gui.desktops.niri.parts.mako; +in { + options.features.gui.desktops.niri.parts.mako.enable = lib.mkEnableOption "mako"; + config = lib.mkIf cfg.enable { + services.mako = { + enable = true; + settings = { + border-radius = 4; + border-size = 3; + # margin = "11"; + margin = "31"; + padding = "5"; + + anchor = "top-center"; + + ignore-timeout = true; + default-timeout = 10000; + }; + }; + }; +} diff --git a/features/user/gui/desktops/niri/parts/selectors.nix b/features/user/gui/desktops/niri/parts/selectors.nix new file mode 100644 index 0000000..f0f9ce0 --- /dev/null +++ b/features/user/gui/desktops/niri/parts/selectors.nix @@ -0,0 +1,117 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.features.gui.desktops.niri.parts.selectors; + aes = config.aesthetics; +in { + options.features.gui.desktops.niri.parts.selectors.enable = lib.mkEnableOption "selectors"; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + # Tool Selector + ( + pkgs.writers.writeNuBin "tool-selector" + /* + nu + */ + '' + + # Tools + let tools = { + "rebuild nixos": { + footclient -H sudo nixos-rebuild switch --flake ($"~/Sync/setup#(hostname)" | path expand) + } + "rebuild home": { + footclient -H home-manager switch --flake ($"~/Sync/setup#(whoami)@(hostname)" | path expand) + } + "update flake": { + footclient -H nix flake update --flake ($"~/Sync/setup/" | path expand) + } + "manage wifi": { + footclient ${pkgs.impala}/bin/impala + } + "manage bluetooth": { + footclient ${lib.getExe pkgs.bluetui} + } + "create qr-code": { + let temp_file = mktemp + let qr_code_bin = ${lib.getExe pkgs.qrtool} encode (${pkgs.wl-clipboard}/bin/wl-paste) + $qr_code_bin | ${pkgs.wl-clipboard}/bin/wl-copy + $qr_code_bin | save -f $temp_file + ${lib.getExe pkgs.imv} $temp_file + } + } + + # Logic + let user_tool_choice = $tools + | columns + | to text + | fuzzel -d --placeholder "Tools" + if ($user_tool_choice != "") { + do ($tools | get $user_tool_choice) + } + + '' + ) + + # Wallpaper Selector + ( + writers.writeNuBin "wallpaper-selector" + /* + nu + */ + '' + def main [ + --all-outputs # Change wallpaper for all outputs + --randomize + ] { + mut wallpapers = {} + for path in (ls ${aes.wallpapersDir}/**/* | where {|item| $item.type != dir} | get name) { + $wallpapers = $wallpapers | insert ($path | path basename | split row "." | get 0) $path + } + mut prompt = "Wallpaper (current)" + if $all_outputs { + $prompt = "Wallpaper (all)" + } + mut wallpaper_path = "" + if $randomize { + $wallpaper_path = $wallpapers | get ( + $wallpapers + | columns + | shuffle + | get 0 + ) + } else { + $wallpaper_path = $wallpapers | get ( + $wallpapers + | columns + | to text + | ${lib.getExe pkgs.fuzzel} -d --placeholder $prompt + ) + } + if $all_outputs { + ${lib.getExe pkgs.swww} img $wallpaper_path -t wipe --transition-fps 60 --transition-angle 45 + } else { + let focused_display = niri msg -j focused-output + | from json + | get name + ${lib.getExe pkgs.swww} img $wallpaper_path -t wipe --transition-fps 60 --transition-angle 45 --outputs $focused_display + } + } + '' + ) + + # Clipboard Selector + ( + writers.writeNuBin "clipboard-selector" '' + ${lib.getExe pkgs.cliphist} list + | cut -f 2- + | ${lib.getExe pkgs.fuzzel} --dmenu + | ${pkgs.wl-clipboard}/bin/wl-copy + '' + ) + ]; + }; +} diff --git a/features/user/gui/desktops/niri/parts/swww.nix b/features/user/gui/desktops/niri/parts/swww.nix new file mode 100755 index 0000000..dca163b --- /dev/null +++ b/features/user/gui/desktops/niri/parts/swww.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.gui.desktops.niri.parts.swww; +in { + options.features.gui.desktops.niri.parts.swww.enable = lib.mkEnableOption "swww"; + config = lib.mkIf cfg.enable { + home.packages = [pkgs.swww]; + }; +} diff --git a/features/user/gui/desktops/niri/parts/waybar.nix b/features/user/gui/desktops/niri/parts/waybar.nix new file mode 100755 index 0000000..7535b0c --- /dev/null +++ b/features/user/gui/desktops/niri/parts/waybar.nix @@ -0,0 +1,136 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.features.gui.desktops.niri.parts.waybar; + aes = config.aesthetics; +in { + options.features.gui.desktops.niri.parts.waybar.enable = lib.mkEnableOption "waybar"; + config = lib.mkIf cfg.enable { + programs.waybar = { + enable = true; + settings = { + bar = { + layer = "top"; + position = "bottom"; + height = 32; + modules-left = [ "battery" "network" "backlight" "pulseaudio" ]; + modules-center = [ "niri/workspaces" ]; + modules-right = [ "clock#date" "clock#time" ]; + "clock#date" = { + format = "ï‘• {:%A, %B %d}"; + }; + "clock#time" = { + format = " {:%I:%M}"; + }; + pulseaudio = { + format = "ï’… {volume}%"; + format-muted = " {volume}%"; + }; + network = { + format = "{essid}"; + format-wifi = "{icon} {essid}"; + format-ethernet = "󰈀 Ethernet"; + format-disconnected = "ó°¤­ Disconnected"; + format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; + }; + battery = { + format = "{icon} {capacity}%"; + format-charging = "ó°‚„ {capacity}%"; + format-icons = [ "ó°‚Ž" "ó°º" "ó°»" "ó°¼" "ó°½" "ó°¾" "ó°¿" "ó°‚€" "ó°‚" "ó°‚‚" "ó°¹" ]; + }; + backlight = { + format = " {percent}%"; + }; + "niri/workspaces" = { + format = "{icon}"; + format-icons = { + default = ""; + active = ""; + /* + "1" = "1"; + "2" = "2"; + "3" = "3"; + "4" = "4"; + "5" = "5"; + "6" = "6"; + "7" = "7"; + "8" = "8"; + "9" = "9"; + "10" = "10"; + "11" = "11"; + "12" = "12"; + */ + }; + }; + }; + }; + style = let + border-radius = "4"; + padding = "12"; + in /*css*/ '' + @define-color background-color #${aes.scheme.base00}; + @define-color border-color #${aes.scheme.base0C}; + @define-color text-color #${aes.scheme.base05}; + * { + font-family: ${aes.font.name}; + font-weight: 600; + font-size: ${aes.font.size.medium}px; + } + window#waybar { + background-color: transparent; + } + #clock.time, #clock.date, #backlight, #pulseaudio, #battery, #network { + background-color: @background-color; + color: @text-color; + border-radius: ${border-radius}px; + border-width: 0px; + border-color: @border-color; + padding: 0px ${padding}px; + } + #backlight, #pulseaudio, #battery, #network { + margin: 0px 0px ${padding} ${padding}; + } + #workspaces { + background-color: @background-color; + color: @background-color; + border-radius: ${border-radius}px; + border-width: 0px; + border-color: @border-color; + padding: 0px 0px; + margin-bottom: ${padding}px; + } + #workspaces button { + font-weight: bold; + padding: 0px 4px; + margin: 4px 4px; + border-radius: ${border-radius}px; + color: @background-color; + background: @text-color; + opacity: 0.5; + transition: all 0.3s cubic-bezier(.25,.1,.25,1); + } + #workspaces button.active { + font-weight: bold; + padding: 0px 4px; + margin: 4px 4px; + border-radius: ${border-radius}px; + color: @background-color; + background: @text-color; + transition: all 0.3s cubic-bezier(.25,.1,.25,1); + opacity: 1.0; + min-width: 40px; + } + #workspaces button:hover { + font-weight: bold; + border-radius: ${border-radius}px; + color: @background-color; + background: @text-color; + opacity: 0.8; + transition: all 0.3s cubic-bezier(.25,.1,.25,1); + } + #clock.date, #clock.time { + margin: 0px ${padding} ${padding} 0px + } + ''; + }; + }; +} diff --git a/features/user/gui/desktops/niri/parts/wl-kbptr.nix b/features/user/gui/desktops/niri/parts/wl-kbptr.nix new file mode 100644 index 0000000..6f6ed56 --- /dev/null +++ b/features/user/gui/desktops/niri/parts/wl-kbptr.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, inputs, ... }: let + cfg = config.features.gui.desktops.niri.parts.wl-kbptr; +in { + options.features.gui.desktops.niri.parts.wl-kbptr.enable = lib.mkEnableOption "wl-kbptr"; + config = lib.mkIf cfg.enable { + home.packages = [ pkgs.wl-kbptr ]; + home.file."wl-kbptr-config" = { + target = ".config/wl-kbptr/config"; + text = '' + + ''; + }; + }; +} diff --git a/features/user/gui/desktops/niri/parts/wluma.nix b/features/user/gui/desktops/niri/parts/wluma.nix new file mode 100644 index 0000000..21b9edc --- /dev/null +++ b/features/user/gui/desktops/niri/parts/wluma.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: let + cfg = config.features.gui.desktops.niri.parts.wluma; +in { + options.features.gui.desktops.niri.parts.wluma.enable = lib.mkEnableOption "wluma"; + config = lib.mkIf cfg.enable { + services.wluma = { + enable = true; + systemd.enable = true; + }; + }; +} diff --git a/features/user/gui/desktops/niri/readme.md b/features/user/gui/desktops/niri/readme.md new file mode 100644 index 0000000..a70f77d --- /dev/null +++ b/features/user/gui/desktops/niri/readme.md @@ -0,0 +1,9 @@ +# Keybinds Scheme + +OS: The OS + Arrows combination is for moving between windows within a workspace. + +OS + Shift: The OS + Shift + Arrows combination is for moving between workspaces. + +OS + Alt: The OS + Alt + Arrows combination is for moving between monitors. + +The control key can be used with any of these combos to bring the current window along with you. diff --git a/features/user/services/flatpak.nix b/features/user/services/flatpak.nix new file mode 100644 index 0000000..37225aa --- /dev/null +++ b/features/user/services/flatpak.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: let + cfg = config.features.services.flatpak; +in { + imports = [inputs.nix-flatpak.homeManagerModules.nix-flatpak]; + options.features.services.flatpak = { + enable = lib.mkEnableOption "flatpak"; + packages = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = []; + description = "A list of flatpaks to install."; + }; + }; + config = lib.mkIf cfg.enable { + home.packages = [pkgs.flatpak]; + services.flatpak = { + enable = true; + packages = cfg.packages; + overrides.global.Context.sockets = ["wayland" "!x11" "!fallback-x11"]; + }; + }; +} diff --git a/features/user/services/udiskie.nix b/features/user/services/udiskie.nix new file mode 100644 index 0000000..9b79d11 --- /dev/null +++ b/features/user/services/udiskie.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: let + cfg = config.features.services.udiskie; +in { + options.features.services.udiskie.enable = lib.mkEnableOption "udiskie"; + config = lib.mkIf cfg.enable { + services.udiskie = { + enable = true; + automount = true; + }; + systemd.user.targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Requires = [ "graphical-session-pre.target" ]; + }; + }; + }; +} diff --git a/features/user/services/wluma.nix b/features/user/services/wluma.nix new file mode 100644 index 0000000..7c9369e --- /dev/null +++ b/features/user/services/wluma.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.wluma; +in { + options.features.services.wluma.enable = lib.mkEnableOption "wluma"; + config = lib.mkIf cfg.enable { + services.wluma = { + enable = true; + systemd.enable = true; + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..838922f --- /dev/null +++ b/flake.lock @@ -0,0 +1,533 @@ +{ + "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1747575206, + "narHash": "sha256-NwmAFuDUO/PFcgaGGr4j3ozG9Pe5hZ/ogitWhY+D81k=", + "owner": "ryantm", + "repo": "agenix", + "rev": "4835b1dc898959d8547a871ef484930675cb47f1", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "ignis", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gvc": { + "flake": false, + "locked": { + "lastModified": 1735384240, + "narHash": "sha256-ikF9EzFlsRH8i4+SVUHETF4Jk1ob2JX1RLsuMdzrQOQ=", + "owner": "linkfrg", + "repo": "libgnome-volume-control-wheel", + "rev": "2d1cb33dacdae43127bb843a48b159ea7b8925d0", + "type": "github" + }, + "original": { + "owner": "linkfrg", + "repo": "libgnome-volume-control-wheel", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747875884, + "narHash": "sha256-tdVx4kghhdy62LKuTnwE2RytOe8o88tah/yhpyuL0D4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "f9186c64fcc6ee5f0114547acf9e814c806a640b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "ignis": { + "inputs": { + "flake-utils": "flake-utils", + "gvc": "gvc", + "nixpkgs": "nixpkgs_2", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1747852781, + "narHash": "sha256-hHnkGFbn0AokiSzm5iIx9JQT1LUHo1eKSz/ZD/NKMoE=", + "owner": "linkfrg", + "repo": "ignis", + "rev": "8a49ce83889dc9ceeea4a371130a824dd6ec0e3b", + "type": "github" + }, + "original": { + "owner": "linkfrg", + "repo": "ignis", + "type": "github" + } + }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1749153760, + "narHash": "sha256-qjrMYNddCEKQPITJnvkU9MGLElDxVu60cnDhqn+pbOA=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "f029d7a809fb0defb621992bca78ae90ed617a64", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, + "mnw": { + "locked": { + "lastModified": 1747615842, + "narHash": "sha256-pAh9ndf+GdoCfsWaNATFDjgiax9fOYdWzguYV1H/W0E=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "b62120999410eb4a4e27359a3e1c0a22fcc0baff", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1747929338, + "narHash": "sha256-qGMrtBvWWKPElGpQ4ZPZVGN8HLC+laJHkwcsJB7wwGs=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "5b5c0cc698a19c5a10ef1aee487cae238a4aac1e", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1740117926, + "narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "b94a5db8790339cf9134873d8b490be69e02ac71", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.02", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1747926317, + "narHash": "sha256-EBGfaeZ53SNBtsB8dnvBWfjwp+dRDCEkfYyRfwTdbls=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "8347cc20dc87049b398ab655565d468c5c4427a0", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, + "nix-flatpak": { + "locked": { + "lastModified": 1744659587, + "narHash": "sha256-xJnbmRVte13akgn+Prg06IaRHJ5OX3uVltwsCP/mxoc=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "928d868a9141b48f152d3b2b00c433e688d4b106", + "type": "github" + }, + "original": { + "owner": "gmodena", + "repo": "nix-flatpak", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729697500, + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-minecraft": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1747879379, + "narHash": "sha256-P75zsT/obKvvBO1Wmf+KIzt/vIzOpldUdLFCsmfB75Q=", + "owner": "Infinidoge", + "repo": "nix-minecraft", + "rev": "cac1326c98b69b36e5aa3fae21fa4bb0eba23988", + "type": "github" + }, + "original": { + "owner": "Infinidoge", + "repo": "nix-minecraft", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1745391562, + "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1747676747, + "narHash": "sha256-LXkWBVqilgx7Pohwqu/ABxDVw+Cmi5/Mj2S2mpUH0Fw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "72841a4a8761d1aed92ef6169a636872c986c76d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1740695751, + "narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1742889210, + "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "698214a32beb4f4c8e3942372c694f40848b360d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "agenix": "agenix", + "home-manager": "home-manager_2", + "ignis": "ignis", + "jovian": "jovian", + "mnw": "mnw", + "niri": "niri", + "nix-flatpak": "nix-flatpak", + "nix-minecraft": "nix-minecraft", + "nixpkgs": "nixpkgs_6" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1739246919, + "narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.5.1", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1747111562, + "narHash": "sha256-GAqhWoxaBIk0tgoecZPa8gTHDHxNc0JtlwWHZN2iOOo=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "ec9ff64c1e0cbec42710b580b7c0f759b1694e72", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d29e8ef --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "System Flake"; + + outputs = inputs: let + helper = import ./lib/helper.nix {inherit inputs;}; + in { + # NixOS Configurations + nixosConfigurations = { + "nzxt-desktop" = helper.mkSystem "nzxt-desktop" "x86_64-linux"; + "ideapad-laptop" = helper.mkSystem "ideapad-laptop" "x86_64-linux"; + "prodesk-server" = helper.mkSystem "prodesk-server" "x86_64-linux"; + "steam-deck" = helper.mkSystem "steam-deck" "x86_64-linux"; + }; + + # Home Manager Configurations + homeConfigurations = { + "culsans@nzxt-desktop" = helper.mkHome "culsans" "nzxt-desktop" "x86_64-linux"; + "lucas@ideapad-laptop" = helper.mkHome "lucas" "ideapad-laptop" "x86_64-linux"; + "server@prodesk-server" = helper.mkHome "server" "prodesk-server" "x86_64-linux"; + "culsans@steam-deck" = helper.mkHome "culsans" "steam-deck" "x86_64-linux"; + }; + + # Packages + packages = helper.customPackages; + }; + + inputs = { + # Essential (Nix Ecosystem) + + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + jovian.url = "github:Jovian-Experiments/Jovian-NixOS"; # nixos on steam deck + + agenix.url = "github:ryantm/agenix"; + + # Nonessential + + mnw.url = "github:Gerg-L/mnw"; + + niri.url = "github:sodiboo/niri-flake"; + + nix-minecraft.url = "github:Infinidoge/nix-minecraft"; + + ignis.url = "github:linkfrg/ignis"; + + nix-flatpak.url = "github:gmodena/nix-flatpak"; + }; +} diff --git a/lib/helper.nix b/lib/helper.nix new file mode 100644 index 0000000..5bea0f1 --- /dev/null +++ b/lib/helper.nix @@ -0,0 +1,80 @@ +{inputs}: let + helper = (import ./helper.nix) {inherit inputs;}; +in rec { + # Library to shorten flake. + + # Package Helpers + pkgsFor = sys: inputs.nixpkgs.legacyPackages.${sys}; + + # Miscellaneous + forAllSystems = inputs.nixpkgs.lib.genAttrs [ + "aarch64-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + + # Create a custom packages overlat for use in configs. IDK HOW THIS WORKS BUT IT DOES + customPackagesOverlay.nixpkgs.overlays = [ + (final: prev: + import ../pkgs { + pkgs = final; + inherit inputs; + }) + ]; + + # Create custom packages set for exposure via flake. + customPackages = forAllSystems ( + system: + import ../pkgs { + pkgs = inputs.nixpkgs.legacyPackages.${system}; + inherit inputs; + } + ); + + # Get Custom Libraries + umport = (import ./umport.nix {inherit (inputs.nixpkgs) lib;}).umport; + + # Configuration Buildables + mkSystem = system: architecture: ( + inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs helper; + }; + modules = + [ + ../systems/${system}/system.nix + customPackagesOverlay + ] + ++ umport { + paths = [ + ../modules/system + ../features/system + ]; + recursive = true; + }; + system = architecture; + } + ); + + mkHome = user: system: architecture: ( + inputs.home-manager.lib.homeManagerConfiguration { + pkgs = pkgsFor architecture; + extraSpecialArgs = { + inherit inputs helper; + }; + modules = + [ + ../users/${system}/${user}.nix + customPackagesOverlay + ] + ++ umport { + paths = [ + ../modules/user + ../features/user + ]; + recursive = true; + }; + } + ); +} diff --git a/lib/umport.nix b/lib/umport.nix new file mode 100755 index 0000000..f076d85 --- /dev/null +++ b/lib/umport.nix @@ -0,0 +1,52 @@ +{lib, ...}: let + umport = inputs @ { + path ? null, + paths ? [], + include ? [], + exclude ? [], + recursive ? true, + }: + with lib; + with fileset; let + excludedFiles = filter (path: pathIsRegularFile path) exclude; + excludedDirs = filter (path: pathIsDirectory path) exclude; + isExcluded = path: + if (elem path excludedFiles) || (hasSuffix "flake.nix" path) || (hasSuffix "shell.nix" path) + then true + else (filter (excludedDir: lib.path.hasPrefix excludedDir path) excludedDirs) != []; + in + unique ( + ( + filter + (file: pathIsRegularFile file && hasSuffix ".nix" (builtins.toString file) && !isExcluded file) + (concatMap ( + _path: + if recursive + then toList _path + else + mapAttrsToList ( + name: type: + _path + + ( + if type == "directory" + then "/${name}/default.nix" + else "/${name}" + ) + ) + (builtins.readDir _path) + ) + (unique ( + if path == null + then paths + else [path] ++ paths + ))) + ) + ++ ( + if recursive + then concatMap (path: toList path) (unique include) + else unique include + ) + ); +in { + inherit umport; +} diff --git a/modules/artem-bryzgalov-phmgfNIITL8-unsplash.jpg.REMOVED.git-id b/modules/artem-bryzgalov-phmgfNIITL8-unsplash.jpg.REMOVED.git-id new file mode 100644 index 0000000..de062a7 --- /dev/null +++ b/modules/artem-bryzgalov-phmgfNIITL8-unsplash.jpg.REMOVED.git-id @@ -0,0 +1 @@ +66add41ebaa07ea6b6c7a899f0707f5c05d0a7a9 \ No newline at end of file diff --git a/modules/system/general-settings/default.nix b/modules/system/general-settings/default.nix new file mode 100644 index 0000000..0001f5f --- /dev/null +++ b/modules/system/general-settings/default.nix @@ -0,0 +1,45 @@ +{ config, pkgs, lib, ... }: let + cfg = config.general-settings; +in { + options.general-settings = { + hostname = lib.mkOption { + type = lib.types.str; + default = "nixos"; + description = "system hostname"; + }; + locale = lib.mkOption { + type = lib.types.str; + default = "en_US.UTF-8"; + description = "system locale"; + }; + timezone = lib.mkOption { + type = lib.types.str; + default = "America/New_York"; + description = "system timezone"; + }; + stateVersion = lib.mkOption { + type = lib.types.str; + default = "24.11"; + description = "nixos stateversion"; + }; + }; + config = { + environment.systemPackages = [ pkgs.home-manager ]; + system.stateVersion = cfg.stateVersion; + nixpkgs.config.allowUnfree = true; + networking.hostName = cfg.hostname; + time.timeZone = cfg.timezone; + i18n.defaultLocale = cfg.locale; + i18n.extraLocaleSettings = { + LC_ADDRESS = cfg.locale; + LC_IDENTIFICATION = cfg.locale; + LC_MEASUREMENT = cfg.locale; + LC_MONETARY = cfg.locale; + LC_NAME = cfg.locale; + LC_NUMERIC = cfg.locale; + LC_PAPER = cfg.locale; + LC_TELEPHONE = cfg.locale; + LC_TIME = cfg.locale; + }; + }; +} diff --git a/modules/user/aesthetics/default.nix b/modules/user/aesthetics/default.nix new file mode 100644 index 0000000..9bcf496 --- /dev/null +++ b/modules/user/aesthetics/default.nix @@ -0,0 +1,91 @@ +{ config, pkgs, lib, ... }: let + cfg = config.aesthetics; +in { + options.aesthetics = { + enable = lib.mkEnableOption "aesthetics"; + theme = lib.mkOption { + type = lib.types.str; + description = "The name of the theme to use."; + default = "oxocarbon"; + }; + hasGui = lib.mkOption { + type = lib.types.bool; + description = "Whether to theme gui apps. (can break if no gui)"; + default = false; + }; + enableAllTargets = lib.mkEnableOption "all targets"; + wallpapersDir = lib.mkOption { + type = lib.types.path; + description = "Where to find wallpapers."; + }; + wallpaper = lib.mkOption { + type = lib.types.path; + description = "Where to find the default wallpaper."; + }; + font = { + name = lib.mkOption { + type = lib.types.str; + default = "CodeNewRoman Nerd Font"; + description = "The font to use."; + }; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.nerd-fonts.code-new-roman; + description = "The font package to use."; + }; + size = { + small = lib.mkOption { + type = lib.types.str; + default = "10"; + description = "The size of the font to use for small text. (e.g. terminals)"; + }; + medium = lib.mkOption { + type = lib.types.str; + default = "14"; + description = "The size of the font to use for medium text. (e.g. waybar)"; + }; + large = lib.mkOption { + type = lib.types.str; + default = "18"; + description = "The size of the font to use for large text."; + }; + }; + }; + scheme = let + mkHexOption = {}: lib.mkOption { + type = lib.types.str; + default = ""; + example = "ffffff"; + description = "A hex color"; + }; + in { + base00 = mkHexOption {}; + base01 = mkHexOption {}; + base02 = mkHexOption {}; + base03 = mkHexOption {}; + base04 = mkHexOption {}; + base05 = mkHexOption {}; + base06 = mkHexOption {}; + base07 = mkHexOption {}; + base08 = mkHexOption {}; + base09 = mkHexOption {}; + base0A = mkHexOption {}; + base0B = mkHexOption {}; + base0C = mkHexOption {}; + base0D = mkHexOption {}; + base0E = mkHexOption {}; + base0F = mkHexOption {}; + }; + opacity = lib.mkOption { + type = lib.types.float; + description = "Opacity"; + default = 1.0; + }; + }; + config = lib.mkIf cfg.enable { + aesthetics.themes.${cfg.theme}.enable = true; + + home.packages = [ cfg.font.package ]; + fonts.fontconfig.enable = true; + }; +} diff --git a/modules/user/aesthetics/readme.md b/modules/user/aesthetics/readme.md new file mode 100644 index 0000000..75588a2 --- /dev/null +++ b/modules/user/aesthetics/readme.md @@ -0,0 +1,15 @@ +# Aesthetics + +My crappy custom nix module for managing: + +- Base16 colors +- Window opacity +- System font +- Wallpapers + +## Structure + +- default.nix: Creates all main options to be set by modules in the themes dir. also configures the font and enables one theme. +- themes/: Contains modules with sets of base16 colors and which set options in default.nix. These modules can contain direct configs for certain apps if the apps have poor base16 support, but they must obey the options set in the app's target module. +- targets/: Contains modules configuring apps using base16 colors or just setting options to enable or disable the theming of an app. + diff --git a/modules/user/aesthetics/targets/foot.nix b/modules/user/aesthetics/targets/foot.nix new file mode 100644 index 0000000..c6c2283 --- /dev/null +++ b/modules/user/aesthetics/targets/foot.nix @@ -0,0 +1,55 @@ +{ config, lib, ... }: let + cfg = config.aesthetics.targets.foot; + aes = config.aesthetics; +in { + options.aesthetics.targets.foot.enable = lib.mkOption { + type = lib.types.bool; + default = (aes.enableAllTargets && aes.hasGui); + description = "Whether to enable the aesthetics foot target."; + }; + config = lib.mkIf (cfg.enable && config.programs.foot.enable) { + programs.foot.settings = { + main.font = "${aes.font.name}:size=${aes.font.size.small}"; + tweak.font-monospace-warn = false; + colors = with aes.scheme; { + background = base00; + foreground = base05; + + # normal + regular0 = base00; + regular1 = base08; + regular2 = base0B; + regular3 = base0A; + regular4 = base0D; + regular5 = base0E; + regular6 = base0C; + regular7 = base05; + + # bright + bright0 = base03; + bright1 = base09; + bright2 = base01; + bright3 = base02; + bright4 = base04; + bright5 = base06; + bright6 = base0F; + bright7 = base07; + + # extended + "16" = base09; + "17" = base0F; + "18" = base01; + "19" = base02; + "20" = base04; + "21" = base06; + + # misc + selection-background = base05; + selection-foreground = base00; + urls = base04; + jump-labels = "${base00} ${base0A}"; + scrollback-indicator = "${base00} ${base04}"; + }; + }; + }; +} diff --git a/modules/user/aesthetics/targets/gtk.nix b/modules/user/aesthetics/targets/gtk.nix new file mode 100644 index 0000000..54377af --- /dev/null +++ b/modules/user/aesthetics/targets/gtk.nix @@ -0,0 +1,119 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.aesthetics.targets.gtk; + aes = config.aesthetics; + + gtkCSS = with aes.scheme; '' + @define-color accent_color #${base0D}; + @define-color accent_bg_color #${base0D}; + @define-color accent_fg_color #${base00}; + @define-color destructive_color #${base08}; + @define-color destructive_bg_color #${base08}; + @define-color destructive_fg_color #${base00}; + @define-color success_color #${base0B}; + @define-color success_bg_color #${base0B}; + @define-color success_fg_color #${base00}; + @define-color warning_color #${base0E}; + @define-color warning_bg_color #${base0E}; + @define-color warning_fg_color #${base00}; + @define-color error_color #${base08}; + @define-color error_bg_color #${base08}; + @define-color error_fg_color #${base00}; + @define-color window_bg_color #${base00}; + @define-color window_fg_color #${base05}; + @define-color view_bg_color #${base00}; + @define-color view_fg_color #${base05}; + @define-color headerbar_bg_color #${base01}; + @define-color headerbar_fg_color #${base05}; + @define-color headerbar_border_color #${base01} + @define-color headerbar_backdrop_color @window_bg_color; + @define-color headerbar_shade_color rgba(0, 0, 0, 0.07); + @define-color headerbar_darker_shade_color rgba(0, 0, 0, 0.07); + @define-color sidebar_bg_color #${base01}; + @define-color sidebar_fg_color #${base05}; + @define-color sidebar_backdrop_color @window_bg_color; + @define-color sidebar_shade_color rgba(0, 0, 0, 0.07); + @define-color secondary_sidebar_bg_color @sidebar_bg_color; + @define-color secondary_sidebar_fg_color @sidebar_fg_color; + @define-color secondary_sidebar_backdrop_color @sidebar_backdrop_color; + @define-color secondary_sidebar_shade_color @sidebar_shade_color; + @define-color card_bg_color #${base01}; + @define-color card_fg_color #${base05}; + @define-color card_shade_color rgba(0, 0, 0, 0.07); + @define-color dialog_bg_color #${base01}; + @define-color dialog_fg_color #${base05}; + @define-color popover_bg_color #${base01}; + @define-color popover_fg_color #${base05}; + @define-color popover_shade_color rgba(0, 0, 0, 0.07); + @define-color shade_color rgba(0, 0, 0, 0.07); + @define-color scrollbar_outline_color #${base02}; + @define-color blue_1 #${base0D}; + @define-color blue_2 #${base0D}; + @define-color blue_3 #${base0D}; + @define-color blue_4 #${base0D}; + @define-color blue_5 #${base0D}; + @define-color green_1 #${base0B}; + @define-color green_2 #${base0B}; + @define-color green_3 #${base0B}; + @define-color green_4 #${base0B}; + @define-color green_5 #${base0B}; + @define-color yellow_1 #${base0A}; + @define-color yellow_2 #${base0A}; + @define-color yellow_3 #${base0A}; + @define-color yellow_4 #${base0A}; + @define-color yellow_5 #${base0A}; + @define-color orange_1 #${base09}; + @define-color orange_2 #${base09}; + @define-color orange_3 #${base09}; + @define-color orange_4 #${base09}; + @define-color orange_5 #${base09}; + @define-color red_1 #${base08}; + @define-color red_2 #${base08}; + @define-color red_3 #${base08}; + @define-color red_4 #${base08}; + @define-color red_5 #${base08}; + @define-color purple_1 #${base0E}; + @define-color purple_2 #${base0E}; + @define-color purple_3 #${base0E}; + @define-color purple_4 #${base0E}; + @define-color purple_5 #${base0E}; + @define-color brown_1 #${base0F}; + @define-color brown_2 #${base0F}; + @define-color brown_3 #${base0F}; + @define-color brown_4 #${base0F}; + @define-color brown_5 #${base0F}; + @define-color light_1 #${base01}; + @define-color light_2 #${base01}; + @define-color light_3 #${base01}; + @define-color light_4 #${base01}; + @define-color light_5 #${base01}; + @define-color dark_1 #${base01}; + @define-color dark_2 #${base01}; + @define-color dark_3 #${base01}; + @define-color dark_4 #${base01}; + @define-color dark_5 #${base01}; + ''; +in { + options.aesthetics.targets.gtk.enable = lib.mkOption { + type = lib.types.bool; + default = (aes.enableAllTargets && aes.hasGui); + description = "Whether to enable the aesthetics GTK target."; + }; + config = lib.mkIf cfg.enable { + gtk = { + enable = true; + theme = { + package = pkgs.adw-gtk3; + name = "adw-gtk3"; + }; + }; + xdg.configFile = { + "gtk-3.0/gtk.css".text = gtkCSS; + "gtk-4.0/gtk.css".text = gtkCSS; + }; + }; +} diff --git a/modules/user/aesthetics/targets/helix.nix b/modules/user/aesthetics/targets/helix.nix new file mode 100644 index 0000000..dde557e --- /dev/null +++ b/modules/user/aesthetics/targets/helix.nix @@ -0,0 +1,28 @@ +{ config, lib, ... }: let + cfg = config.aesthetics.targets.helix; + aes = config.aesthetics; +in { + options.aesthetics.targets.helix = { + enable = lib.mkOption { + type = lib.types.bool; + default = aes.enableAllTargets; + description = "Whether to enable the aesthetics helix target."; + }; + theme = lib.mkOption { + type = lib.types.str; + default = "default"; + description = "The name of the theme to use for helix."; + }; + }; + config = lib.mkIf (cfg.enable && config.programs.helix.enable) { + programs.helix.settings.theme = "custom-default"; + home.file."helix-theme" = { + target = ".config/helix/themes/custom-default.toml"; + text = /*toml*/ '' + inherits = "${cfg.theme}" + "ui.background" = { } + "ui.statusline" = { bg = "" } + ''; + }; + }; +} diff --git a/modules/user/aesthetics/targets/mako.nix b/modules/user/aesthetics/targets/mako.nix new file mode 100644 index 0000000..2ade32e --- /dev/null +++ b/modules/user/aesthetics/targets/mako.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: let + cfg = config.aesthetics.targets.mako; + aes = config.aesthetics; +in { + options.aesthetics.targets.mako.enable = lib.mkOption { + type = lib.types.bool; + default = aes.enableAllTargets && aes.hasGui; + description = "Whether to enable the aesthetics mako target."; + }; + config = lib.mkIf (cfg.enable && config.services.mako.enable) { + services.mako.settings = with aes.scheme; { + background-color = "#${base00}"; + border-color = "#${base0C}"; + text-color = "#${base05}"; + progress-color = "over #${base02}"; + font = "${aes.font.name} ${aes.font.size.small}"; + }; + }; +} diff --git a/modules/user/aesthetics/targets/qutebrowser.nix b/modules/user/aesthetics/targets/qutebrowser.nix new file mode 100644 index 0000000..ef7f17d --- /dev/null +++ b/modules/user/aesthetics/targets/qutebrowser.nix @@ -0,0 +1,213 @@ +{ + config, + lib, + ... +}: let + cfg = config.aesthetics.targets.qutebrowser; + aes = config.aesthetics; +in { + options.aesthetics.targets.qutebrowser.enable = lib.mkOption { + type = lib.types.bool; + default = aes.enableAllTargets && aes.hasGui; + description = "Whether to enable the aesthetics qutebrowser target."; + }; + config = lib.mkIf (cfg.enable && config.programs.qutebrowser.enable) { + programs.qutebrowser.settings = { + fonts = { + default_family = aes.font.name; + default_size = "${aes.font.size.small}pt"; + }; + colors = with aes.scheme; let + background = "#${base00}"; + secondary-background = "#${base01}"; + selection-background = "#${base03}"; + foreground = "#${base05}"; + inverted-foreground = "#${base00}"; + error = "#${base08}"; + info = "#${base0B}"; + secondary-info = "#${base0C}"; + warning = "#${base0E}"; + in { + completion = { + category = { + bg = background; + fg = info; + border = { + bottom = background; + top = background; + }; + }; + even.bg = background; + fg = foreground; + item.selected = { + bg = selection-background; + border = { + bottom = selection-background; + top = selection-background; + }; + fg = foreground; + }; + match.fg = info; + odd.bg = secondary-background; + scrollbar = { + bg = background; + fg = foreground; + }; + }; + contextmenu = { + disabled = { + bg = secondary-background; + fg = inverted-foreground; + }; + menu = { + bg = background; + fg = foreground; + }; + selected = { + bg = selection-background; + fg = foreground; + }; + }; + downloads = { + bar.bg = background; + error = { + bg = error; + fg = inverted-foreground; + }; + start = { + bg = info; + fg = inverted-foreground; + }; + stop = { + bg = secondary-info; + fg = inverted-foreground; + }; + }; + hints = { + bg = secondary-background; + fg = foreground; + match.fg = info; + }; + keyhint = { + bg = background; + fg = foreground; + suffix.fg = foreground; + }; + messages = { + error = { + bg = error; + fg = inverted-foreground; + border = error; + }; + info = { + bg = info; + fg = inverted-foreground; + border = info; + }; + warning = { + bg = warning; + fg = inverted-foreground; + border = warning; + }; + }; + prompts = { + bg = background; + border = background; + fg = foreground; + selected.bg = secondary-background; + }; + statusbar = { + caret = { + bg = selection-background; + fg = foreground; + selection = { + bg = selection-background; + fg = foreground; + }; + }; + command = { + bg = background; + fg = foreground; + private = { + bg = secondary-background; + fg = foreground; + }; + }; + insert = { + bg = info; + fg = inverted-foreground; + }; + normal = { + bg = background; + fg = foreground; + }; + passthrough = { + bg = info; + fg = inverted-foreground; + }; + private = { + bg = secondary-background; + fg = foreground; + }; + progress.bg = info; + url = { + error.fg = error; + fg = foreground; + hover.fg = foreground; + success = { + http.fg = secondary-info; + https.fg = info; + }; + warn.fg = warning; + }; + }; + tabs = { + bar.bg = background; + even = { + bg = secondary-background; + fg = foreground; + }; + indicator = { + inherit error; + start = secondary-info; + stop = info; + }; + odd = { + bg = background; + fg = foreground; + }; + pinned = { + even = { + bg = info; + fg = inverted-foreground; + }; + odd = { + bg = secondary-info; + fg = inverted-foreground; + }; + selected = { + even = { + bg = selection-background; + fg = foreground; + }; + odd = { + bg = selection-background; + fg = foreground; + }; + }; + }; + selected = { + even = { + bg = selection-background; + fg = foreground; + }; + odd = { + bg = selection-background; + fg = foreground; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/user/aesthetics/targets/vesktop.nix b/modules/user/aesthetics/targets/vesktop.nix new file mode 100644 index 0000000..968df1a --- /dev/null +++ b/modules/user/aesthetics/targets/vesktop.nix @@ -0,0 +1,65 @@ +{ config, lib, ... }: let + cfg = config.aesthetics.targets.vesktop; + aes = config.aesthetics; +in { + options.aesthetics.targets.vesktop.enable = lib.mkOption { + type = lib.types.bool; + default = (aes.enableAllTargets && aes.hasGui); + description = "Whether to enable the aesthetics vesktop target."; + }; + config = lib.mkIf cfg.enable { + xdg.configFile."vesktop/themes/stylix.theme.css".text = with aes.scheme; '' + :root { + --base00: #${base00}; /* Black */ + --base01: #${base01}; /* Bright Black */ + --base02: #${base02}; /* Grey */ + --base03: #${base03}; /* Brighter Grey */ + --base04: #${base04}; /* Bright Grey */ + --base05: #${base05}; /* White */ + --base06: #${base06}; /* Brighter White */ + --base07: #${base07}; /* Bright White */ + --base08: #${base08}; /* Red */ + --base09: #${base09}; /* Orange */ + --base0A: #${base0A}; /* Yellow */ + --base0B: #${base0B}; /* Green */ + --base0C: #${base0C}; /* Cyan */ + --base0D: #${base0D}; /* Blue */ + --base0E: #${base0E}; /* Purple */ + --base0F: #${base0F}; /* Magenta */ + + --primary-630: var(--base00); /* Autocomplete background */ + --primary-660: var(--base00); /* Search input background */ + } + + .theme-light, .theme-dark { + --search-popout-option-fade: none; /* Disable fade for search popout */ + --bg-overlay-2: var(--base00); /* These 2 are needed for proper threads coloring */ + --home-background: var(--base00); + --bg-overlay-chat : var(--base00); /* Recolor forum channels */ + --background-primary: var(--base00); + --background-secondary: var(--base01); + --background-secondary-alt: var(--base01); + --channeltextarea-background: var(--base01); + --background-tertiary: var(--base00); + --background-accent: var(--base0E); + --background-floating: var(--base01); + --background-modifier-hover: #{{base00-hex}}4c; /* 30% of base00 */ + --background-modifier-selected: var(--base00); + --text-normal: var(--base05); + --text-secondary: var(--base03); + --text-muted: var(--base04); + --text-link: var(--base0C); + --interactive-normal: var(--base05); + --interactive-hover: var(--base05); + --interactive-active: var(--base07); + --interactive-muted: var(--base03); + --channels-default: var(--base04); + --channel-icon: var(--base04); + --header-primary: var(--base06); + --header-secondary: var(--base04); + --scrollbar-thin-track: transparent; + --scrollbar-auto-track: transparent; + } + ''; + }; +} diff --git a/modules/user/aesthetics/targets/zellij.nix b/modules/user/aesthetics/targets/zellij.nix new file mode 100644 index 0000000..cefd8ab --- /dev/null +++ b/modules/user/aesthetics/targets/zellij.nix @@ -0,0 +1,28 @@ +{ config, lib, ... }: let + cfg = config.aesthetics.targets.zellij; + aes = config.aesthetics; +in { + options.aesthetics.targets.zellij.enable = lib.mkOption { + type = lib.types.bool; + default = aes.enableAllTargets; + description = "Whether to enable the aesthetics zellij target."; + }; + config = lib.mkIf (cfg.enable && config.programs.zellij.enable) { + programs.zellij.settings = { + theme = "base16"; + themes.base16 = with aes.scheme; { + bg = "#${base03}"; + fg = "#${base05}"; + red = "#${base08}"; + green = "#${base0B}"; + blue = "#${base0D}"; + yellow = "#${base0A}"; + magenta = "#${base0E}"; + orange = "#${base09}"; + cyan = "#${base0C}"; + black = "#${base00}"; + white = "#${base07}"; + }; + }; + }; +} diff --git a/modules/user/aesthetics/themes/oxocarbon/default.nix b/modules/user/aesthetics/themes/oxocarbon/default.nix new file mode 100644 index 0000000..c568c97 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/default.nix @@ -0,0 +1,67 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: let + cfg = config.aesthetics.themes.oxocarbon; +in { + options.aesthetics.themes.oxocarbon.enable = lib.mkEnableOption "oxocarbon theme"; + config = lib.mkMerge [ + ( + lib.mkIf cfg.enable { + aesthetics = { + wallpaper = ./wallpapers/landscape/salt-flats.jpg; + wallpapersDir = ./wallpapers; + scheme = { + base00 = "161616"; + base01 = "262626"; + base02 = "393939"; + base03 = "525252"; + base04 = "dde1e6"; + base05 = "f2f4f8"; + base06 = "ffffff"; + base07 = "08bdba"; + base08 = "3ddbd9"; + base09 = "78a9ff"; + base0A = "ee5396"; + base0B = "33b1ff"; + base0C = "ff7eb6"; + base0D = "42be65"; + base0E = "be95ff"; + base0F = "82cfff"; + }; + font = { + name = "CodeNewRoman Nerd Font"; + package = pkgs.nerd-fonts.code-new-roman; + }; + # font = { + # name = "Kirsch Nerd Font"; + # size = "22"; + # package = inputs.kirsch.packages.x86_64-linux.kirsch-nerd; + # }; + }; + # home.pointerCursor = { + # package = pkgs.oreo-cursors-plus; + # name = "oreo_spark_black_bordered_cursors"; + # size = 22; + # }; + home.pointerCursor = { + package = pkgs.qogir-icon-theme; + name = "Qogir-Dark"; + size = 22; + }; + } + ) + ( + lib.mkIf config.aesthetics.targets.helix.enable { + aesthetics.targets.helix.theme = "oxocarbon"; + home.file."helix-oxocarbon-theme" = { + target = ".config/helix/themes/oxocarbon.toml"; + source = ./helix-theme.toml; + }; + } + ) + ]; +} diff --git a/modules/user/aesthetics/themes/oxocarbon/helix-theme.toml b/modules/user/aesthetics/themes/oxocarbon/helix-theme.toml new file mode 100644 index 0000000..8cf3c49 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/helix-theme.toml @@ -0,0 +1,52 @@ + +# inherits = "fleet_dark" + +"attribute" = { fg = "#82cfff" } +"type" = { fg = "#78a9ff" } +"type.builtin" = { fg = "#dde1e6" } +"constructor" = { fg = "#78a9ff" } +"constant" = { fg = "#be95ff" } +"constant.builtin" = { fg = "#08bdba" } +"constant.builtin.character" = { fg = "#be95ff" } +"constant.builtin.numeric" = { fg = "#82cfff" } +"string" = { fg = "#be95ff" } +"string.regexp" = { fg = "#08bdba" } +"comment" = { fg = "#525252" } +"variable" = { fg = "#dde1e6" } +"label" = { fg = "#82cfff" } +"punctuation" = { fg = "#3ddbd9" } +"keyword" = { fg = "#78a9ff" } +"keyword.control.exception" = { fg = "#82cfff" } +"keyword.operator" = { fg = "#3ddbd9" } +"keyword.function" = { fg = "#3ddbd9" } +"operator" = { fg = "#78a9ff" } +"function" = { fg = "#ff7eb6" } +"function.builtin" = { fg = "#ff7eb6" } +"function.method" = { fg = "#08bdba" } +"function.macro" = { fg = "#08bdba" } +"tag" = { fg = "#dde1e6" } +"namespace" = { fg = "#dde1e6" } +"diff.plus" = { fg = "#42be65", bg = "#393939" } +"diff.minus" = { fg = "#78a9ff", bg = "#393939" } +"diff.delta" = { fg = "#dde1e6", bg = "#262626" } + +"ui.background" = { fg= "#ffffff", bg = "#161616"} +"ui.separator" = "#161616" +"ui.selection" = { bg = "#393939"} +"ui.text" = { fg = "#ffffff" } +"ui.cursor" = { fg = "#161616", bg = "#dde1e6" } +"ui.cursor.normal" = { fg = "#dde1e6", bg = "#161616" } +"ui.linenr" = { fg = "#525252", bg = "#161616" } +"ui.linenr.selected" = { fg = "#dde1e6" } +"ui.statusline" = { fg = "#ffffff", bg = "#161616" } +"ui.statusline.inactive" = { fg = "#525252"} +"ui.statusline.normal" = { fg = "#ffffff", bg = "#161616" } +"ui.statusline.insert" = { fg = "#ffffff", bg = "#ff7eb6" } +"ui.popup" = { fg = "#ffffff", bg = "#262626" } +"ui.window" = { fg = "#ffffff", bg = "#262626" } +"ui.menu" = { fg = "#ffffff", bg = "#262626" } +"ui.menu.selected" = { fg = "#ffffff", bg = "#525252" } +"diagnostic.error" = { fg = "#b3b3b3", bg = "#262626", underline = { color = "#ff0000", style = "curl"} } +"diagnostic.warning" = { fg = "#b3b3b3", bg = "#262626", underline = { color = "#ff6f00", style = "curl"} } +"error" = { fg = "#ffffff", bg = "#262626" } +"warning" = { fg = "#ffffff", bg = "#262626" } diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/aerial-autumn-road.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/aerial-autumn-road.jpg.REMOVED.git-id new file mode 100644 index 0000000..74888fb --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/aerial-autumn-road.jpg.REMOVED.git-id @@ -0,0 +1 @@ +fec9a0829c8e1986b14fe7725019937dbdbb3a88 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-leaves.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-leaves.jpg.REMOVED.git-id new file mode 100644 index 0000000..2a0fdf3 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-leaves.jpg.REMOVED.git-id @@ -0,0 +1 @@ +f356a48f0b0f7c85cec4dfd2a73d17870eb7f913 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-silhouette.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-silhouette.jpg.REMOVED.git-id new file mode 100644 index 0000000..dd41826 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumn-silhouette.jpg.REMOVED.git-id @@ -0,0 +1 @@ +114ff2864e8ccacabe4121aea8ed8b7627649ebf \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-mountain.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-mountain.jpg.REMOVED.git-id new file mode 100644 index 0000000..2f50bfa --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-mountain.jpg.REMOVED.git-id @@ -0,0 +1 @@ +d36f1cc1c709b305c4ffc8ea0709f730bfabef08 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-road.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-road.jpg.REMOVED.git-id new file mode 100644 index 0000000..c5da27a --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/autumnal-road.jpg.REMOVED.git-id @@ -0,0 +1 @@ +32ae20560377c0667f81360d1ddd6e1902af69cb \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/maple-leaf.jpg b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/maple-leaf.jpg new file mode 100644 index 0000000..75e4f56 Binary files /dev/null and b/modules/user/aesthetics/themes/oxocarbon/wallpapers/autumn/maple-leaf.jpg differ diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/forest-lake.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/forest-lake.jpg.REMOVED.git-id new file mode 100644 index 0000000..e048b39 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/forest-lake.jpg.REMOVED.git-id @@ -0,0 +1 @@ +8947e64585baf2d8d1e3f3df5564f66ff8ace768 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/lake-island.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/lake-island.jpg.REMOVED.git-id new file mode 100644 index 0000000..a33f51f --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/lake-island.jpg.REMOVED.git-id @@ -0,0 +1 @@ +2438c078ae6bde2b2048fd28284b935b1c5f6b0b \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/purple-lake.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/purple-lake.jpg.REMOVED.git-id new file mode 100644 index 0000000..9537afc --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/purple-lake.jpg.REMOVED.git-id @@ -0,0 +1 @@ +7df17f9c0426dc4f502496d33e4eae3c24347175 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/sunset-lake-off-dock.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/sunset-lake-off-dock.jpg.REMOVED.git-id new file mode 100644 index 0000000..dbefd90 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/sunset-lake-off-dock.jpg.REMOVED.git-id @@ -0,0 +1 @@ +634d72e228a6cea00670d8ff745cffe80cec6d84 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/warm-lakeside-village.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/warm-lakeside-village.jpg.REMOVED.git-id new file mode 100644 index 0000000..9c48142 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/lake/warm-lakeside-village.jpg.REMOVED.git-id @@ -0,0 +1 @@ +673486a7a2d2e5b55b6c0ac4ca0460e34390ae1a \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/aerial-dark-marsh.jpg b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/aerial-dark-marsh.jpg new file mode 100644 index 0000000..3ad3d24 Binary files /dev/null and b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/aerial-dark-marsh.jpg differ diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bridge-on-cliff.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bridge-on-cliff.jpg.REMOVED.git-id new file mode 100644 index 0000000..99901a6 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bridge-on-cliff.jpg.REMOVED.git-id @@ -0,0 +1 @@ +fed3cb735bcd0146dbeeb7c128487a5eb1b9265b \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bright-night-sky.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bright-night-sky.jpg.REMOVED.git-id new file mode 100644 index 0000000..99a1ab7 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/bright-night-sky.jpg.REMOVED.git-id @@ -0,0 +1 @@ +f18b94d5c4e6ad7969f6eef360b22452346543b0 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-mountains.jpeg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-mountains.jpeg.REMOVED.git-id new file mode 100644 index 0000000..d0296a8 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-mountains.jpeg.REMOVED.git-id @@ -0,0 +1 @@ +547b2b255f9316b9e9ad019dcef8692a3162e752 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-valley.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-valley.jpg.REMOVED.git-id new file mode 100644 index 0000000..3c61af7 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/cloudy-valley.jpg.REMOVED.git-id @@ -0,0 +1 @@ +07db18c6d4373495a8aa9433d5747c6b257d20d1 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/dramatic-mountains.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/dramatic-mountains.jpg.REMOVED.git-id new file mode 100644 index 0000000..e7f9ba1 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/dramatic-mountains.jpg.REMOVED.git-id @@ -0,0 +1 @@ +c9a8766c6d83ec0047ad2ce7baba56475d692783 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountain.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountain.jpg.REMOVED.git-id new file mode 100644 index 0000000..bfa8ffa --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountain.jpg.REMOVED.git-id @@ -0,0 +1 @@ +f5a9537d35436f4705363bf8f7d539f12d980edf \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountainside.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountainside.jpg.REMOVED.git-id new file mode 100644 index 0000000..73a8503 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/forested-mountainside.jpg.REMOVED.git-id @@ -0,0 +1 @@ +f142762db436b6c0634606a2449de5f8cf9b8d95 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/green-mountains.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/green-mountains.jpg.REMOVED.git-id new file mode 100644 index 0000000..570f2ef --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/green-mountains.jpg.REMOVED.git-id @@ -0,0 +1 @@ +9fe5f9d53d4eae1ee986f695ff3b1aefb3b9ce01 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/hillside-village.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/hillside-village.jpg.REMOVED.git-id new file mode 100644 index 0000000..17250be --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/hillside-village.jpg.REMOVED.git-id @@ -0,0 +1 @@ +7bb214a8c0b69f66193fc9c75ad66aab6202a87f \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/monochrome-mountain-sky.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/monochrome-mountain-sky.jpg.REMOVED.git-id new file mode 100644 index 0000000..c7b3d7f --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/monochrome-mountain-sky.jpg.REMOVED.git-id @@ -0,0 +1 @@ +10866fc7566bc639fc9fa0e0cf4b15b00c5611e2 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-glowing-sky.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-glowing-sky.jpg.REMOVED.git-id new file mode 100644 index 0000000..8a2eefb --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-glowing-sky.jpg.REMOVED.git-id @@ -0,0 +1 @@ +74fda86258377de5190cc4651540825009639971 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sky-streak.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sky-streak.jpg.REMOVED.git-id new file mode 100644 index 0000000..4ade70e --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sky-streak.jpg.REMOVED.git-id @@ -0,0 +1 @@ +83881e043b85223e4519e9c5744fd75f2015bd07 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sunset.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sunset.jpg.REMOVED.git-id new file mode 100644 index 0000000..9925380 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-sunset.jpg.REMOVED.git-id @@ -0,0 +1 @@ +a0ad8aad30426eba7f854100534ad95bbc5ab4c4 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-through-valley.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-through-valley.jpg.REMOVED.git-id new file mode 100644 index 0000000..de062a7 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/mountain-through-valley.jpg.REMOVED.git-id @@ -0,0 +1 @@ +66add41ebaa07ea6b6c7a899f0707f5c05d0a7a9 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/night-mountain-silhouette.jpg b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/night-mountain-silhouette.jpg new file mode 100644 index 0000000..052f0ff Binary files /dev/null and b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/night-mountain-silhouette.jpg differ diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/pink-hill-silhouette.jpg b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/pink-hill-silhouette.jpg new file mode 100644 index 0000000..83ba86c Binary files /dev/null and b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/pink-hill-silhouette.jpg differ diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/purple-mountains.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/purple-mountains.jpg.REMOVED.git-id new file mode 100644 index 0000000..09824df --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/purple-mountains.jpg.REMOVED.git-id @@ -0,0 +1 @@ +b1ed553c6325a9ad2da983852387c2dfe50f6825 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-ridges.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-ridges.jpg.REMOVED.git-id new file mode 100644 index 0000000..1e10d7c --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-ridges.jpg.REMOVED.git-id @@ -0,0 +1 @@ +8c5eeb42697a79f5f32b5960e625e3cff6d73d41 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-rock.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-rock.jpg.REMOVED.git-id new file mode 100644 index 0000000..5649262 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/red-rock.jpg.REMOVED.git-id @@ -0,0 +1 @@ +7c720c493c2f9ad86b1bef25b7c49b8b7bcd6557 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/salt-flats.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/salt-flats.jpg.REMOVED.git-id new file mode 100644 index 0000000..7ba92ea --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/salt-flats.jpg.REMOVED.git-id @@ -0,0 +1 @@ +cfe81cb76724211064d953f69709536cb7626bd4 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/sea-of-clouds.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/sea-of-clouds.jpg.REMOVED.git-id new file mode 100644 index 0000000..8bc7e51 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/sea-of-clouds.jpg.REMOVED.git-id @@ -0,0 +1 @@ +fdb0709d4a348e27cf32c77e7ff46843fe7defc3 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/seaside-mountain.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/seaside-mountain.jpg.REMOVED.git-id new file mode 100644 index 0000000..d0e9edf --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/seaside-mountain.jpg.REMOVED.git-id @@ -0,0 +1 @@ +cc0580d227effdd2801b1f9fde7400a4b3adf2a5 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/tree-mountain.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/tree-mountain.jpg.REMOVED.git-id new file mode 100644 index 0000000..465ee8f --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/tree-mountain.jpg.REMOVED.git-id @@ -0,0 +1 @@ +597e7f1f8dd45f386a340fd9e5747118778bc03e \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yellow-mountains.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yellow-mountains.jpg.REMOVED.git-id new file mode 100644 index 0000000..00a6e0c --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yellow-mountains.jpg.REMOVED.git-id @@ -0,0 +1 @@ +96a0cd20d93ede80ec2614357952bf8c5074a91c \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yosemite-valley.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yosemite-valley.jpg.REMOVED.git-id new file mode 100644 index 0000000..681c055 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/landscape/yosemite-valley.jpg.REMOVED.git-id @@ -0,0 +1 @@ +ae0b4039a4783e16323dc164a4ad5124b1618983 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/crags.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/crags.jpg.REMOVED.git-id new file mode 100644 index 0000000..179a3ee --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/crags.jpg.REMOVED.git-id @@ -0,0 +1 @@ +6540b948567bc7c398a4f763537583c3380da4cc \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/dusk-rocky-beach.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/dusk-rocky-beach.jpg.REMOVED.git-id new file mode 100644 index 0000000..2850870 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/dusk-rocky-beach.jpg.REMOVED.git-id @@ -0,0 +1 @@ +7d1e02e402e6764f27d54dce2b1ca9cece3f9853 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/flowers.png b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/flowers.png new file mode 100644 index 0000000..791cf4e Binary files /dev/null and b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/flowers.png differ diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/foggy-forest.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/foggy-forest.jpg.REMOVED.git-id new file mode 100644 index 0000000..d16a315 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/foggy-forest.jpg.REMOVED.git-id @@ -0,0 +1 @@ +ceb6f4745978a2ee495e0cafc660e442ddf093eb \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/forest-trail.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/forest-trail.jpg.REMOVED.git-id new file mode 100644 index 0000000..556867f --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/forest-trail.jpg.REMOVED.git-id @@ -0,0 +1 @@ +861b48748b56668e413359a8e21245b205f8ce06 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/narrow-waterfall.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/narrow-waterfall.jpg.REMOVED.git-id new file mode 100644 index 0000000..0dd142c --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/narrow-waterfall.jpg.REMOVED.git-id @@ -0,0 +1 @@ +c16ecda2c7373771c4026a1bee885f874a311889 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/purple-sky.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/purple-sky.jpg.REMOVED.git-id new file mode 100644 index 0000000..c108571 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/purple-sky.jpg.REMOVED.git-id @@ -0,0 +1 @@ +e6d39dd457a04e73618304b9df6048109e35e181 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/snowy-slope.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/snowy-slope.jpg.REMOVED.git-id new file mode 100644 index 0000000..576c9e5 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/nature/snowy-slope.jpg.REMOVED.git-id @@ -0,0 +1 @@ +f792412ee7bc0d77b6b627290ace6629c1c0fac9 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/aerial-island.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/aerial-island.jpg.REMOVED.git-id new file mode 100644 index 0000000..b667868 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/aerial-island.jpg.REMOVED.git-id @@ -0,0 +1 @@ +96bd9a930015289dc5514caf2c979756664ea86c \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beached-ship.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beached-ship.jpg.REMOVED.git-id new file mode 100644 index 0000000..462c5a1 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beached-ship.jpg.REMOVED.git-id @@ -0,0 +1 @@ +928f6b1060b589d2e452ce59825c700207449fd9 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beachfront.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beachfront.jpg.REMOVED.git-id new file mode 100644 index 0000000..21f3c5d --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/beachfront.jpg.REMOVED.git-id @@ -0,0 +1 @@ +52739b890a162f7d2744f6257401334f5216fe08 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/seaside-village.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/seaside-village.jpg.REMOVED.git-id new file mode 100644 index 0000000..454c5d8 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/seaside-village.jpg.REMOVED.git-id @@ -0,0 +1 @@ +75d6df2f3ea489ea6556114afec2deb0e288beec \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/sunset-seaside-city.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/sunset-seaside-city.jpg.REMOVED.git-id new file mode 100644 index 0000000..17e752d --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/ocean/sunset-seaside-city.jpg.REMOVED.git-id @@ -0,0 +1 @@ +f52a7a31c74ca6d5684c0dc647796fd6e0e4881e \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/other/grey-dune.jpeg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/other/grey-dune.jpeg.REMOVED.git-id new file mode 100644 index 0000000..2d3d7b3 --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/other/grey-dune.jpeg.REMOVED.git-id @@ -0,0 +1 @@ +2131a11962de4aa72bbfb9d87dbcc39d914ae8f9 \ No newline at end of file diff --git a/modules/user/aesthetics/themes/oxocarbon/wallpapers/other/yellow-moon-in-sky.jpg.REMOVED.git-id b/modules/user/aesthetics/themes/oxocarbon/wallpapers/other/yellow-moon-in-sky.jpg.REMOVED.git-id new file mode 100644 index 0000000..e970c2e --- /dev/null +++ b/modules/user/aesthetics/themes/oxocarbon/wallpapers/other/yellow-moon-in-sky.jpg.REMOVED.git-id @@ -0,0 +1 @@ +3c99ad95e60b3be7dd87f8a3ee762a721a1aea0b \ No newline at end of file diff --git a/modules/user/default-apps.nix b/modules/user/default-apps.nix new file mode 100644 index 0000000..7ec2b16 --- /dev/null +++ b/modules/user/default-apps.nix @@ -0,0 +1,49 @@ +{ config, lib, ... }: +let + cfg = config.default-applications; + mkCommand = name: lib.mkOption { + type = lib.types.str; + default = ""; + description = "The default ${name}."; + }; + mkDesktopFile = name: lib.mkOption { + type = lib.types.str; + default = ""; + description = "The default ${name}'s .desktop file"; + }; +in { + options.default-applications = { + web-browser = { + command = mkCommand "web browser"; + desktop-file = mkDesktopFile "web browser"; + }; + text-editor = { + command = mkCommand "text editor"; + desktop-file = mkDesktopFile "text editor"; + }; + image-viewer = { + command = mkCommand "image viewer"; + desktop-file = mkDesktopFile "image viewer"; + }; + video-viewer = { + command = mkCommand "video viewer"; + desktop-file = mkDesktopFile "video viewer"; + }; + terminal-emulator = { + command = mkCommand "terminal emulator"; + runTuiCommand = mkCommand "terminal emulator run tui command"; + runCliCommand = mkCommand "terminal emulator run cli command"; + desktop-file = mkDesktopFile "terminal emulator"; + }; + }; + config = { + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/plain" = [ cfg.text-editor.desktop-file ]; + "text/html" = [ cfg.text-editor.desktop-file ]; + "text/nix" = [ cfg.text-editor.desktop-file ]; + }; + }; + }; +} diff --git a/pkgs/custom-hello.nix b/pkgs/custom-hello.nix new file mode 100644 index 0000000..9dbd4df --- /dev/null +++ b/pkgs/custom-hello.nix @@ -0,0 +1,26 @@ +{ + lib, + stdenv, + runtimeShell, +}: +stdenv.mkDerivation { + pname = "hello"; + version = "1.0"; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out/bin + cat > $out/bin/hello << EOF + #!${runtimeShell} + echo "Hello, This is an example nix package!" + EOF + chmod +x $out/bin/hello + ''; + + meta = { + description = "Example package"; + license = lib.licenses.free; + mainProgram = "hello"; + }; +} diff --git a/pkgs/custom-neovim/.direnv/bin/nix-direnv-reload b/pkgs/custom-neovim/.direnv/bin/nix-direnv-reload new file mode 100755 index 0000000..8ee81ba --- /dev/null +++ b/pkgs/custom-neovim/.direnv/bin/nix-direnv-reload @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e +if [[ ! -d "/home/culsans/Sync/setup/pkgs/custom-neovim" ]]; then + echo "Cannot find source directory; Did you move it?" + echo "(Looking for "/home/culsans/Sync/setup/pkgs/custom-neovim")" + echo 'Cannot force reload with this script - use "direnv reload" manually and then try again' + exit 1 +fi + +# rebuild the cache forcefully +_nix_direnv_force_reload=1 direnv exec "/home/culsans/Sync/setup/pkgs/custom-neovim" true + +# Update the mtime for .envrc. +# This will cause direnv to reload again - but without re-building. +touch "/home/culsans/Sync/setup/pkgs/custom-neovim/.envrc" + +# Also update the timestamp of whatever profile_rc we have. +# This makes sure that we know we are up to date. +touch -r "/home/culsans/Sync/setup/pkgs/custom-neovim/.envrc" "/home/culsans/Sync/setup/pkgs/custom-neovim/.direnv"/*.rc diff --git a/pkgs/custom-neovim/.direnv/flake-inputs/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source b/pkgs/custom-neovim/.direnv/flake-inputs/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source new file mode 120000 index 0000000..f7fce9f --- /dev/null +++ b/pkgs/custom-neovim/.direnv/flake-inputs/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source @@ -0,0 +1 @@ +/nix/store/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source \ No newline at end of file diff --git a/pkgs/custom-neovim/.direnv/flake-inputs/12rkh25dglxx42bkk3b4drahn482xsn5-source b/pkgs/custom-neovim/.direnv/flake-inputs/12rkh25dglxx42bkk3b4drahn482xsn5-source new file mode 120000 index 0000000..792f2c3 --- /dev/null +++ b/pkgs/custom-neovim/.direnv/flake-inputs/12rkh25dglxx42bkk3b4drahn482xsn5-source @@ -0,0 +1 @@ +/nix/store/12rkh25dglxx42bkk3b4drahn482xsn5-source \ No newline at end of file diff --git a/pkgs/custom-neovim/.direnv/flake-inputs/9cdyyswz19r66knbyscl7l42k69vhbib-source b/pkgs/custom-neovim/.direnv/flake-inputs/9cdyyswz19r66knbyscl7l42k69vhbib-source new file mode 120000 index 0000000..4cbfd5d --- /dev/null +++ b/pkgs/custom-neovim/.direnv/flake-inputs/9cdyyswz19r66knbyscl7l42k69vhbib-source @@ -0,0 +1 @@ +/nix/store/9cdyyswz19r66knbyscl7l42k69vhbib-source \ No newline at end of file diff --git a/pkgs/custom-neovim/.direnv/flake-inputs/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source b/pkgs/custom-neovim/.direnv/flake-inputs/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source new file mode 120000 index 0000000..f17959f --- /dev/null +++ b/pkgs/custom-neovim/.direnv/flake-inputs/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source @@ -0,0 +1 @@ +/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source \ No newline at end of file diff --git a/pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa b/pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa new file mode 120000 index 0000000..3a6293d --- /dev/null +++ b/pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa @@ -0,0 +1 @@ +/nix/store/b6qzhjr42h580y2g5vx68pcrbf1ch3p5-nix-shell-env \ No newline at end of file diff --git a/pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc b/pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc new file mode 100644 index 0000000..848f071 --- /dev/null +++ b/pkgs/custom-neovim/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc @@ -0,0 +1,2089 @@ +unset shellHook +PATH=${PATH:-} +nix_saved_PATH="$PATH" +XDG_DATA_DIRS=${XDG_DATA_DIRS:-} +nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" +AR='ar' +export AR +AS='as' +export AS +BASH='/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/bash' +CC='gcc' +export CC +CONFIG_SHELL='/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/bash' +export CONFIG_SHELL +CXX='g++' +export CXX +HOSTTYPE='x86_64' +HOST_PATH='/nix/store/87fck6hm17chxjq7badb11mq036zbyv9-coreutils-9.7/bin:/nix/store/7y59hzi3svdj1xjddjn2k7km96pifcyl-findutils-4.10.0/bin:/nix/store/7h0sard22wnbz0jyz07w8y9y0fcs795r-diffutils-3.12/bin:/nix/store/clbb2cvigynr235ab5zgi18dyavznlk2-gnused-4.9/bin:/nix/store/gqmr3gixlddz3667ba1iyqck3c0dkpvd-gnugrep-3.11/bin:/nix/store/fcyn0dqszgfysiasdmkv1jh3syncajay-gawk-5.3.2/bin:/nix/store/wrxvqj822kz8746608lgns7h8mkpn79f-gnutar-1.35/bin:/nix/store/afhkqb5a94zlwjxigsnwsfwkf38h21dk-gzip-1.14/bin:/nix/store/1abbyfv3bpxalfjfgpmwg8jcy931bf76-bzip2-1.0.8-bin/bin:/nix/store/kv10h4pidkmx8cjs2sw2pi9rlcnighbc-gnumake-4.4.1/bin:/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin:/nix/store/x0kaspzb5jqvgp357bj27z6iq24ximfg-patch-2.7.6/bin:/nix/store/98zamhd8d0jq3skqwz28dlgph94mrqir-xz-5.8.1-bin/bin:/nix/store/imhzyxqr7swq08ip81az5kfa07r07kg0-file-5.46/bin' +export HOST_PATH +IFS=' +' +IN_NIX_SHELL='impure' +export IN_NIX_SHELL +LD='ld' +export LD +LINENO='76' +MACHTYPE='x86_64-pc-linux-gnu' +NIX_BINTOOLS='/nix/store/hhfm5fkvb1alg1np5a69m2qlcjqhr062-binutils-wrapper-2.44' +export NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES='12' +export NIX_BUILD_CORES +NIX_CC='/nix/store/0fsnicvfpf55nkza12cjnad0w84d6ba7-gcc-wrapper-14.2.1.20250322' +export NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE=' -frandom-seed=b6qzhjr42h' +export NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE='1' +export NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE='bindnow format fortify fortify3 pic relro stackclashprotection stackprotector strictoverflow zerocallusedregs' +export NIX_HARDENING_ENABLE +NIX_LDFLAGS='-rpath /home/culsans/Sync/setup/pkgs/custom-neovim/outputs/out/lib ' +export NIX_LDFLAGS +NIX_NO_SELF_RPATH='1' +NIX_STORE='/nix/store' +export NIX_STORE +NM='nm' +export NM +OBJCOPY='objcopy' +export OBJCOPY +OBJDUMP='objdump' +export OBJDUMP +OLDPWD='' +export OLDPWD +OPTERR='1' +OSTYPE='linux-gnu' +PATH='/nix/store/29mhfr5g4dsv07d80b7n4bgs45syk3wl-hello-2.12.2/bin:/nix/store/2jc1jmzis19adawjwhl8qhdvh7vlbk0q-patchelf-0.15.0/bin:/nix/store/0fsnicvfpf55nkza12cjnad0w84d6ba7-gcc-wrapper-14.2.1.20250322/bin:/nix/store/9ds850ifd4jwcccpp3v14818kk74ldf2-gcc-14.2.1.20250322/bin:/nix/store/303islqk386z1w2g1ngvxnkl4glfpgrs-glibc-2.40-66-bin/bin:/nix/store/87fck6hm17chxjq7badb11mq036zbyv9-coreutils-9.7/bin:/nix/store/hhfm5fkvb1alg1np5a69m2qlcjqhr062-binutils-wrapper-2.44/bin:/nix/store/v63bxfiacw082c7ijshf60alvvrpfxsq-binutils-2.44/bin:/nix/store/87fck6hm17chxjq7badb11mq036zbyv9-coreutils-9.7/bin:/nix/store/7y59hzi3svdj1xjddjn2k7km96pifcyl-findutils-4.10.0/bin:/nix/store/7h0sard22wnbz0jyz07w8y9y0fcs795r-diffutils-3.12/bin:/nix/store/clbb2cvigynr235ab5zgi18dyavznlk2-gnused-4.9/bin:/nix/store/gqmr3gixlddz3667ba1iyqck3c0dkpvd-gnugrep-3.11/bin:/nix/store/fcyn0dqszgfysiasdmkv1jh3syncajay-gawk-5.3.2/bin:/nix/store/wrxvqj822kz8746608lgns7h8mkpn79f-gnutar-1.35/bin:/nix/store/afhkqb5a94zlwjxigsnwsfwkf38h21dk-gzip-1.14/bin:/nix/store/1abbyfv3bpxalfjfgpmwg8jcy931bf76-bzip2-1.0.8-bin/bin:/nix/store/kv10h4pidkmx8cjs2sw2pi9rlcnighbc-gnumake-4.4.1/bin:/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin:/nix/store/x0kaspzb5jqvgp357bj27z6iq24ximfg-patch-2.7.6/bin:/nix/store/98zamhd8d0jq3skqwz28dlgph94mrqir-xz-5.8.1-bin/bin:/nix/store/imhzyxqr7swq08ip81az5kfa07r07kg0-file-5.46/bin' +export PATH +PS4='+ ' +RANLIB='ranlib' +export RANLIB +READELF='readelf' +export READELF +SHELL='/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/bash' +export SHELL +SIZE='size' +export SIZE +SOURCE_DATE_EPOCH='315532800' +export SOURCE_DATE_EPOCH +STRINGS='strings' +export STRINGS +STRIP='strip' +export STRIP +XDG_DATA_DIRS='/nix/store/29mhfr5g4dsv07d80b7n4bgs45syk3wl-hello-2.12.2/share:/nix/store/2jc1jmzis19adawjwhl8qhdvh7vlbk0q-patchelf-0.15.0/share' +export XDG_DATA_DIRS +__structuredAttrs='' +export __structuredAttrs +_substituteStream_has_warned_replace_deprecation='false' +buildInputs='' +export buildInputs +buildPhase='{ echo "------------------------------------------------------------"; + echo " WARNING: the existence of this path is not guaranteed."; + echo " It is an internal implementation detail for pkgs.mkShell."; + echo "------------------------------------------------------------"; + echo; + # Record all build inputs as runtime dependencies + export; +} >> "$out" +' +export buildPhase +builder='/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/bash' +export builder +cmakeFlags='' +export cmakeFlags +configureFlags='' +export configureFlags +defaultBuildInputs='' +defaultNativeBuildInputs='/nix/store/2jc1jmzis19adawjwhl8qhdvh7vlbk0q-patchelf-0.15.0 /nix/store/lmc7x75jvrca79fc2r2j1frmklzvh04h-update-autotools-gnu-config-scripts-hook /nix/store/jjhw2phnaip4kg0qjas3x3fsaifi8y0w-no-broken-symlinks.sh /nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh /nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/hxv896faph0rqxjq2ycxpcrbnngc95sz-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/0fsnicvfpf55nkza12cjnad0w84d6ba7-gcc-wrapper-14.2.1.20250322' +depsBuildBuild='' +export depsBuildBuild +depsBuildBuildPropagated='' +export depsBuildBuildPropagated +depsBuildTarget='' +export depsBuildTarget +depsBuildTargetPropagated='' +export depsBuildTargetPropagated +depsHostHost='' +export depsHostHost +depsHostHostPropagated='' +export depsHostHostPropagated +depsTargetTarget='' +export depsTargetTarget +depsTargetTargetPropagated='' +export depsTargetTargetPropagated +doCheck='' +export doCheck +doInstallCheck='' +export doInstallCheck +dontAddDisableDepTrack='1' +export dontAddDisableDepTrack +declare -a envBuildBuildHooks=() +declare -a envBuildHostHooks=() +declare -a envBuildTargetHooks=() +declare -a envHostHostHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +declare -a envHostTargetHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +declare -a envTargetTargetHooks=() +declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) +guess='12' +initialPath='/nix/store/87fck6hm17chxjq7badb11mq036zbyv9-coreutils-9.7 /nix/store/7y59hzi3svdj1xjddjn2k7km96pifcyl-findutils-4.10.0 /nix/store/7h0sard22wnbz0jyz07w8y9y0fcs795r-diffutils-3.12 /nix/store/clbb2cvigynr235ab5zgi18dyavznlk2-gnused-4.9 /nix/store/gqmr3gixlddz3667ba1iyqck3c0dkpvd-gnugrep-3.11 /nix/store/fcyn0dqszgfysiasdmkv1jh3syncajay-gawk-5.3.2 /nix/store/wrxvqj822kz8746608lgns7h8mkpn79f-gnutar-1.35 /nix/store/afhkqb5a94zlwjxigsnwsfwkf38h21dk-gzip-1.14 /nix/store/1abbyfv3bpxalfjfgpmwg8jcy931bf76-bzip2-1.0.8-bin /nix/store/kv10h4pidkmx8cjs2sw2pi9rlcnighbc-gnumake-4.4.1 /nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37 /nix/store/x0kaspzb5jqvgp357bj27z6iq24ximfg-patch-2.7.6 /nix/store/98zamhd8d0jq3skqwz28dlgph94mrqir-xz-5.8.1-bin /nix/store/imhzyxqr7swq08ip81az5kfa07r07kg0-file-5.46' +mesonFlags='' +export mesonFlags +name='nix-shell-env' +export name +nativeBuildInputs='/nix/store/29mhfr5g4dsv07d80b7n4bgs45syk3wl-hello-2.12.2' +export nativeBuildInputs +out='/home/culsans/Sync/setup/pkgs/custom-neovim/outputs/out' +export out +outputBin='out' +outputDev='out' +outputDevdoc='REMOVE' +outputDevman='out' +outputDoc='out' +outputInclude='out' +outputInfo='out' +outputLib='out' +outputMan='out' +outputs='out' +export outputs +patches='' +export patches +phases='buildPhase' +export phases +pkg='/nix/store/0fsnicvfpf55nkza12cjnad0w84d6ba7-gcc-wrapper-14.2.1.20250322' +declare -a pkgsBuildBuild=() +declare -a pkgsBuildHost=('/nix/store/29mhfr5g4dsv07d80b7n4bgs45syk3wl-hello-2.12.2' '/nix/store/2jc1jmzis19adawjwhl8qhdvh7vlbk0q-patchelf-0.15.0' '/nix/store/lmc7x75jvrca79fc2r2j1frmklzvh04h-update-autotools-gnu-config-scripts-hook' '/nix/store/jjhw2phnaip4kg0qjas3x3fsaifi8y0w-no-broken-symlinks.sh' '/nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh' '/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh' '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/hxv896faph0rqxjq2ycxpcrbnngc95sz-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/0fsnicvfpf55nkza12cjnad0w84d6ba7-gcc-wrapper-14.2.1.20250322' '/nix/store/hhfm5fkvb1alg1np5a69m2qlcjqhr062-binutils-wrapper-2.44' ) +declare -a pkgsBuildTarget=() +declare -a pkgsHostHost=() +declare -a pkgsHostTarget=() +declare -a pkgsTargetTarget=() +declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelativeInAllOutputs' '_multioutPropagateDev' ) +declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) +declare -a preConfigureHooks=('_multioutConfig' ) +preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' +declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) +preferLocalBuild='1' +export preferLocalBuild +prefix='/home/culsans/Sync/setup/pkgs/custom-neovim/outputs/out' +declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) +propagatedBuildInputs='' +export propagatedBuildInputs +declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) +propagatedNativeBuildInputs='' +export propagatedNativeBuildInputs +declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) +shell='/nix/store/xy4jjgw87sbgwylm5kn047d9gkbhsr9x-bash-5.2p37/bin/bash' +export shell +shellHook='' +export shellHook +stdenv='/nix/store/nivcx63drxqzm6pic6vm2wbkxl368w83-stdenv-linux' +export stdenv +strictDeps='' +export strictDeps +system='x86_64-linux' +export system +declare -a unpackCmdHooks=('_defaultUnpack' ) +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=mode,timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +_makeSymlinksRelative () +{ + + local symlinkTarget; + if [ "${dontRewriteSymlinks-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + while IFS= read -r -d '' f; do + symlinkTarget=$(readlink "$f"); + if [[ "$symlinkTarget"/ != "$prefix"/* ]]; then + continue; + fi; + if [ ! -e "$symlinkTarget" ]; then + echo "the symlink $f is broken, it points to $symlinkTarget (which is missing)"; + fi; + echo "rewriting symlink $f to be relative to $prefix"; + ln -snrf "$symlinkTarget" "$f"; + done < <(find $prefix -type l -print0) +} +_makeSymlinksRelativeInAllOutputs () +{ + + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" _makeSymlinksRelative; + done +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local i; + find "$dir" -type f -print0 | while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if isELF "$i"; then + if { + printf :; + patchelf --print-rpath "$i" + } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/"; + exit 1; + fi; + fi; + if isScript "$i"; then + if [ -e "$(dirname "$i")/.$(basename "$i")-wrapped" ]; then + if grep -q -F "$TMPDIR/" "$i"; then + echo "wrapper script $i contains a forbidden reference to $TMPDIR/"; + exit 1; + fi; + fi; + fi; + done +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + fi +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | while IFS= read -r -d '' f; do + if gzip -c -n "$f" > "$f".gz; then + rm "$f"; + else + rm "$f".gz; + fi; + done; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + prependToVar configureFlags "${prefixKey:---prefix=}$prefix"; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +dumpVars () +{ + + if [ "${noDumpEnvVars:-0}" != 1 ]; then + { + install -m 0600 /dev/null "$NIX_BUILD_TOP/env-vars" && export 2> /dev/null >| "$NIX_BUILD_TOP/env-vars" + } || true; + fi +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +genericBuild () +{ + + export GZIP_NO_TIMESTAMPS=1; + if [ -f "${buildCommandPath:-}" ]; then + source "$buildCommandPath"; + return; + fi; + if [ -n "${buildCommand:-}" ]; then + eval "$buildCommand"; + return; + fi; + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi; + for curPhase in ${phases[*]}; + do + runPhase "$curPhase"; + done +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +getHostRole () +{ + + getRole "$hostOffset" +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +getTargetRole () +{ + + getRole "$targetOffset" +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +moveToOutput () +{ + + local patt="$1"; + local dstOut="$2"; + local output; + for output in $(getAllOutputNames); + do + if [ "${!output}" = "$dstOut" ]; then + continue; + fi; + local srcPath; + for srcPath in "${!output}"/$patt; + do + if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then + continue; + fi; + if [ "$dstOut" = REMOVE ]; then + echo "Removing $srcPath"; + rm -r "$srcPath"; + else + local dstPath="$dstOut${srcPath#${!output}}"; + echo "Moving $srcPath to $dstPath"; + if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then + rmdir "$srcPath" --ignore-fail-on-non-empty; + if [ -d "$srcPath" ]; then + mv -t "$dstPath" "$srcPath"/*; + rmdir "$srcPath"; + fi; + else + mkdir -p "$(readlink -m "$dstPath/..")"; + mv "$srcPath" "$dstPath"; + fi; + fi; + local srcParent="$(readlink -m "$srcPath/..")"; + if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/rzdjxxf4jkv3qdsjxkg54fxbma5zr05k-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" +export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)" +export TMP="$NIX_BUILD_TOP" +export TMPDIR="$NIX_BUILD_TOP" +export TEMP="$NIX_BUILD_TOP" +export TEMPDIR="$NIX_BUILD_TOP" +eval "${shellHook:-}" diff --git a/pkgs/custom-neovim/.envrc b/pkgs/custom-neovim/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/pkgs/custom-neovim/.envrc @@ -0,0 +1 @@ +use flake diff --git a/pkgs/custom-neovim/flake.lock b/pkgs/custom-neovim/flake.lock new file mode 100644 index 0000000..4ad3238 --- /dev/null +++ b/pkgs/custom-neovim/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1749401433, + "narHash": "sha256-HXIQzULIG/MEUW2Q/Ss47oE3QrjxvpUX7gUl4Xp6lnc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "08fcb0dcb59df0344652b38ea6326a2d8271baff", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/pkgs/custom-neovim/flake.nix b/pkgs/custom-neovim/flake.nix new file mode 100644 index 0000000..4bab14a --- /dev/null +++ b/pkgs/custom-neovim/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Project flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + systems.url = "github:nix-systems/default"; + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + }; + + outputs = { + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + hello + ]; + }; + } + ); +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..da0ee49 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,9 @@ +{ + pkgs, + inputs, + ... +}: { + custom-hello = pkgs.callPackage ./custom-hello.nix {}; + custom-neovim = pkgs.callPackage ./custom-neovim {inherit inputs;}; + setup-manager = pkgs.callPackage ./setup-manager {}; +} diff --git a/pkgs/old-neovim/config/init.lua b/pkgs/old-neovim/config/init.lua new file mode 100644 index 0000000..f77e9f8 --- /dev/null +++ b/pkgs/old-neovim/config/init.lua @@ -0,0 +1,24 @@ +-- Require extra config files +require('options') +require('mappings') +-- require('autocommands') + +-- Require plugins +require('plugins.mini-deps') + +require('plugins.mini-clue') +require('plugins.mini-comment') +require('plugins.mini-icons') +require('plugins.mini-notify') +require('plugins.mini-pick') +require('plugins.mini-sessions') +require('plugins.mini-starter') +require('plugins.mini-statusline') +require('plugins.mini-completion') +require('plugins.mini-snippets') + +require('plugins.tabby') +require('plugins.actions-preview') +require('plugins.lspconfig') + +require('plugins.presence') diff --git a/pkgs/old-neovim/config/lua/autocommands.lua b/pkgs/old-neovim/config/lua/autocommands.lua new file mode 100644 index 0000000..85a58c6 --- /dev/null +++ b/pkgs/old-neovim/config/lua/autocommands.lua @@ -0,0 +1,36 @@ +-- Autocommands + +-- Use relative line number in normal mode and absolute in insert mode +vim.opt.number = true +local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", {}) +vim.api.nvim_create_autocmd( + { "BufEnter", "FocusGained", "InsertLeave", "WinEnter", "CmdlineLeave" }, + { + group = numbertoggle, + callback = function() + if vim.opt.number and vim.api.nvim_get_mode() ~= "i" then + vim.opt.relativenumber = true + end + end, + } +) + +vim.api.nvim_create_autocmd( + { "BufLeave", "FocusLost", "InsertEnter", "WinLeave", "CmdlineEnter" }, + { + group = numbertoggle, + callback = function() + if vim.opt.number then + vim.opt.relativenumber = false + vim.cmd("redraw") + end + end, + } +) + + -- start terminal in insert mode +vim.api.nvim_create_autocmd("TermOpen", { + callback = function() + vim.cmd "startinsert!" + end, +}) diff --git a/pkgs/old-neovim/config/lua/mappings.lua b/pkgs/old-neovim/config/lua/mappings.lua new file mode 100644 index 0000000..e957d53 --- /dev/null +++ b/pkgs/old-neovim/config/lua/mappings.lua @@ -0,0 +1,29 @@ +-- Keymap function. +local keymap = function(mode, key, desc, action) + vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) +end + +-- Map the leader key. +vim.g.mapleader = ' ' + +vim.keymap.set("n", "", "gcc", {noremap = true, silent = true}) + +-- Pickers +keymap("n", "f", "Open file picker", ":Pick files") +keymap("n", "c", "Open recent file picker", ":Pick oldfiles") +keymap("n", "e", "Open file explorer", ":Pick explorer") +keymap("n", "b", "Open buffer picker", ":Pick buffers") +keymap("n", "/", "Open live grep picker", ":Pick grep_live") +keymap("n", "\\", "Open command palette", ":Pick commands") +keymap("n", "?", "Open help picker", ":Pick help") +keymap("n", "'", "Open last picker", ":Pick resume") + +-- Tabs +keymap("n", "t", "Manage tabs", "") +keymap("n", "tt", "Open new tab", ":tabnew") +keymap("n", "tq", "Close tab", ":tabclose") +keymap("n", "tn", "Go to next tab", ":tabnext") +keymap("n", "tp", "Go to previous tab", ":tabprev") + +-- QOL Keys +keymap("t", "", "Exit terminal insert mode", "") diff --git a/pkgs/old-neovim/config/lua/options.lua b/pkgs/old-neovim/config/lua/options.lua new file mode 100644 index 0000000..c67dcc2 --- /dev/null +++ b/pkgs/old-neovim/config/lua/options.lua @@ -0,0 +1,70 @@ +-- General Settings +vim.o.winborder = 'rounded' +vim.o.showmode = false +vim.o.icm = 'split' +vim.o.cia = 'abbr,kind,menu' +vim.o.mouse = "" -- allow the mouse to be used in neovim +vim.o.number = true -- set numbered lines +vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor +vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time +vim.o.splitbelow = true -- open new split below +vim.o.splitright = true -- open new split to the right +vim.o.wrap = true -- display a wrapped line +vim.o.clipboard = "unnamedplus" -- use system clipboard +vim.o.sessionoptions = 'curdir,folds,globals,help,tabpages,terminal,winsize' -- Things to save with the session. +vim.keymap.set("c", "", function() + if vim.fn.pumvisible() == 1 then return '' end + return '' +end, { expr = true }) -- Make enter complete command. + +-- Indention +local indent = 2 +vim.o.autoindent = true -- auto indentation +vim.o.expandtab = true -- convert tabs to spaces +vim.o.shiftwidth = indent -- the number of spaces inserted for each indentation +vim.o.smartindent = true -- make indenting smarter +vim.o.softtabstop = indent -- when hitting , pretend like a tab is removed, even if spaces +vim.o.tabstop = indent -- insert 2 spaces for a tab +vim.o.shiftround = true -- use multiple of shiftwidth when indenting with "<" and ">" + +-- Backups +vim.o.backup = false -- create a backup file +vim.o.swapfile = false -- creates a swapfile +vim.o.writebackup = false -- if a file is being edited by another program, it is not allowed to be edited + +-- Search +vim.o.hlsearch = true -- highlight all matches on previous search pattern +vim.o.ignorecase = true -- ignore case in search patterns +vim.o.smartcase = true -- smart case + +-- Folding +vim.o.foldmethod = "expr" +vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" -- Set folder to treesitter. +vim.o.foldlevel = 99 -- Don't fold initially. +vim.o.foldnestmax = 4 -- Don't fold if more than 4 folds deep. +vim.o.foldtext = "" -- Color text in folds. + +-- Set Colorscheme +vim.cmd.colorscheme("oxocarbon") +vim.o.termguicolors = true + +-- Neovide +if vim.g.neovide then + vim.o.guifont = "CodeNewRoman Nerd Font:h12" + vim.g.neovide_scale_factor = 0.8 + + -- Zoom keymaps. + local change_scale_factor = function(delta) + vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta + end + vim.keymap.set("n", "", function() + change_scale_factor(1.1) + end) + vim.keymap.set("n", "", function() + change_scale_factor(1/1.1) + end) + + -- Standard terminal emulator keymaps. + vim.api.nvim_set_keymap("c", "", "+", { noremap = true }) -- Paste in command mode. + vim.api.nvim_set_keymap('t', '', '"+Pi', {noremap = true}) -- Paste in terminal mode. +end diff --git a/pkgs/old-neovim/config/lua/plugins/actions-preview.lua b/pkgs/old-neovim/config/lua/plugins/actions-preview.lua new file mode 100644 index 0000000..9f3976b --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/actions-preview.lua @@ -0,0 +1 @@ +require('actions-preview').setup() diff --git a/pkgs/old-neovim/config/lua/plugins/lspconfig.lua b/pkgs/old-neovim/config/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..98b34f2 --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/lspconfig.lua @@ -0,0 +1,91 @@ +-- vim.keymap.set('n', 'd', vim.diagnostic.setloclist, {desc = "Add buffer diagnostics to the location list."}) + +-- Disable semantic tokens to stop weird highlighting. +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client then + client.server_capabilities.semanticTokensProvider = nil + end + end +}) + +-- Use LspAttach autocommand to only map the following keys +-- after the language server attaches to the current buffer +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + -- Enable completion triggered by + vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + + local keymap = function(mode, key, desc, action) + vim.keymap.set(mode, key, action, {noremap = true, silent = true, desc = desc}) + end + + keymap('n', 'gD', "Go to declaration", vim.lsp.buf.declaration) + keymap('n', 'gd', "Go to definition", vim.lsp.buf.definition) + keymap('n', 'gy', "Go to type definition", vim.lsp.buf.type_definition) + keymap('n', 'gi', "Go to implementation", vim.lsp.buf.implementation) + keymap('n', '', "Signature Help", vim.lsp.buf.signature_help) + keymap('i', '', "Signature Help", vim.lsp.buf.signature_help) + keymap('n', "o", "Manage LSP workspace", "") + keymap('n', 'oa', "Add Workspace Folder", vim.lsp.buf.add_workspace_folder) + keymap('n', 'or', "Remove Workspace Folder", vim.lsp.buf.remove_workspace_folder) + keymap('n', 'ol', "List Workspace Folders", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end) + keymap('n', 'r', "Rename Symbol", vim.lsp.buf.rename) + keymap("n", "s", "Open symbol picker", [[:Pick lsp scope="document_symbol"]]) + keymap("n", "S", "Open workspace symbol picker", [[:Pick lsp scope="workspace_symbol"]]) + + -- LSP Pickers + keymap({'n', 'v'}, "a", "Perform code action", require("actions-preview").code_actions) + keymap("n", "D", "Open workspace diagnostic picker", ":Pick diagnostic") + keymap("n", "d", "Open diagnostic picker", [[:Pick diagnostic scope="current"]]) + + keymap('n', 'gr', "Buffer References", vim.lsp.buf.references) + keymap('n', 'f', "Format Buffer", function() + vim.lsp.buf.format { async = true } + end) + end, +}) + +local lspconfig = require('lspconfig') + +-- Configure individual lsps +lspconfig.nil_ls.setup {} +lspconfig.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + return + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + -- Depending on the usage, you might want to add additional paths here. + "${3rd}/luv/library" + -- "${3rd}/busted/library", + } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + }) + end, + settings = { + Lua = {} + } +} +lspconfig.marksman.setup {} diff --git a/pkgs/old-neovim/config/lua/plugins/mini-clue.lua b/pkgs/old-neovim/config/lua/plugins/mini-clue.lua new file mode 100644 index 0000000..dbfba5e --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-clue.lua @@ -0,0 +1,51 @@ +local miniclue = require('mini.clue') +miniclue.setup({ + window = { + delay = 0, + config = { + width = 'auto', + -- border = 'double', + }, + }, + triggers = { + -- Leader triggers + { mode = 'n', keys = '' }, + { mode = 'x', keys = '' }, + + -- Built-in completion + { mode = 'i', keys = '' }, + + -- `g` key + { mode = 'n', keys = 'g' }, + { mode = 'x', keys = 'g' }, + + -- Marks + { mode = 'n', keys = "'" }, + { mode = 'n', keys = '`' }, + { mode = 'x', keys = "'" }, + { mode = 'x', keys = '`' }, + + -- Registers + { mode = 'n', keys = '"' }, + { mode = 'x', keys = '"' }, + { mode = 'i', keys = '' }, + { mode = 'c', keys = '' }, + + -- Window commands + { mode = 'n', keys = '' }, + + -- `z` key + { mode = 'n', keys = 'z' }, + { mode = 'x', keys = 'z' }, + }, + + clues = { + -- Enhance this by adding descriptions for mapping groups + miniclue.gen_clues.builtin_completion(), + miniclue.gen_clues.g(), + miniclue.gen_clues.marks(), + miniclue.gen_clues.registers(), + miniclue.gen_clues.windows(), + miniclue.gen_clues.z(), + }, +}) diff --git a/pkgs/old-neovim/config/lua/plugins/mini-comment.lua b/pkgs/old-neovim/config/lua/plugins/mini-comment.lua new file mode 100644 index 0000000..1a2a369 --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-comment.lua @@ -0,0 +1 @@ +require("mini.comment").setup() diff --git a/pkgs/old-neovim/config/lua/plugins/mini-completion.lua b/pkgs/old-neovim/config/lua/plugins/mini-completion.lua new file mode 100644 index 0000000..ebfd62b --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-completion.lua @@ -0,0 +1 @@ +require('mini.completion').setup() diff --git a/pkgs/old-neovim/config/lua/plugins/mini-deps.lua b/pkgs/old-neovim/config/lua/plugins/mini-deps.lua new file mode 100644 index 0000000..1109d59 --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-deps.lua @@ -0,0 +1,8 @@ +if (mnw ~= nil) then + require("mini.deps").setup() +end +AddPlugin = function(plugin) + if (mnw ~= nil) then + MiniDeps.add(plugin) + end +end diff --git a/pkgs/old-neovim/config/lua/plugins/mini-icons.lua b/pkgs/old-neovim/config/lua/plugins/mini-icons.lua new file mode 100644 index 0000000..3c5a927 --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-icons.lua @@ -0,0 +1 @@ +require('mini.icons').setup() diff --git a/pkgs/old-neovim/config/lua/plugins/mini-notify.lua b/pkgs/old-neovim/config/lua/plugins/mini-notify.lua new file mode 100644 index 0000000..cd516af --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-notify.lua @@ -0,0 +1 @@ +require('mini.notify').setup() diff --git a/pkgs/old-neovim/config/lua/plugins/mini-pick.lua b/pkgs/old-neovim/config/lua/plugins/mini-pick.lua new file mode 100644 index 0000000..de6c7ec --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-pick.lua @@ -0,0 +1,24 @@ +local win_config = function() + local height = math.floor(0.5 * vim.o.lines) + local width = math.floor(0.618 * vim.o.columns) + return { + anchor = 'NW', height = height, width = width, + row = math.floor(0.5 * (vim.o.lines - height)), + col = math.floor(0.5 * (vim.o.columns - width)), + } +end + +require('mini.pick').setup({ + options = { + content_from_bottom = true, + use_cache = true, + }, + window = { + config = win_config, + }, + -- delay = { + -- async = 1, + -- busy = 1, + -- }, +}) +require('mini.extra').setup() diff --git a/pkgs/old-neovim/config/lua/plugins/mini-sessions.lua b/pkgs/old-neovim/config/lua/plugins/mini-sessions.lua new file mode 100644 index 0000000..fe1a843 --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-sessions.lua @@ -0,0 +1,31 @@ +require('mini.sessions').setup() +local save_session = function() + vim.ui.input({ prompt = "Session to save: " }, function(input) + if (input == nil) then + return + end + MiniSessions.write(input) + vim.cmd("echon ' '") + print("Session created: " .. input) + if vim.bo.filetype == 'ministarter' then + MiniStarter.refresh() + end + end) +end +local delete_session = function() + vim.ui.input({ prompt = "Session to delete: " }, function(input) + if (input == nil) then + return + end + MiniSessions.delete(input) + vim.cmd("echon ' '") + print("Session deleted: " .. input) + if vim.bo.filetype == 'ministarter' then + MiniStarter.refresh() + end + end) +end +vim.keymap.set("n", "w", "", {desc = "Manage sessions"}) +vim.keymap.set("n", "ww", save_session, {desc = "Save the session"}) +vim.keymap.set("n", "wd", delete_session, {desc = "Delete a session"}) +vim.keymap.set("n", "wo", MiniSessions.select, {desc = "Open a session"}) diff --git a/pkgs/old-neovim/config/lua/plugins/mini-snippets.lua b/pkgs/old-neovim/config/lua/plugins/mini-snippets.lua new file mode 100644 index 0000000..3a991eb --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-snippets.lua @@ -0,0 +1,10 @@ +local gen_loader = require('mini.snippets').gen_loader +require('mini.snippets').setup({ + snippets = { + -- gen_loader.from_file('~/.config/nvim/snippets/global.json'), + + -- Load snippets based on current language by reading files from + -- "snippets/" subdirectories from 'runtimepath' directories. + gen_loader.from_lang(), + }, +}) diff --git a/pkgs/old-neovim/config/lua/plugins/mini-starter.lua b/pkgs/old-neovim/config/lua/plugins/mini-starter.lua new file mode 100644 index 0000000..b39e7f1 --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-starter.lua @@ -0,0 +1,17 @@ +local starter = require('mini.starter') +starter.setup({ + evaluate_single = true, + header = "", + footer = "", + items = { + starter.sections.builtin_actions(), + starter.sections.sessions(5, true), + starter.sections.recent_files(5, true), + }, + content_hooks = { + starter.gen_hook.adding_bullet(), + starter.gen_hook.indexing('all', { 'Builtin actions' }), + starter.gen_hook.padding(3, 2), + starter.gen_hook.aligning('center', 'center'), + }, +}) diff --git a/pkgs/old-neovim/config/lua/plugins/mini-statusline.lua b/pkgs/old-neovim/config/lua/plugins/mini-statusline.lua new file mode 100644 index 0000000..4bdfd80 --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/mini-statusline.lua @@ -0,0 +1 @@ +require('mini.statusline').setup() diff --git a/pkgs/old-neovim/config/lua/plugins/presence.lua b/pkgs/old-neovim/config/lua/plugins/presence.lua new file mode 100644 index 0000000..7ffb57f --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/presence.lua @@ -0,0 +1,3 @@ +require('presence').setup({ + neovim_image_text = "Neovim Text Editor", +}) diff --git a/pkgs/old-neovim/config/lua/plugins/tabby.lua b/pkgs/old-neovim/config/lua/plugins/tabby.lua new file mode 100644 index 0000000..2ad03ed --- /dev/null +++ b/pkgs/old-neovim/config/lua/plugins/tabby.lua @@ -0,0 +1,2 @@ +vim.o.showtabline = 1 +require('tabby').setup() diff --git a/pkgs/old-neovim/default.nix b/pkgs/old-neovim/default.nix new file mode 100644 index 0000000..97a23df --- /dev/null +++ b/pkgs/old-neovim/default.nix @@ -0,0 +1,48 @@ +{ + pkgs, + inputs, +}: +inputs.mnw.lib.wrap pkgs { + neovim = pkgs.neovim-unwrapped; + + plugins = with pkgs.vimPlugins; { + dev.config.pure = ./config; + start = [ + # Core Plugins + mini-nvim # Ton of small modules. + nvim-lspconfig # Adds lsp presets. + actions-preview-nvim # Adds a selector for LSP actions. + nvim-treesitter.withAllGrammars # All treesitter grammars. + tabby-nvim # Tab bar. + friendly-snippets # Extra snippets. + lazydev-nvim # Enhances the nvim config editing experience. + + # Colorschemes + oxocarbon-nvim # IBM Carbon themes. + rose-pine # Rose Pine themes. + kanagawa-nvim # Kanagawa themes. + everforest # Green themes. + nordic-nvim # Warm dark nordic theme. + + # Miscellaneous Plugins + presence-nvim # Discord RPC for nvim. + cellular-automaton-nvim # Fun useless plugin. + ]; + opt = []; + }; + + luaFiles = [./config/init.lua]; + + extraBinPath = with pkgs; [ + # LSP Servers + lua-language-server # Lua LS + nil # Nix LS + marksman # Markdown LS + + # Formatters + alejandra # Nix Formatter + + # Extra Tools + ripgrep + ]; +} diff --git a/pkgs/old-neovim/plan.md b/pkgs/old-neovim/plan.md new file mode 100644 index 0000000..ade9664 --- /dev/null +++ b/pkgs/old-neovim/plan.md @@ -0,0 +1,29 @@ +# Neovim Plan + +## Plugins + +### Main Plugins + +- Statusline: mini-statusline +- Tabline: mini-tabline +- Hints: mini-hints +- File Editor: oil.nvim +- Fuzzy Finder: telescope + +### Other Plugins + +- other mini plugins + +## Settings + +- tabstop 2 +- helix-like keybinds + +## Todo + +- add mini git support +- add console clear autocommand +- make alt key turn hjkl into arrow keys +- set keys for scrolling in mini.clue +- configure tabby +- add AI chat diff --git a/pkgs/setup-manager/default.nix b/pkgs/setup-manager/default.nix new file mode 100644 index 0000000..2d0f08c --- /dev/null +++ b/pkgs/setup-manager/default.nix @@ -0,0 +1,17 @@ +{ + pkgs, + lib, +}: let + path = with pkgs; [ + nvd + nix-output-monitor + ]; +in + pkgs.writers.writeNuBin "setup" { + makeWrapperArgs = [ + "--prefix" + "PATH" + ":" + "${lib.makeBinPath path}" + ]; + } (builtins.readFile ./setup.nu) diff --git a/pkgs/setup-manager/setup.nu b/pkgs/setup-manager/setup.nu new file mode 100644 index 0000000..46ab637 --- /dev/null +++ b/pkgs/setup-manager/setup.nu @@ -0,0 +1,55 @@ +# Aims of this program: +# +# Subcommands: +# - sync system {system name?}: rebuild system +# - sync user {home name?}: rebuild home +# - sync all {system @ home name?}: rebuild home and system +# - update: update the flake +# - vm {system name}: create and run a test vm +# - repl: open a nix repl with flake inputs +# - gc {what to remove?}: collect garbage + +# Settings +let flake_dir = "~/Sync/setup/" | path expand + +def "main" [] {} + +# +-------------------------+ +# | Syncronization Commands | +# +-------------------------+ + +# Syncronize the system with its config. +def "main sync system" [ + sys?: string # The name of the system config to syncronize. +] { + if ($sys == null) {let sys = (hostname)} + sudo nixos-rebuild switch --flake $"($flake_dir)#($sys)" +} + +# Syncronize the userland with its config. +def "main sync user" [ + usr?: string # The name of the user config to syncronize. +] {} + +# Syncronize both the system and the userland with their configs. +def "main sync all" [ + usr_sys?: string # The name of the user and system configs to syncronize. In the format "user@system". +] {} + +# +----------------+ +# | Other Commands | +# +----------------+ + +# Update the flake lock file according to its inputs. +def "main update" [] {} + +# Create and run a test VM based on a system config. +def "main vm" [ + sys: string # The system config to base the VM on. +] {} + +# Open a nix REPL including flake inputs. +def "main repl" [] {} + +# Garbage collect the system. +def "main gc" [] {} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..b945571 --- /dev/null +++ b/readme.md @@ -0,0 +1,32 @@ +Welcome to my Nix* setup! + +Iteration: 7? + +This repo contains multi-device configurations for nixos and home-manager, including features like agenix for secret management, a wrapped neovim package with mnw, and more. + +- [Todo List](./docs/todo.md) +- [Directory Organization](./docs/layout.md) +- [Home Server Setup](./docs/home-server.md) + +## Features + +- agenix secret management +- custom desktop setup with the niri compositor +- custom (bad) base16 theme system +- flake boilerplate shortener library +- automatic nix file imports +- multiple users per device +- very organized + +## Devices + +- nzxt-desktop: My custom-built desktop pc in an nzxt case (not actually made by nzxt). +- ideapad-laptop: My cheap lenovo ideapad I use for schoolwork. +- prodesk-server: My home server running on an hp prodesk desktop. +- steam-deck: My steam deck running nixos with jovian-nixos. + +## Credits + +- [The flake boilerplate shortener library](lib/helper.nix) was partially stolen from Vimjoyer, though I have heavily stripped it down and modified it (and probably made it worse). +- [The nix file auto-importation code](lib/umport.nix) was taken from the ylib library and slightly modified to not import flake.nix and shell.nix files. +- Everyone who worked on the stuff in my flake inputs, thanks for the great software! diff --git a/secrets/culsans-user-password.age b/secrets/culsans-user-password.age new file mode 100644 index 0000000..a92fff7 --- /dev/null +++ b/secrets/culsans-user-password.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 WRTnYA qBxysw6Blm5w0eS3pdYWHVKhLUBM9fjqHGdiS2728kA +wOFVVf1Z4vtMeY7VWPGDK2fE401S06lUIPkOJ6eW0Lg +-> ssh-ed25519 /proDQ lu5yVBvnJmkgEcOHcf3c+YAYYOngpMend80Gaq+I7hs +SusZnNXGR9Zx40sm4+L/pNrqgkUS8F/17Wl6PR8nuDo +--- DB2RJ7g73LYU1NlLGZk8M3bRUJMBNeCmiwfMLYit+gg + |)ýér]O]PY±èí†Þ´n½æ5? K_»rR¿¢¿àf˜glç“{ßHšr \ No newline at end of file diff --git a/secrets/lucas-user-password.age b/secrets/lucas-user-password.age new file mode 100644 index 0000000..0fb32bd Binary files /dev/null and b/secrets/lucas-user-password.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100755 index 0000000..815b217 --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,16 @@ +let + culsans = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMcc7hXixElOgv87LlY1LgCQ9oOT6Lj66wjCh1uRqpQt culsans@nzxt-desktop"; # culsans@nzxt-desktop + lucas = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICn8CAOpucqQvDkkEOGYYuSf8+mfrA4qkUK5u8v+WLEz lucas@ideapad-laptop"; # lucas@ideapad-laptop + server = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGDHcZoKu7q28H3hf4TzkONZxt+dky/HbMEHuC2uKr5P server@prodesk-server"; # server@ideapad-server + + nzxt-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKtnKVcdZNk3zp/XptQDtBDJig7sMEe5RLRhAO3Sx3sl root@nzxt-desktop"; + ideapad-laptop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP5hHZpHf/0xj4UK5091fBB9tDonfd6FDGkPr+HWlZBc root@ideapad-laptop"; + prodesk-server = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOj6+nSYDABUsNqrSuc/IIhrShez0n5vPKAUTZMoINFl root@prodesk-server"; +in { + "culsans-user-password.age".publicKeys = [ nzxt-desktop culsans ]; + "lucas-user-password.age".publicKeys = [ ideapad-laptop lucas ]; + "server-user-password.age".publicKeys = [ prodesk-server server ]; + + # Namecheap DDNS Password + "namecheap-ddns-password.age".publicKeys = [ culsans lucas server prodesk-server ]; +} diff --git a/systems/ideapad-laptop/hardware.nix b/systems/ideapad-laptop/hardware.nix new file mode 100644 index 0000000..1065266 --- /dev/null +++ b/systems/ideapad-laptop/hardware.nix @@ -0,0 +1,39 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "vmd" "ahci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/dd1662e3-37b4-440b-b3b0-35b625474fb6"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/F073-F061"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/9e96739b-9983-44fe-ab97-9b59e55aa942"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/systems/ideapad-laptop/system.nix b/systems/ideapad-laptop/system.nix new file mode 100644 index 0000000..9067924 --- /dev/null +++ b/systems/ideapad-laptop/system.nix @@ -0,0 +1,66 @@ +{config, ...}: { + imports = [./hardware.nix]; + + general-settings = { + hostname = "ideapad-laptop"; + locale = "en_US.UTF-8"; + timezone = "America/New_York"; + stateVersion = "23.11"; + }; + + age.secrets.lucas-user-password.file = ../../secrets/lucas-user-password.age; + + users.users."lucas" = { + hashedPasswordFile = config.age.secrets.lucas-user-password.path; + isNormalUser = true; + description = "lucas"; + extraGroups = [ + "networkmanager" + "wheel" + "audio" + "video" + "libvirtd" + ]; + }; + + features = { + gui = { + apps = { + steam.enable = true; + # vmware.enable = true; + }; + desktops = { + niri.enable = true; + }; + }; + cli = { + shells.nushell.enable = true; + utils = { + nh = { + enable = true; + flake = "/home/lucas/Sync/setup"; + }; + }; + }; + services = { + core.systemd-boot.enable = true; + hardware = { + bluetooth.enable = true; + iwd.enable = true; + pipewire.enable = true; + }; + extra = { + plymouth.enable = true; + sddm.enable = true; + syncthing-client = { + enable = true; + username = "lucas"; + }; + udisks2.enable = true; + }; + bundles = { + printing.enable = true; + }; + }; + }; +} diff --git a/systems/nzxt-desktop/hardware.nix b/systems/nzxt-desktop/hardware.nix new file mode 100644 index 0000000..cf6f399 --- /dev/null +++ b/systems/nzxt-desktop/hardware.nix @@ -0,0 +1,40 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/e9b15ba0-8bf2-4796-bfe8-abf90ffd51a0"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1C6B-DB4F"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/b231a0d9-6bec-45ab-ac69-e14089e858c4"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp42s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/systems/nzxt-desktop/system.nix b/systems/nzxt-desktop/system.nix new file mode 100644 index 0000000..396eab6 --- /dev/null +++ b/systems/nzxt-desktop/system.nix @@ -0,0 +1,66 @@ +{config, ...}: { + imports = [./hardware.nix]; + + general-settings = { + hostname = "nzxt-desktop"; + locale = "en_US.UTF-8"; + timezone = "America/New_York"; + stateVersion = "23.11"; + }; + + age.secrets.culsans-user-password.file = ../../secrets/culsans-user-password.age; + + users.users."culsans" = { + hashedPasswordFile = config.age.secrets.culsans-user-password.path; + isNormalUser = true; + description = "Culsans"; + extraGroups = [ + "networkmanager" + "wheel" + "audio" + "video" + "libvirtd" + ]; + }; + + features = { + gui = { + apps = { + steam.enable = true; + vmware.enable = false; + }; + desktops = { + niri.enable = true; + }; + }; + cli = { + shells.nushell.enable = true; + utils = { + nh = { + enable = true; + flake = "/home/culsans/Sync/setup"; + }; + }; + }; + services = { + core.systemd-boot.enable = true; + hardware = { + bluetooth.enable = true; + iwd.enable = true; + pipewire.enable = true; + }; + extra = { + plymouth.enable = true; + sddm.enable = true; + syncthing-client = { + enable = true; + username = "culsans"; + }; + udisks2.enable = true; + }; + bundles = { + printing.enable = true; + }; + }; + }; +} diff --git a/systems/prodesk-server/hardware.nix b/systems/prodesk-server/hardware.nix new file mode 100644 index 0000000..e69de29 diff --git a/systems/prodesk-server/system.nix b/systems/prodesk-server/system.nix new file mode 100644 index 0000000..e69de29 diff --git a/systems/steam-deck/system.nix b/systems/steam-deck/system.nix new file mode 100644 index 0000000..515e0f2 --- /dev/null +++ b/systems/steam-deck/system.nix @@ -0,0 +1,71 @@ +{ + config, + inputs, + ... +}: { + imports = [./hardware.nix inputs.jovian.nixosModules.jovian]; + + general-settings = { + hostname = "steam-deck"; + locale = "en_US.UTF-8"; + timezone = "America/New_York"; + stateVersion = "25.05"; + }; + + # age.secrets.culsans-user-password.file = ../../secrets/culsans-user-password.age; + + users.users."culsans" = { + # hashedPasswordFile = config.age.secrets.culsans-user-password.path; + password = "hello"; + isNormalUser = true; + description = "Culsans"; + extraGroups = [ + "networkmanager" + "wheel" + "audio" + "video" + "libvirtd" + ]; + }; + + features = { + gui = { + apps = {}; + desktops = { + niri.enable = true; + }; + }; + cli = { + shells.nushell.enable = true; + utils = {}; + }; + services = { + core.systemd-boot.enable = true; + hardware = { + bluetooth.enable = true; + networkmanager.enable = true; + pipewire.enable = true; + }; + extra = { + syncthing-client = { + enable = true; + username = "culsans"; + }; + udisks2.enable = true; + }; + bundles = { + printing.enable = true; + }; + }; + }; + + jovian = { + devices.steamdeck.enable = true; + steam = { + enable = true; + autoStart = true; + defaultSession = "niri"; + user = "culsans"; + }; + }; +} diff --git a/users/ideapad-laptop/lucas.nix b/users/ideapad-laptop/lucas.nix new file mode 100644 index 0000000..a8c5832 --- /dev/null +++ b/users/ideapad-laptop/lucas.nix @@ -0,0 +1,60 @@ +{ + pkgs, + lib, + ... +}: { + home = { + username = "lucas"; + homeDirectory = "/home/lucas"; + stateVersion = "23.11"; + + packages = with pkgs; [ + tor-browser + onlyoffice-desktopeditors + calibre + + # My custom neovim package. + custom-neovim + neovide + ]; + }; + aesthetics = { + enable = true; + enableAllTargets = true; + hasGui = true; + theme = "oxocarbon"; + }; + programs.helix.package = lib.mkForce pkgs.helix; # Building helix takes too much power + features = { + gui = { + apps = { + foot.enable = true; + librewolf.enable = true; + qutebrowser.enable = true; + }; + desktops.niri.enable = true; + }; + cli = { + shells.nushell.enable = true; + apps = { + btop.enable = true; + helix.enable = true; + zellij.enable = true; + }; + utils = { + git.enable = true; + pandoc.enable = true; + ssh.enable = true; + }; + bundles = { + go-env.enable = true; + }; + scripts = { + spiral.enable = true; + }; + }; + services = { + udiskie.enable = true; + }; + }; +} diff --git a/users/nzxt-desktop/culsans.nix b/users/nzxt-desktop/culsans.nix new file mode 100644 index 0000000..17c4775 --- /dev/null +++ b/users/nzxt-desktop/culsans.nix @@ -0,0 +1,63 @@ +{pkgs, ...}: { + home = { + username = "culsans"; + homeDirectory = "/home/culsans"; + stateVersion = "23.11"; + + packages = with pkgs; [ + tor-browser + prismlauncher + onlyoffice-desktopeditors + calibre + ]; + }; + aesthetics = { + enable = true; + enableAllTargets = true; + hasGui = true; + theme = "oxocarbon"; + }; + features = { + gui = { + apps = { + foot.enable = true; + librewolf.enable = true; + qutebrowser.enable = true; + vesktop.enable = true; + mpv.enable = true; + }; + bundles = { + video.enable = true; + }; + desktops.niri.enable = true; + }; + cli = { + shells.nushell.enable = true; + apps = { + btop.enable = true; + helix.enable = true; + zellij.enable = true; + }; + utils = { + git.enable = true; + pandoc.enable = true; + ssh.enable = true; + }; + bundles = { + go-env.enable = true; + }; + scripts = { + spiral.enable = true; + }; + }; + services = { + udiskie.enable = true; + flatpak = { + enable = true; + packages = [ + "at.vintagestory.VintageStory" + ]; + }; + }; + }; +} diff --git a/users/prodesk-server/server.nix b/users/prodesk-server/server.nix new file mode 100644 index 0000000..e69de29 diff --git a/users/steam-deck/culsans.nix b/users/steam-deck/culsans.nix new file mode 100644 index 0000000..984c272 --- /dev/null +++ b/users/steam-deck/culsans.nix @@ -0,0 +1,59 @@ +{pkgs, ...}: { + home = { + username = "culsans"; + homeDirectory = "/home/culsans"; + stateVersion = "23.11"; + + packages = with pkgs; [ + tor-browser + prismlauncher + onlyoffice-desktopeditors + calibre + vintagestory + ]; + }; + nixpkgs.config.permittedInsecurePackages = ["dotnet-runtime-wrapped-7.0.20" "dotnet-runtime-7.0.20"]; + aesthetics = { + enable = true; + enableAllTargets = true; + hasGui = true; + theme = "oxocarbon"; + }; + features = { + gui = { + apps = { + foot.enable = true; + librewolf.enable = true; + qutebrowser.enable = true; + vesktop.enable = true; + mpv.enable = true; + }; + bundles = { + video.enable = true; + }; + desktops.niri.enable = true; + }; + cli = { + shells.nushell.enable = true; + apps = { + btop.enable = true; + helix.enable = true; + zellij.enable = true; + }; + utils = { + git.enable = true; + pandoc.enable = true; + ssh.enable = true; + }; + bundles = { + go-env.enable = true; + }; + scripts = { + spiral.enable = true; + }; + }; + services = { + udiskie.enable = true; + }; + }; +} -- cgit v1.2.3