From 85071855ec06a2cd5b5377d50fbccd67b4d91bd7 Mon Sep 17 00:00:00 2001 From: _cry64 Date: Sun, 22 Mar 2026 12:26:35 +1000 Subject: [PATCH] reorganise /homes --- homes/me/default.nix | 118 ++-------- homes/{modules => me/modules/cli}/git.nix | 0 homes/me/modules/cli/ssh.nix | 46 ++++ homes/modules/ags/config.js | 30 --- homes/modules/ags/default.nix | 12 - homes/modules/ags/style.css | 0 homes/modules/ags/widgets/applauncher.js | 125 ----------- homes/modules/ags/widgets/bar.ts | 38 ---- homes/modules/ags/widgets/fullscreen.js | 23 -- homes/modules/ags/widgets/notifications.js | 122 ---------- homes/modules/{ => apps}/obs.nix | 0 homes/modules/{ => cli}/bat.nix | 0 homes/modules/{ => cli}/btop.nix | 0 homes/modules/cli/hyfetch.nix | 22 ++ homes/modules/{ => cli}/tmux.nix | 0 homes/modules/{ => de}/mako.nix | 0 homes/modules/fish.nix | 88 -------- homes/modules/rofi.nix | 13 -- homes/modules/services/ssh-agent.nix | 16 ++ homes/modules/shell/fish.nix | 73 ++++++ homes/modules/shell/zsh.nix | 17 ++ homes/modules/term/default.nix | 9 - homes/modules/term/rio.nix | 6 +- homes/modules/theme.rasi | 209 ------------------ homes/modules/wm/default.nix | 39 ---- homes/modules/wm/hypr/hyprland.nix | 29 --- homes/modules/wm/hyprland/default.nix | 26 +++ .../wm/{hypr => hyprland}/hypridle.nix | 0 .../wm/{hypr => hyprland}/hyprlock.nix | 0 homes/modules/{ => wm/hyprland}/kanshi.nix | 6 +- .../wm/{mangowc.nix => mango/default.nix} | 0 homes/modules/wofi.nix | 183 --------------- 32 files changed, 219 insertions(+), 1031 deletions(-) rename homes/{modules => me/modules/cli}/git.nix (100%) create mode 100644 homes/me/modules/cli/ssh.nix delete mode 100755 homes/modules/ags/config.js delete mode 100644 homes/modules/ags/default.nix delete mode 100755 homes/modules/ags/style.css delete mode 100755 homes/modules/ags/widgets/applauncher.js delete mode 100755 homes/modules/ags/widgets/bar.ts delete mode 100755 homes/modules/ags/widgets/fullscreen.js delete mode 100644 homes/modules/ags/widgets/notifications.js rename homes/modules/{ => apps}/obs.nix (100%) rename homes/modules/{ => cli}/bat.nix (100%) rename homes/modules/{ => cli}/btop.nix (100%) create mode 100644 homes/modules/cli/hyfetch.nix rename homes/modules/{ => cli}/tmux.nix (100%) rename homes/modules/{ => de}/mako.nix (100%) delete mode 100755 homes/modules/fish.nix delete mode 100755 homes/modules/rofi.nix create mode 100644 homes/modules/services/ssh-agent.nix create mode 100755 homes/modules/shell/fish.nix create mode 100644 homes/modules/shell/zsh.nix delete mode 100644 homes/modules/term/default.nix delete mode 100755 homes/modules/theme.rasi delete mode 100644 homes/modules/wm/default.nix delete mode 100755 homes/modules/wm/hypr/hyprland.nix create mode 100755 homes/modules/wm/hyprland/default.nix rename homes/modules/wm/{hypr => hyprland}/hypridle.nix (100%) rename homes/modules/wm/{hypr => hyprland}/hyprlock.nix (100%) rename homes/modules/{ => wm/hyprland}/kanshi.nix (97%) rename homes/modules/wm/{mangowc.nix => mango/default.nix} (100%) delete mode 100755 homes/modules/wofi.nix diff --git a/homes/me/default.nix b/homes/me/default.nix index 6380ca2..8f4c8ea 100755 --- a/homes/me/default.nix +++ b/homes/me/default.nix @@ -1,27 +1,28 @@ {pkgs, ...}: { imports = [ - ../modules/fish.nix - ../modules/btop.nix - ../modules/tmux.nix - ../modules/git.nix - ../modules/bat.nix - ../modules/term/foot.nix + ./modules/cli/git.nix + ./modules/cli/ssh.nix + ../modules/term/foot.nix + ../modules/shell/fish.nix + ../modules/shell/zsh.nix ../modules/editor/helix.nix ../modules/editor/neovim + ../modules/cli/bat.nix + ../modules/cli/btop.nix + ../modules/cli/hyfetch.nix + ../modules/cli/tmux.nix + ../modules/apps/firefox.nix ../modules/apps/zen-browser.nix ../modules/apps/thunderbird.nix ../modules/apps/nixcord.nix ../modules/apps/spicetify.nix - # ../modules/wm - ../modules/wm/mangowc.nix - # ../modules/wm/hypr/hyprland.nix - # ../modules/wm/hypr/hyprlock.nix - ../modules/kanshi.nix - ../modules/mako.nix + ../modules/wm/hyprland + ../modules/wm/mango + ../modules/de/mako.nix ]; home = { @@ -33,6 +34,10 @@ trybuild = "nh os test ~/flake"; # shell utilities + ls = "eza --color=auto"; + l = "eza -Alh --color=auto --icons=auto"; + ll = "eza -lh --color=auto --icons=auto"; + li = "eza --color=auto --git-ignore"; rgf = "rg --files | rg"; watch = "viddy"; }; @@ -84,98 +89,9 @@ style.name = "gtk2"; }; - programs = { - hyfetch = { - enable = true; - settings = { - backend = "neofetch"; - args = null; - distro = null; - - preset = "transfeminine"; # "nonbinary"; - pride_month_disable = false; - custom_ascii_path = null; - - mode = "rgb"; - light_dark = "dark"; - auto_detect_light_dark = true; - lightness = 0.65; - color_align = { - mode = "horizontal"; - }; - }; - }; - - zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - - history = { - size = 10000; - ignoreAllDups = true; - path = "$HOME/.zsh_history"; - ignorePatterns = [ - "rm *" - ]; - }; - }; - - # set ssh profiles - # WARNING: this DOES NOT start the ssh-agent - # WARNING: for that you need to use `services.ssh-agent.enable` - ssh = { - enable = true; - forwardAgent = false; - addKeysToAgent = "yes"; - - matchBlocks = { - butterfly = { - hostname = "dobutterfliescry.net"; - user = "cry"; - port = 42069; - identityFile = "~/keys/butterfly"; - setEnv = { - TERM = "xterm-256color"; - }; - }; - hyrule = { - hostname = "hyrule.dobutterfliescry.net"; - user = "cry"; - port = 42069; - identityFile = "~/keys/hyrule"; - setEnv = { - TERM = "xterm-256color"; - }; - }; - matcha = { - hostname = "192.168.88.250"; - user = "emile"; - port = 22; - identityFile = "~/keys/matcha"; - }; - youcue = { - hostname = "moss.labs.eait.uq.edu.au"; - user = "s4740056"; - port = 22; - identityFile = "~/keys/other/youcue"; - setEnv = { - TERM = "xterm-256color"; - }; - }; - }; - }; - }; - services = { - # enable OpenSSH private key agent - # ssh-agent.enable = true; - gnome-keyring.enable = true; }; - # the ssh-agent won't set this for itself... - # systemd.user.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent"; home.stateVersion = "24.05"; # don't change this } diff --git a/homes/modules/git.nix b/homes/me/modules/cli/git.nix similarity index 100% rename from homes/modules/git.nix rename to homes/me/modules/cli/git.nix diff --git a/homes/me/modules/cli/ssh.nix b/homes/me/modules/cli/ssh.nix new file mode 100644 index 0000000..7e4e694 --- /dev/null +++ b/homes/me/modules/cli/ssh.nix @@ -0,0 +1,46 @@ +{...}: { + # set ssh profiles + # WARNING: this DOES NOT start the ssh-agent + # WARNING: for that you need to use `services.ssh-agent.enable` + programs.ssh = { + enable = true; + forwardAgent = false; + addKeysToAgent = "yes"; + + matchBlocks = { + butterfly = { + hostname = "dobutterfliescry.net"; + user = "cry"; + port = 42069; + identityFile = "~/keys/butterfly"; + setEnv = { + TERM = "xterm-256color"; + }; + }; + hyrule = { + hostname = "hyrule.dobutterfliescry.net"; + user = "cry"; + port = 42069; + identityFile = "~/keys/hyrule"; + setEnv = { + TERM = "xterm-256color"; + }; + }; + matcha = { + hostname = "192.168.88.250"; + user = "emile"; + port = 22; + identityFile = "~/keys/matcha"; + }; + youcue = { + hostname = "moss.labs.eait.uq.edu.au"; + user = "s4740056"; + port = 22; + identityFile = "~/keys/other/youcue"; + setEnv = { + TERM = "xterm-256color"; + }; + }; + }; + }; +} diff --git a/homes/modules/ags/config.js b/homes/modules/ags/config.js deleted file mode 100755 index 5a11efc..0000000 --- a/homes/modules/ags/config.js +++ /dev/null @@ -1,30 +0,0 @@ -import { AppLauncher } from "./widgets/applauncher.js" -//import { Notifications } from "./widgets/notifications.js" - -/* -const date = Variable('', { - poll: [1000, 'date'], -}) -*/ - -/* -const Bar = (monitor = 0) => Widget.Window({ - monitor, - name: 'bar${monitor}', - anchor: ['top', 'left', 'right'], - child: Widget.Label({ label: date.bind() }), - }) -*/ - -App.config({ - style: "./style.css", - // icons: "./assets", - windows: [ - //Bar(), - AppLauncher, - //Notifications() - ] - // gtkTheme: "Adwaita-dark", - // cursorTheme: "Qogir", - // iconTheme: "MoreWaita",[] -}) diff --git a/homes/modules/ags/default.nix b/homes/modules/ags/default.nix deleted file mode 100644 index 448e32e..0000000 --- a/homes/modules/ags/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - programs.ags = { - enable = true; - configDir = ./.; - - extraPackages = with pkgs; [ - gtksourceview - webkitgtk - accountsservice - ]; - }; -} diff --git a/homes/modules/ags/style.css b/homes/modules/ags/style.css deleted file mode 100755 index e69de29..0000000 diff --git a/homes/modules/ags/widgets/applauncher.js b/homes/modules/ags/widgets/applauncher.js deleted file mode 100755 index d94244a..0000000 --- a/homes/modules/ags/widgets/applauncher.js +++ /dev/null @@ -1,125 +0,0 @@ -const { query } = await Service.import("applications"); -const WINDOW_NAME = "applauncher"; - -const AppItem = app => Widget.Button({ - on_clicked: () => { - App.closeWindow(WINDOW_NAME) - app.launch() - }, - attribute: { app }, - child: Widget.Box({ - children: [ - Widget.Icon({ - icon: app.icon_name || "", - size: 42, - }), - Widget.Label({ - class_name: "title", - label: app.name, - xalign: 0, - vpack: "center", - truncate: "end", - css: "margin-left: 10px;" - }), - ], - }), -}) - -const AppLauncherWidget = ({ width = 500, height = 500, spacing = 12 }) => { - let applications = query("").map(AppItem) - - const list = Widget.Box({ - vertical: true, - children: applications, - spacing, - }) - - function refresh() { - applications = query("").map(AppItem) - list.children = applications - } - - const entry = Widget.Entry({ - placeholder_text: "Search", - hexpand: true, - css: "min-height: 50px;", - - // launch first item when Enter is pressed - on_accept: () => { - // only consider applications that are visible in the list - const results = applications.filter((item) => item.visible); - if (results[0]) { - App.toggleWindow(WINDOW_NAME); - results[0].attribute.app.launch() - } - }, - - // filter the applications based on search term - on_change: ({ text }) => applications.forEach(item => { - item.visible = item.attribute.app.match(text ?? "") - }), - }) - - return Widget.Box({ - vertical: false, - children: [ - // LEFT - Widget.Box({ - vertical: true, - css: `min-width: ${width}px;` - + `min-height: ${height}px;` - + "background-image: url('https://images2.alphacoders.com/135/1351579.png');" - + "background-size: cover;" - + "background-position: center;" - + "background-repeat: no-repeat;", - children: [ - // align the entry field with the app list - Widget.Box({ - css: `margin: ${spacing * 2}px;`, - child: entry, - }), - ], - }), - - // RIGHT - Widget.Box({ - vertical: true, - css: `margin: ${spacing * 2}px;`, - child: - // make scrollable - Widget.Scrollable({ - hscroll: "never", - css: `min-width: ${width}px; min-height: ${height}px;`, - child: list, - }), - - setup: self => self.hook(App, (_, windowName, visible) => { - if (windowName !== WINDOW_NAME) - return - - // when the launcher becomes visible - if (visible) { - refresh() - entry.text = "" - entry.grab_focus() - } - }), - }), - ], - }) -} - -// the app launcher should be a singleton -export const AppLauncher = Widget.Window({ - name: WINDOW_NAME, - setup: self => self.keybind("Escape", () => { - App.closeWindow(WINDOW_NAME) - }), - visible: false, - keymode: "exclusive", - child: AppLauncherWidget({ - width: 500, - height: 500, - spacing: 12, - }), -}) diff --git a/homes/modules/ags/widgets/bar.ts b/homes/modules/ags/widgets/bar.ts deleted file mode 100755 index 8f361ac..0000000 --- a/homes/modules/ags/widgets/bar.ts +++ /dev/null @@ -1,38 +0,0 @@ -import options from "options"p - -const { start, center, end } = options.bar.layout - -// place all your bar widgets in here -const widgets = { - expander: () => Widget.Box({ expand: true}), -} - - -//export type BarWidget = keyof typeof widget; - -export default (monitor: number) => Widget.Window({ - monitor, - class_name: "bar", - name: "bar-${monitor}", - // anchor: position.bind().as(pos => [pos, "left", "right"]), - anchor: ["top", "left", "right"], - child: Widget.CenterBox({ - // ensure bar is shown - css: "min-width: 2px; min-height: 2px;" - startWidget: Widget.Box({ - hexpand: true, - // map all start widgets to be childen - childen: start.bind().as(s => s.map(w => widgets[w]())) - }), - centerWidget: Widget.Box({ - hpack: "center", - // map all center widgets to be childen - childen: center.bind().as(c => c.map(w => widgets[w]())) - }), - endWidget: Widget.Box({ - hexpand: true - // map all end widgets to be childen - childen: end.bind().as(e => e.map(w => widgets[w]())) - }), - }) -}) diff --git a/homes/modules/ags/widgets/fullscreen.js b/homes/modules/ags/widgets/fullscreen.js deleted file mode 100755 index 72682f2..0000000 --- a/homes/modules/ags/widgets/fullscreen.js +++ /dev/null @@ -1,23 +0,0 @@ -const WINDOW_NAME = "fullscreen"; - -const Fullscreen = (children) => Widget.Box({ - vertical: true, - css: "background-image: url('~/downloads/wallpaper/kill-my-firstborn/astronaut-pink-blue.png');", - //+ "background-size: cover;" - //+ "background-position: center;" - //+ "background-repeat: no-repeat;", - children: children, -}) - -export const fullscreen = Widget.Window({ - name: WINDOW_NAME, - setup: self => self.keybind("Escape", () => { - App.closeWindow(WINDOW_NAME) - }), - anchor: ["top", "bottom", "left", "right"], - visible: false, - keymode: "exclusive", - child: Fullscreen( - Widget.Label({"Hello World"}); - ) -}) diff --git a/homes/modules/ags/widgets/notifications.js b/homes/modules/ags/widgets/notifications.js deleted file mode 100644 index 3af9fcf..0000000 --- a/homes/modules/ags/widgets/notifications.js +++ /dev/null @@ -1,122 +0,0 @@ -const notifications = await Service.import("notifications"); - -function NotificationIcon({ app_entry, app_icon, image}) { - if (image) { - return Widget.Box({ - css: `background-image: url("${image}");` - + "background-size: contain;" - + "background-repeat: no-repeat;" - + "background-position: center;" - }) - } - - let icon = "dialog-information-symbolic" - if (Utils.lookUpIcon(app_icon)) - icon = app_icon - - if (app_entry && Utils.lookUpIcon(app_entry)) - icon = app_entry - - return Widget.Box({ - child: Widget.Icon(icon), - }) -} - - -function Notification(n) { - const icon = Widget.Box({ - vpack: "start", - class_name: "icon", - child: NotificationIcon(n), - }) - - const title = Widget.Label({ - class_name: "title", - xalign: 0, - justification: "left", - hexpand: true, - max_width_chars: 24, - truncate: "end", - wrap: true, - label: n.summary, - use_markup: true, - }) - - const body = Widget.Label({ - class_name: "body", - hexpand: true, - use_markup: true, - xalign: 0, - justification: "left", - label: n.body, - wrap: true, - }) - - const actions = Widget.Box({ - class_name: "actions", - children: n.actions.map(({ id, label}) => Widget.Button({ - class_name: "action-button", - on_clicked: () => { - n.invoke(id), - n.dismiss() - }, - hexpand: true, - child: Widget.Label(label), - })), - }) - - return Widget.EventBox( - { - attribute: {id: n.id}, - on_primary_click: n.dismiss, - }, - Widget.Box( - { - class_name: `notification ${n.urgency}`, - vertical: true, - }, - Widget.Box([ - icon, - Widget.Box( - { vertical: true }, - title, - body, - ), - ]), - actions, - ), - ) -} - -export function Notifications(monitor = 0) { - const list = Widget.Box({ - vertical: true, - children: notifications.popups.map(Notification), - }) - - function onNotified(_, id) { - const n = notifications.getNotification(id) - if (n) - list.children = [Notification(n), ...list.children] - } - - function onDismissed(_, id) { - list.children.find(n => n.attribute.id === id)?.destroy() - } - - list.hook(notifications, onNotified, "notified") - .hook(notifications, onDismissed, "dismissed") - - return Widget.Window({ - monitor, - class_name: "notifications-widget", - name: `notifications-${monitor}`, - anchor: ["top", "left"], - child: Widget.Box({ - css: "min-width: 2px; min-height: 2px;", - class_name: "notifications", - vertical: true, - child: list, - }), - }) -} diff --git a/homes/modules/obs.nix b/homes/modules/apps/obs.nix similarity index 100% rename from homes/modules/obs.nix rename to homes/modules/apps/obs.nix diff --git a/homes/modules/bat.nix b/homes/modules/cli/bat.nix similarity index 100% rename from homes/modules/bat.nix rename to homes/modules/cli/bat.nix diff --git a/homes/modules/btop.nix b/homes/modules/cli/btop.nix similarity index 100% rename from homes/modules/btop.nix rename to homes/modules/cli/btop.nix diff --git a/homes/modules/cli/hyfetch.nix b/homes/modules/cli/hyfetch.nix new file mode 100644 index 0000000..b0a64a0 --- /dev/null +++ b/homes/modules/cli/hyfetch.nix @@ -0,0 +1,22 @@ +{...}: { + programs.hyfetch = { + enable = true; + settings = { + backend = "neofetch"; + args = null; + distro = null; + + preset = "transfeminine"; # "nonbinary"; + pride_month_disable = false; + custom_ascii_path = null; + + mode = "rgb"; + light_dark = "dark"; + auto_detect_light_dark = true; + lightness = 0.65; + color_align = { + mode = "horizontal"; + }; + }; + }; +} diff --git a/homes/modules/tmux.nix b/homes/modules/cli/tmux.nix similarity index 100% rename from homes/modules/tmux.nix rename to homes/modules/cli/tmux.nix diff --git a/homes/modules/mako.nix b/homes/modules/de/mako.nix similarity index 100% rename from homes/modules/mako.nix rename to homes/modules/de/mako.nix diff --git a/homes/modules/fish.nix b/homes/modules/fish.nix deleted file mode 100755 index dd14c45..0000000 --- a/homes/modules/fish.nix +++ /dev/null @@ -1,88 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - options = { - morphBashToFish = lib.mkEnableOption "morphBashToFish"; - }; - - # TODO: make the greeting controllable (ie so my VPS can be different) - config = { - programs.fish = { - enable = true; - generateCompletions = true; - - # vendor = { - # config.enable = true; - # functions.enable = true; - # completions.enable = true; - # }; - - interactiveShellInit = let - greetings = - [ - "Welcome weary traveller to my shop" - "It's dangerous to go alone! Take this." - "Do butterflies cry when they're sad?" - "I hope they do" - "I think Alice is lost..." - "I once again retreat to the sanctuary of my virtual realm" - - "Something wicked this way comes" - "May your L's be many... and your bitches few" - - "What a horrible night to have a curse." - "The ancient spirits of light and dark have been released." - "The god of the stars rejects your offering. The ritual can only be performed at night." - "You should have just died..." - "Supreme Witch, Calamitas has killed every player!" - - "A broken heart beats in fractals" # Key Fairy - - "Remember our promise" # Signalis - ] - |> map (x: "\"${x}\"") - |> builtins.concatStringsSep " "; - in '' - # add dotnet completions if it exists (ie we're in a virtual environment) - if type -q dotnet - complete -f -c dotnet -a "(dotnet complete (commandline -cp))" - end - - function rand_greet - set greetings ${greetings} - echo -n $greetings[(random 1 (count $greetings))] - end - - function gitignore -a type - curl -sL "https://www.gitignore.io/api/$type" - end - - end - - function decompile - objdump --disassemble --demangle --debugging --debugging-tags $argv | bat --language asm - end - - set -g fish_greeting (rand_greet) - ''; - - shellAliases = { - brip = "batgrep"; # bat + ripgrep - man = "batman"; # bat + man - ls = "eza --color=auto"; - l = "eza -Alh --color=auto --icons=auto"; - ll = "eza -lh --color=auto --icons=auto"; - li = "eza --color=auto --git-ignore"; - }; - - plugins = [ - { - name = "grc"; - src = pkgs.fishPlugins.grc.src; - } - ]; - }; - }; -} diff --git a/homes/modules/rofi.nix b/homes/modules/rofi.nix deleted file mode 100755 index 6d05543..0000000 --- a/homes/modules/rofi.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - config, - pkgs, - ... -}: { - programs.rofi = { - enable = true; - package = pkgs.rofi-wayland; - font = "JetBrains Mono Nerd Font 10"; - location = "center"; - terminal = "${pkgs.rio}/bin/rio"; - }; -} diff --git a/homes/modules/services/ssh-agent.nix b/homes/modules/services/ssh-agent.nix new file mode 100644 index 0000000..a0b505c --- /dev/null +++ b/homes/modules/services/ssh-agent.nix @@ -0,0 +1,16 @@ +{osConfig, ...}: { + assertions = [ + { + assertion = !osConfig.services.gnupg.agent.enable; + message = '' + It is not recommended to enable both `homeConfig.services.ssh-agent.enable` and `osConfig.services.gnupg.agent.enable`! + ''; + } + ]; + + # enable OpenSSH private key agent + services.ssh-agent.enable = true; + + # WARNING: the ssh-agent won't set this for itself... + systemd.user.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent"; +} diff --git a/homes/modules/shell/fish.nix b/homes/modules/shell/fish.nix new file mode 100755 index 0000000..af2d8d3 --- /dev/null +++ b/homes/modules/shell/fish.nix @@ -0,0 +1,73 @@ +{pkgs, ...}: { + programs.fish = { + enable = true; + generateCompletions = true; + + interactiveShellInit = let + greetings = + [ + # Official _cry64 quotes + "Do butterflies cry when they're sad?" + "I hope they do" + "I think Alice is lost..." + "I once again retreat to the sanctuary of my virtual realm" + + # Unknown + "Welcome weary traveler to my shop" + + # Legend of Zelda + "It's dangerous to go alone! Take this." + + # ULTRAKILL + "Something wicked this way comes" + "May your L's be many... and your bitches few" + + # Terraria + "What a horrible night to have a curse." + "The ancient spirits of light and dark have been released." + + # Calamity + "The god of the stars rejects your offering. The ritual can only be performed at night." + "You should have just died..." + "Supreme Witch, Calamitas has killed every player!" + + # Key Fairy + "A broken heart beats in fractals" + + # Signalis + "Remember our promise" + ] + |> map (x: "\"${x}\"") + |> builtins.concatStringsSep " "; + in '' + # add dotnet completions if it exists (ie we're in a virtual environment) + if type -q dotnet + complete -f -c dotnet -a "(dotnet complete (commandline -cp))" + end + + function rand_greet + set greetings ${greetings} + echo -n $greetings[(random 1 (count $greetings))] + end + + function gitignore -a type + curl -sL "https://www.gitignore.io/api/$type" + end + + end + + function decompile + objdump --disassemble --demangle --debugging --debugging-tags $argv | bat --language asm + end + + set -g fish_greeting (rand_greet) + ''; + + plugins = [ + { + name = "grc"; + src = pkgs.fishPlugins.grc.src; + } + ]; + }; +} diff --git a/homes/modules/shell/zsh.nix b/homes/modules/shell/zsh.nix new file mode 100644 index 0000000..361191e --- /dev/null +++ b/homes/modules/shell/zsh.nix @@ -0,0 +1,17 @@ +{...}: { + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + history = { + size = 10000; + ignoreAllDups = true; + path = "$HOME/.zsh_history"; + ignorePatterns = [ + "rm *" + ]; + }; + }; +} diff --git a/homes/modules/term/default.nix b/homes/modules/term/default.nix deleted file mode 100644 index d446b15..0000000 --- a/homes/modules/term/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - lib, - ... -}: -{ - options = { - - } -} diff --git a/homes/modules/term/rio.nix b/homes/modules/term/rio.nix index 88ef968..3b540dd 100755 --- a/homes/modules/term/rio.nix +++ b/homes/modules/term/rio.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { home = { packages = [ pkgs.rio diff --git a/homes/modules/theme.rasi b/homes/modules/theme.rasi deleted file mode 100755 index 07c375d..0000000 --- a/homes/modules/theme.rasi +++ /dev/null @@ -1,209 +0,0 @@ -/** - * - * Author : Aditya Shakya (adi1090x) - * Github : @adi1090x - * - * Rofi Theme File - * Rofi Version: 1.7.3 - **/ - -/*****----- Configuration -----*****/ -configuration { - modi: "drun,run,filebrowser,window"; - show-icons: true; - display-drun: "APPS"; - display-run: "RUN"; - display-filebrowser: "FILES"; - display-window: "WINDOW"; - drun-display-format: "{name}"; - window-format: "{w} · {c} · {t}"; -} - -/*****----- Global Properties -----*****/ -* { - font: "JetBrains Mono Nerd Font 10"; - background: #11092D; - background-alt: #281657; - foreground: #FFFFFF; - selected: #DF5296; - active: #6E77FF; - urgent: #8E3596; -} - -/*****----- Main Window -----*****/ -window { - /* properties for window widget */ - transparency: "real"; - location: center; - anchor: center; - fullscreen: false; - width: 1000px; - x-offset: 0px; - y-offset: 0px; - - /* properties for all widgets */ - enabled: true; - border-radius: 15px; - cursor: "default"; - background-color: @background; -} - -/*****----- Main Box -----*****/ -mainbox { - enabled: true; - spacing: 0px; - background-color: transparent; - orientation: horizontal; - children: [ "imagebox", "listbox" ]; -} - -imagebox { - padding: 20px; - background-color: transparent; - background-image: url("~/.config/rofi/images/j.jpg", height); - orientation: vertical; - children: [ "inputbar", "dummy", "mode-switcher" ]; -} - -listbox { - spacing: 20px; - padding: 20px; - background-color: transparent; - orientation: vertical; - children: [ "message", "listview" ]; -} - -dummy { - background-color: transparent; -} - -/*****----- Inputbar -----*****/ -inputbar { - enabled: true; - spacing: 10px; - padding: 15px; - border-radius: 10px; - background-color: @background-alt; - text-color: @foreground; - children: [ "textbox-prompt-colon", "entry" ]; -} -textbox-prompt-colon { - enabled: true; - expand: false; - str: ""; - background-color: inherit; - text-color: inherit; -} -entry { - enabled: true; - background-color: inherit; - text-color: inherit; - cursor: text; - placeholder: "Search"; - placeholder-color: inherit; -} - -/*****----- Mode Switcher -----*****/ -mode-switcher{ - enabled: true; - spacing: 20px; - background-color: transparent; - text-color: @foreground; -} -button { - padding: 15px; - border-radius: 10px; - background-color: @background-alt; - text-color: inherit; - cursor: pointer; -} -button selected { - background-color: @selected; - text-color: @foreground; -} - -/*****----- Listview -----*****/ -listview { - enabled: true; - columns: 1; - lines: 8; - cycle: true; - dynamic: true; - scrollbar: false; - layout: vertical; - reverse: false; - fixed-height: true; - fixed-columns: true; - - spacing: 10px; - background-color: transparent; - text-color: @foreground; - cursor: "default"; -} - -/*****----- Elements -----*****/ -element { - enabled: true; - spacing: 15px; - padding: 8px; - border-radius: 10px; - background-color: transparent; - text-color: @foreground; - cursor: pointer; -} -element normal.normal { - background-color: inherit; - text-color: inherit; -} -element normal.urgent { - background-color: @urgent; - text-color: @foreground; -} -element normal.active { - background-color: @active; - text-color: @foreground; -} -element selected.normal { - background-color: @selected; - text-color: @foreground; -} -element selected.urgent { - background-color: @urgent; - text-color: @foreground; -} -element selected.active { - background-color: @urgent; - text-color: @foreground; -} -element-icon { - background-color: transparent; - text-color: inherit; - size: 32px; - cursor: inherit; -} -element-text { - background-color: transparent; - text-color: inherit; - cursor: inherit; - vertical-align: 0.5; - horizontal-align: 0.0; -} - -/*****----- Message -----*****/ -message { - background-color: transparent; -} -textbox { - padding: 15px; - border-radius: 10px; - background-color: @background-alt; - text-color: @foreground; - vertical-align: 0.5; - horizontal-align: 0.0; -} -error-message { - padding: 15px; - border-radius: 20px; - background-color: @background; - text-color: @foreground; -} diff --git a/homes/modules/wm/default.nix b/homes/modules/wm/default.nix deleted file mode 100644 index 8c0cc95..0000000 --- a/homes/modules/wm/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - inherit - (lib) - mkEnableOption - mkOption - types - ; -in { - imports = [ - ./hypr/hyprland.nix - ./mangowc.nix - ]; - - options.cryos = { - wm = { - default = mkOption { - type = types.enum ["mangowc" "hyprland"]; - default = "mangowc"; - example = "hyprland"; - description = "Window manager to boot by default."; - }; - hyprland.enabled = mkEnableOption "hyprland"; - mangowc.enabled = mkEnableOption "mangowc"; - }; - }; - - config = { - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ - # xdg-desktop-portal-gtk - ]; - }; - }; -} diff --git a/homes/modules/wm/hypr/hyprland.nix b/homes/modules/wm/hypr/hyprland.nix deleted file mode 100755 index 77b3b44..0000000 --- a/homes/modules/wm/hypr/hyprland.nix +++ /dev/null @@ -1,29 +0,0 @@ -# NOTE: hyprland must be enabled in BOTH your host config (for running hyprland) -# NOTE: and your home-manager config (for managing hyprland's config files) -{ - pkgs, - inputs, - ... -}: { - config = { - wayland.windowManager.hyprland = { - enable = true; - # package = pkgs.hyprland; - package = null; - portalPackage = null; - - xwayland.enable = true; - - # systemd = { - # enable = true; - # # enable autostart of applications - # # REF: `man 8 systemd-xdg-autostart-generator` - # enableXdgAutostart = true; - # }; - - # plugins = with inputs; [ - # split-monitor-workspaces.packages.${pkgs.system}.split - # ]; - }; - }; -} diff --git a/homes/modules/wm/hyprland/default.nix b/homes/modules/wm/hyprland/default.nix new file mode 100755 index 0000000..ee7ff2d --- /dev/null +++ b/homes/modules/wm/hyprland/default.nix @@ -0,0 +1,26 @@ +# NOTE: hyprland must be enabled in BOTH your host config (for running hyprland) +# NOTE: and your home-manager config (for managing hyprland's config files) +{...}: { + imports = [ + ./kanshi.nix + ]; + + wayland.windowManager.hyprland = { + enable = true; + package = null; + portalPackage = null; + + xwayland.enable = true; + + # systemd = { + # enable = true; + # # enable autostart of applications + # # REF: `man 8 systemd-xdg-autostart-generator` + # enableXdgAutostart = true; + # }; + + # plugins = with inputs; [ + # split-monitor-workspaces.packages.${pkgs.system}.split + # ]; + }; +} diff --git a/homes/modules/wm/hypr/hypridle.nix b/homes/modules/wm/hyprland/hypridle.nix similarity index 100% rename from homes/modules/wm/hypr/hypridle.nix rename to homes/modules/wm/hyprland/hypridle.nix diff --git a/homes/modules/wm/hypr/hyprlock.nix b/homes/modules/wm/hyprland/hyprlock.nix similarity index 100% rename from homes/modules/wm/hypr/hyprlock.nix rename to homes/modules/wm/hyprland/hyprlock.nix diff --git a/homes/modules/kanshi.nix b/homes/modules/wm/hyprland/kanshi.nix similarity index 97% rename from homes/modules/kanshi.nix rename to homes/modules/wm/hyprland/kanshi.nix index 906f6a8..245b991 100755 --- a/homes/modules/kanshi.nix +++ b/homes/modules/wm/hyprland/kanshi.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{...}: { # Change monitor positions # TODO: find a way to make this modular (ie put something different for my laptop) # my idea is to have a "monitors" module and use kanshi for wayland diff --git a/homes/modules/wm/mangowc.nix b/homes/modules/wm/mango/default.nix similarity index 100% rename from homes/modules/wm/mangowc.nix rename to homes/modules/wm/mango/default.nix diff --git a/homes/modules/wofi.nix b/homes/modules/wofi.nix deleted file mode 100755 index 81a25d3..0000000 --- a/homes/modules/wofi.nix +++ /dev/null @@ -1,183 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: { - programs.wofi = { - enable = true; - settings = { - location = "center"; - allow_markup = true; - width = 250; - }; - # Force the style to stop Stylix being a bitch and overwriting it - style = lib.mkForce '' - @define-color rosewater #f2d5cf; - @define-color rosewater-rgb rgb(242, 213, 207); - @define-color flamingo #eebebe; - @define-color flamingo-rgb rgb(238, 190, 190); - @define-color pink #f4b8e4; - @define-color pink-rgb rgb(244, 184, 228); - @define-color mauve #ca9ee6; - @define-color mauve-rgb rgb(202, 158, 230); - @define-color red #e78284; - @define-color red-rgb rgb(231, 130, 132); - @define-color maroon #ea999c; - @define-color maroon-rgb rgb(234, 153, 156); - @define-color peach #ef9f76; - @define-color peach-rgb rgb(239, 159, 118); - @define-color yellow #e5c890; - @define-color yellow-rgb rgb(229, 200, 144); - @define-color green #a6d189; - @define-color green-rgb rgb(166, 209, 137); - @define-color teal #81c8be; - @define-color teal-rgb rgb(129, 200, 190); - @define-color sky #99d1db; - @define-color sky-rgb rgb(153, 209, 219); - @define-color sapphire #85c1dc; - @define-color sapphire-rgb rgb(133, 193, 220); - @define-color blue #8caaee; - @define-color blue-rgb rgb(140, 170, 238); - @define-color lavender #babbf1; - @define-color lavender-rgb rgb(186, 187, 241); - @define-color text #c6d0f5; - @define-color text-rgb rgb(198, 208, 245); - @define-color subtext1 #b5bfe2; - @define-color subtext1-rgb rgb(181, 191, 226); - @define-color subtext0 #a5adce; - @define-color subtext0-rgb rgb(165, 173, 206); - @define-color overlay2 #949cbb; - @define-color overlay2-rgb rgb(148, 156, 187); - @define-color overlay1 #838ba7; - @define-color overlay1-rgb rgb(131, 139, 167); - @define-color overlay0 #737994; - @define-color overlay0-rgb rgb(115, 121, 148); - @define-color surface2 #626880; - @define-color surface2-rgb rgb(98, 104, 128); - @define-color surface1 #51576d; - @define-color surface1-rgb rgb(81, 87, 109); - @define-color surface0 #414559; - @define-color surface0-rgb rgb(65, 69, 89); - @define-color base #303446; - @define-color base-rgb rgb(48, 52, 70); - @define-color mantle #292c3c; - @define-color mantle-rgb rgb(41, 44, 60); - @define-color crust #232634; - @define-color crust-rgb rgb(35, 38, 52); - - * { - font-family: 'FiraCode Nerd Font'; - font-size: 16px; - } - - /* Window */ - window { - margin: 0px; - padding: 10px; - border: 0.16em solid @teal; - border-radius: 0.5em; - background-color: @base; - animation: slideIn 0.25s ease-in-out both; - } - - /* Slide In */ - @keyframes slideIn { - 0% { - opacity: 0; - } - - 100% { - opacity: 1; - } - } - - /* Inner Box */ - #inner-box { - margin: 5px; - padding: 10px; - border: none; - background-color: @base; - /*animation: fadeIn 0.5s ease-in-out both;*/ - } - - /* Fade In */ - @keyframes fadeIn { - 0% { - opacity: 0; - } - - 100% { - opacity: 1; - } - } - - /* Outer Box */ - #outer-box { - margin: 5px; - padding: 10px; - border: none; - background-color: @base; - } - - /* Scroll */ - #scroll { - margin: 0px; - padding: 10px; - border: none; - background-color: @base; - } - - /* Input */ - #input { - margin: 5px 20px; - padding: 10px; - border: none; - border-radius: 0.25em; - color: @text; - background-color: @base; - animation: fadeIn 0.25s ease-in-out both; - } - - #input image { - border: none; - color: @red; - } - - #input * { - outline: 4px solid @red!important; - } - - /* Text */ - #text { - margin: 5px; - border: none; - color: @text; - animation: fadeIn 0.5s ease-in-out both; - } - - #entry { - background-color: @base; - } - - #entry arrow { - border: none; - color: @teal; - } - - /* Selected Entry */ - #entry:selected { - border: 0.10em solid @teal; - border-radius: 0.25em; - } - - #entry:selected #text { - color: @teal; - } - - #entry:drop(active) { - background-color: @lavender!important; - } - ''; - }; -}