diff --git a/README.md b/README.md index a969486..8826723 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ # nichts + My personal collection of NixOS configuration files -# License -No Idea at this point -# Flake structure: + +# License + +No Idea at this point + +# Flake structure: + ``` . ├── assets @@ -12,8 +17,8 @@ No Idea at this point ├── hosts # My different hosts │   ├── default.nix # Where the different hosts are specified │   └── vali -│   └── mars # My main computer -│   ├── configuration.nix # Main configuration file +│   └── mars # My main computer +│   ├── configuration.nix # Main configuration file │   ├── default.nix │   ├── hardware-configuration.nix # Hardware config for my system │   ├── profile.nix # importing different system options @@ -30,7 +35,7 @@ No Idea at this point │   │   └── nh.nix # nix helper config │   ├── default.nix │   ├── editors # My different editors -│   │   ├── default.nix +│   │   ├── default.nix │   │   ├── emacs.nix # Emacs config │   │   ├── helix.nix # Helix config │   │   ├── kakoune.nix # Kakoune config @@ -87,7 +92,7 @@ No Idea at this point │   │   │   └── default.nix │   │   ├── services.nix # Enabled services I need in wayland │   │   └── variables.nix # Wayland system variables -│   └── x # My X window managers +│   └── x # My X window managers │   ├── awesome # Awesome window manager │   │   ├── awesome.nix # Awesome config │   │   └── rc.lua # Awesome config file @@ -109,12 +114,14 @@ No Idea at this point ├── overlay.nix # Overlays └── README.md # This file # This file ``` + # credits + ``` *heavily* inspired by https://git.jacekpoz.pl/jacekpoz/niksos.git ! Sioodmy: https://github.com/sioodmy/dotfiles Heinrik Lissner: https://github.com/hlissner/dotfiles/ Lokasku: https://github.com/lokasku/nix-config -NotaShelf: https://github.com/notashelf/Nyx +NotAShelf: https://github.com/notashelf/Nyx Wallpapers: https://github.com/zhichaoh/catppuccin-wallpapers?tab=readme-ov-file ``` diff --git a/hosts/vali/hermit/configuration.nix b/hosts/vali/hermit/configuration.nix index 7cf1e38..636926d 100644 --- a/hosts/vali/hermit/configuration.nix +++ b/hosts/vali/hermit/configuration.nix @@ -69,6 +69,7 @@ spicetify.enable = true; schizofox.enable = true; anyrun.enable = true; + ags.enable = true; }; editors = { emacs = { diff --git a/hosts/vali/hermit/profile.nix b/hosts/vali/hermit/profile.nix index c843f8e..45e6158 100644 --- a/hosts/vali/hermit/profile.nix +++ b/hosts/vali/hermit/profile.nix @@ -4,7 +4,7 @@ _: { ../../../options/common/bluetooth.nix ../../../options/desktop/fonts.nix ../../../options/common/networking.nix - ../../../options/common/gpu/nvidia.nix + # ../../../options/common/gpu/nvidia.nix ../../../options/desktop/monitors.nix ../../../overlay.nix ]; diff --git a/hosts/vali/hermit/programs.nix b/hosts/vali/hermit/programs.nix index bc3d17a..e0a765e 100644 --- a/hosts/vali/hermit/programs.nix +++ b/hosts/vali/hermit/programs.nix @@ -3,7 +3,6 @@ pkgs, ... }: let - fenix = inputs.fenix.packages.${pkgs.system}; nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system}; in { environment.systemPackages = with pkgs; [ @@ -14,6 +13,7 @@ in { blueman bluetuith bluez + bun cmake difftastic dig @@ -87,6 +87,7 @@ in { ventoy-full vlc weechat + wezterm wget wireguard-tools wl-clipboard diff --git a/modules/cli/fish.nix b/modules/cli/fish.nix index 41131cf..ec76ec2 100644 --- a/modules/cli/fish.nix +++ b/modules/cli/fish.nix @@ -62,6 +62,7 @@ in { kys = "shutdown now"; lg = "lazygit"; cd = "z"; + "..." = "cd ../.."; v = "nvim"; h = "hx"; k = "kak"; diff --git a/modules/cli/starship.nix b/modules/cli/starship.nix new file mode 100644 index 0000000..8b00731 --- /dev/null +++ b/modules/cli/starship.nix @@ -0,0 +1,103 @@ +{ + config, + lib, + ... +}: let + inherit (builtins) map; + inherit (lib.strings) concatStrings; +in { + home = { + sessionVariables = { + STARSHIP_CACHE = "${config.xdg.cacheHome}/starship"; + }; + }; + + programs.starship = let + elemsConcatted = concatStrings ( + map (s: "\$${s}") [ + "hostname" + "username" + "directory" + "shell" + "nix_shell" + "git_branch" + "git_commit" + "git_state" + "git_status" + "jobs" + "cmd_duration" + ] + ); + in { + enable = true; + + settings = { + scan_timeout = 2; + command_timeout = 2000; # nixpkgs makes starship implode with lower values + add_newline = false; + line_break.disabled = false; + + format = "${elemsConcatted}\n$character"; + + hostname = { + ssh_only = true; + disabled = false; + format = "@[$hostname](bold blue) "; # the whitespace at the end is actually important + }; + + # configure specific elements + character = { + error_symbol = "[](bold red)"; + success_symbol = "[](bold green)"; + vicmd_symbol = "[](bold yellow)"; + format = "$symbol [|](bold bright-black) "; + }; + + username = { + format = "[$user]($style) in "; + }; + + directory = { + truncation_length = 2; + + # removes the read_only symbol from the format, it doesn't play nicely with my folder icon + format = "[ ](bold green) [$path]($style) "; + + # the following removes tildes from the path, and substitutes some folders with shorter names + substitutions = { + "~/Dev" = "Dev"; + "~/Documents" = "Docs"; + }; + }; + + # git + git_commit.commit_hash_length = 7; + git_branch.style = "bold purple"; + git_status = { + style = "red"; + ahead = "⇡ "; + behind = "⇣ "; + conflicted = " "; + renamed = "»"; + deleted = "✘ "; + diverged = "⇆ "; + modified = "!"; + stashed = "≡"; + staged = "+"; + untracked = "?"; + }; + + # language configurations + # the whitespaces at the end *are* necessary for proper formatting + lua.symbol = "[ ](blue) "; + python.symbol = "[ ](blue) "; + rust.symbol = "[ ](red) "; + nix_shell.symbol = "[󱄅 ](blue) "; + golang.symbol = "[󰟓 ](blue)"; + c.symbol = "[ ](black)"; + nodejs.symbol = "[󰎙 ](yellow)"; + + package.symbol = "📦 "; + }; + }; +} diff --git a/modules/editors/nvf/mappings/normal.nix b/modules/editors/nvf/mappings/normal.nix index 8f17df7..947b800 100644 --- a/modules/editors/nvf/mappings/normal.nix +++ b/modules/editors/nvf/mappings/normal.nix @@ -4,7 +4,7 @@ # General "fd".action = ":lua vim.g.formatsave = not vim.g.formatsave"; "zt".action = ":let g:default_terminal = v:count1"; - "e".action = ":tf"; + "e".action = ":NvimTreeToggle"; "ld".action = ":lua vim.diagnostic.setqflist({open = true})"; "lf".action = ":lua vim.lsp.buf.format()"; "li".action = ":lua vim.lsp.buf.implementation()"; diff --git a/modules/editors/nvf/runtime/spell/de.utf-8.spl b/modules/editors/nvf/runtime/spell/de.utf-8.spl new file mode 100644 index 0000000..b83bdc1 Binary files /dev/null and b/modules/editors/nvf/runtime/spell/de.utf-8.spl differ diff --git a/modules/gui/schizofox.nix b/modules/gui/schizofox.nix index 23d9bd4..169a2df 100644 --- a/modules/gui/schizofox.nix +++ b/modules/gui/schizofox.nix @@ -99,12 +99,35 @@ in { ]; }; extensions = { - # simplefox.enable = true; + simplefox.enable = true; darkreader.enable = true; - # vimium.enable = true; - extraExtensions = { - "webextension@vimium".install_url = "https://addons.mozilla.org/firefox/downloads/file/4259790/vimium_ff-2.1.2.xpi"; - }; + extraExtensions = let + mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi"; + extensions = [ + { + id = "1018e4d6-728f-4b20-ad56-37578a4de76"; + name = "flagfox"; + } + { + id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}"; + name = "auto-tab-discard"; + } + { + id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}"; + name = "refined-github-"; + } + { + id = "sponsorBlocker@ajay.app"; + name = "sponsorblock"; + } + { + id = "uBlock0@raymondhill.net"; + name = "UBlock Origin"; + } + ]; + extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions; + in + extraExtensions; }; security = { sanitizeOnShutdown = false; diff --git a/modules/styling/ags.nix b/modules/styling/ags.nix index eed7124..c91193b 100644 --- a/modules/styling/ags.nix +++ b/modules/styling/ags.nix @@ -1 +1,31 @@ -_: {} +{ + inputs, + lib, + config, + pkgs, + ... +} +: let + inherit (config.modules.other.system) username; + inherit (lib) mkIf mkEnableOption; + cfg = config.modules.programs.ags; +in { + options.modules.programs.ags.enable = mkEnableOption "ags"; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + imports = [inputs.ags.homeManagerModules.default]; + programs.ags = { + enable = true; + configDir = ./config; + extraPackages = with pkgs; [ + ags + bun + gtksourceview + webkitgtk + accountsservice + ]; + }; + }; + }; +} diff --git a/modules/styling/config/config.js b/modules/styling/config/config.js new file mode 100644 index 0000000..e137af5 --- /dev/null +++ b/modules/styling/config/config.js @@ -0,0 +1,21 @@ +const main = "/tmp/ags/main.js"; + +try { + await Utils.execAsync([ + "bun", + "build", + `${App.configDir}/main.ts`, + "--outfile", + main, + "--external", + "resource://*", + "--external", + "gi://*", + "--external", + "file://*", + ]); + await import(`file://${main}`); +} catch (error) { + console.error(error); + App.quit(); +} diff --git a/modules/styling/config/main.ts b/modules/styling/config/main.ts new file mode 100644 index 0000000..4c0a30b --- /dev/null +++ b/modules/styling/config/main.ts @@ -0,0 +1,219 @@ +const hyprland = await Service.import("hyprland") +const notifications = await Service.import("notifications") +const mpris = await Service.import("mpris") +const audio = await Service.import("audio") +const battery = await Service.import("battery") +const systemtray = await Service.import("systemtray") + +const date = Variable("", { + poll: [1000, 'date "+%H:%M:%S %b %e."'], +}) + +// widgets can be only assigned as a child in one container +// so to make a reuseable widget, make it a function +// then you can simply instantiate one by calling it + +function Workspaces() { + const activeId = hyprland.active.workspace.bind("id") + const workspaces = hyprland.bind("workspaces") + .as(ws => ws.map(({ id }) => Widget.Button({ + on_clicked: () => hyprland.messageAsync(`dispatch workspace ${id}`), + child: Widget.Label(`${id}`), + class_name: activeId.as(i => `${i === id ? "focused" : ""}`), + }))) + + return Widget.Box({ + class_name: "workspaces", + children: workspaces, + }) +} + + +function ClientTitle() { + return Widget.Label({ + class_name: "client-title", + label: hyprland.active.client.bind("title"), + }) +} + + +function Clock() { + return Widget.Label({ + class_name: "clock", + label: date.bind(), + }) +} + + +// we don't need dunst or any other notification daemon +// because the Notifications module is a notification daemon itself +function Notification() { + const popups = notifications.bind("popups") + return Widget.Box({ + class_name: "notification", + visible: popups.as(p => p.length > 0), + children: [ + Widget.Icon({ + icon: "preferences-system-notifications-symbolic", + }), + Widget.Label({ + label: popups.as(p => p[0]?.summary || ""), + }), + ], + }) +} + + +function Media() { + const label = Utils.watch("", mpris, "player-changed", () => { + if (mpris.players[0]) { + const { track_artists, track_title } = mpris.players[0] + return `${track_artists.join(", ")} - ${track_title}` + } else { + return "Nothing is playing" + } + }) + + return Widget.Button({ + class_name: "media", + on_primary_click: () => mpris.getPlayer("")?.playPause(), + on_scroll_up: () => mpris.getPlayer("")?.next(), + on_scroll_down: () => mpris.getPlayer("")?.previous(), + child: Widget.Label({ label }), + }) +} + + +function Volume() { + const icons = { + 101: "overamplified", + 67: "high", + 34: "medium", + 1: "low", + 0: "muted", + } + + function getIcon() { + const icon = audio.speaker.is_muted ? 0 : [101, 67, 34, 1, 0].find( + threshold => threshold <= audio.speaker.volume * 100) + + return `audio-volume-${icons[icon]}-symbolic` + } + + const icon = Widget.Icon({ + icon: Utils.watch(getIcon(), audio.speaker, getIcon), + }) + + const slider = Widget.Slider({ + hexpand: true, + draw_value: false, + on_change: ({ value }) => audio.speaker.volume = value, + setup: self => self.hook(audio.speaker, () => { + self.value = audio.speaker.volume || 0 + }), + }) + + return Widget.Box({ + class_name: "volume", + css: "min-width: 180px", + children: [icon, slider], + }) +} + + +function BatteryLabel() { + const value = battery.bind("percent").as(p => p > 0 ? p / 100 : 0) + const icon = battery.bind("percent").as(p => + `battery-level-${Math.floor(p / 10) * 10}-symbolic`) + + return Widget.Box({ + class_name: "battery", + visible: battery.bind("available"), + children: [ + Widget.Icon({ icon }), + Widget.LevelBar({ + widthRequest: 140, + vpack: "center", + value, + }), + ], + }) +} + + +function SysTray() { + const items = systemtray.bind("items") + .as(items => items.map(item => Widget.Button({ + child: Widget.Icon({ icon: item.bind("icon") }), + on_primary_click: (_, event) => item.activate(event), + on_secondary_click: (_, event) => item.openMenu(event), + tooltip_markup: item.bind("tooltip_markup"), + }))) + + return Widget.Box({ + children: items, + }) +} + + +// layout of the bar +function Left() { + return Widget.Box({ + spacing: 8, + children: [ + Workspaces(), + ClientTitle(), + ], + }) +} + +function Center() { + return Widget.Box({ + spacing: 8, + children: [ + Media(), + Notification(), + ], + }) +} + +function Right() { + return Widget.Box({ + hpack: "end", + spacing: 8, + children: [ + Volume(), + BatteryLabel(), + Clock(), + SysTray(), + ], + }) +} + +function Bar(monitor = 0) { + return Widget.Window({ + name: `bar-${monitor}`, // name has to be unique + class_name: "bar", + monitor, + anchor: ["top", "left", "right"], + exclusivity: "exclusive", + child: Widget.CenterBox({ + start_widget: Left(), + center_widget: Center(), + end_widget: Right(), + }), + }) +} + +App.config({ + style: "./style.css", + windows: [ + Bar(), + + // you can call it, for each monitor + // Bar(0), + // Bar(1) + ], +}) + +export { } diff --git a/modules/styling/config/style.css b/modules/styling/config/style.css new file mode 100644 index 0000000..29f8fdd --- /dev/null +++ b/modules/styling/config/style.css @@ -0,0 +1,40 @@ +window.bar { + background-color: @theme_bg_color; + color: @theme_fg_color; +} + +button { + min-width: 0; + padding-top: 0; + padding-bottom: 0; + background-color: transparent; +} + +button:active { + background-color: @theme_selected_bg_color; +} + +button:hover { + border-bottom: 3px solid @theme_fg_color; +} + +label { + font-weight: bold; +} + +.workspaces button.focused { + border-bottom: 3px solid @theme_selected_bg_color; +} + +.client-title { + color: @theme_selected_bg_color; +} + +.notification { + color: yellow; +} + +levelbar block, +highlight { + min-height: 10px; +} diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index 1b8c92e..9bf42e8 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -53,46 +53,58 @@ in { # Monitor config monitor = [ - "DP-2,1920x1080,0x0,1" - "HDMI-A-2,1920x1080,1920x0,1" - "HDMI-A-1,1920x1080,3840x0,1" + "eDP-1,1920x1080,0x0,1" + # "DP-2,1920x1080,0x0,1" + # "HDMI-A-2,1920x1080,1920x0,1" + # "HDMI-A-1,1920x1080,3840x0,1" # Had the shadow monitor bug, so had to disable all unknown monitors. "Unknown-1,disable" ]; # Workspace config workspace = [ - "1,monitor:HDMI-A-1, default:true" - "2,monitor:HDMI-A-1" - "3,monitor:HDMI-A-1" - "4,monitor:HDMI-A-1" - "5,monitor:HDMI-A-1" - "6,monitor:HDMI-A-1" - "7,monitor:HDMI-A-1" - "8,monitor:HDMI-A-1" - "9,monitor:HDMI-A-1" - "10,monitor:HDMI-A-1" + "1,monitor:eDP-1, default:true" + "2,monitor:eDP-1" + "3,monitor:eDP-1" + "4,monitor:eDP-1" + "5,monitor:eDP-1" + "6,monitor:eDP-1" + "7,monitor:eDP-1" + "8,monitor:eDP-1" + "9,monitor:eDP-1" + "10,monitor:eDP-1" - "11, monitor:HDMI-A-2, default:true" - "12, monitor:HDMI-A-2" - "13, monitor:HDMI-A-2" - "14, monitor:HDMI-A-2" - "15, monitor:HDMI-A-2" - "16, monitor:HDMI-A-2" - "17, monitor:HDMI-A-2" - "18, monitor:HDMI-A-2" - "19, monitor:HDMI-A-2" - "20, monitor:HDMI-A-2" + # "1,monitor:HDMI-A-1, default:true" + # "2,monitor:HDMI-A-1" + # "3,monitor:HDMI-A-1" + # "4,monitor:HDMI-A-1" + # "5,monitor:HDMI-A-1" + # "6,monitor:HDMI-A-1" + # "7,monitor:HDMI-A-1" + # "8,monitor:HDMI-A-1" + # "9,monitor:HDMI-A-1" + # "10,monitor:HDMI-A-1" - "21, monitor:DP-2, default:true" - "22, monitor:DP-2" - "23, monitor:DP-2" - "24, monitor:DP-2" - "25, monitor:DP-2" - "26, monitor:DP-2" - "27, monitor:DP-2" - "28, monitor:DP-2" - "29, monitor:DP-2" - "30, monitor:DP-2" + #"11, monitor:HDMI-A-2, default:true" + #"12, monitor:HDMI-A-2" + #"13, monitor:HDMI-A-2" + #"14, monitor:HDMI-A-2" + #"15, monitor:HDMI-A-2" + #"16, monitor:HDMI-A-2" + #"17, monitor:HDMI-A-2" + #"18, monitor:HDMI-A-2" + #"19, monitor:HDMI-A-2" + #"20, monitor:HDMI-A-2" + # + #"21, monitor:DP-2, default:true" + #"22, monitor:DP-2" + #"23, monitor:DP-2" + #"24, monitor:DP-2" + #"25, monitor:DP-2" + #"26, monitor:DP-2" + #"27, monitor:DP-2" + #"28, monitor:DP-2" + #"29, monitor:DP-2" + #"30, monitor:DP-2" # scratchpads "special:btop, decorate:false" @@ -189,26 +201,48 @@ in { "$mainMod, O, exec, obsidian --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu" # workspaces # split-workspace is because of the split-workspace plugin - "$mainMod, 1, split-workspace, 1" - "$mainMod, 2, split-workspace, 2" - "$mainMod, 3, split-workspace, 3" - "$mainMod, 4, split-workspace, 4" - "$mainMod, 5, split-workspace, 5" - "$mainMod, 6, split-workspace, 6" - "$mainMod, 7, split-workspace, 7" - "$mainMod, 8, split-workspace, 8" - "$mainMod, 9, split-workspace, 9" - "$mainMod, 0, split-workspace, 10" - "$mainMod SHIFT, 1, split-movetoworkspacesilent, 1" - "$mainMod SHIFT, 2, split-movetoworkspacesilent, 2" - "$mainMod SHIFT, 3, split-movetoworkspacesilent, 3" - "$mainMod SHIFT, 4, split-movetoworkspacesilent, 4" - "$mainMod SHIFT, 5, split-movetoworkspacesilent, 5" - "$mainMod SHIFT, 6, split-movetoworkspacesilent, 6" - "$mainMod SHIFT, 7, split-movetoworkspacesilent, 7" - "$mainMod SHIFT, 8, split-movetoworkspacesilent, 8" - "$mainMod SHIFT, 9, split-movetoworkspacesilent, 9" - "$mainMod SHIFT, 0, split-movetoworkspacesilent, 10" + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + "$mainMod SHIFT, 1, movetoworkspacesilent, 1" + "$mainMod SHIFT, 2, movetoworkspacesilent, 2" + "$mainMod SHIFT, 3, movetoworkspacesilent, 3" + "$mainMod SHIFT, 4, movetoworkspacesilent, 4" + "$mainMod SHIFT, 5, movetoworkspacesilent, 5" + "$mainMod SHIFT, 6, movetoworkspacesilent, 6" + "$mainMod SHIFT, 7, movetoworkspacesilent, 7" + "$mainMod SHIFT, 8, movetoworkspacesilent, 8" + "$mainMod SHIFT, 9, movetoworkspacesilent, 9" + "$mainMod SHIFT, 0, movetoworkspacesilent, 10" + + # split-workspace is because of the split-workspace plugin + # "$mainMod, 1, split-workspace, 1" + # "$mainMod, 2, split-workspace, 2" + # "$mainMod, 3, split-workspace, 3" + # "$mainMod, 4, split-workspace, 4" + # "$mainMod, 5, split-workspace, 5" + # "$mainMod, 6, split-workspace, 6" + # "$mainMod, 7, split-workspace, 7" + # "$mainMod, 8, split-workspace, 8" + # "$mainMod, 9, split-workspace, 9" + # "$mainMod, 0, split-workspace, 10" + # "$mainMod SHIFT, 1, split-movetoworkspacesilent, 1" + # "$mainMod SHIFT, 2, split-movetoworkspacesilent, 2" + # "$mainMod SHIFT, 3, split-movetoworkspacesilent, 3" + # "$mainMod SHIFT, 4, split-movetoworkspacesilent, 4" + # "$mainMod SHIFT, 5, split-movetoworkspacesilent, 5" + # "$mainMod SHIFT, 6, split-movetoworkspacesilent, 6" + # "$mainMod SHIFT, 7, split-movetoworkspacesilent, 7" + # "$mainMod SHIFT, 8, split-movetoworkspacesilent, 8" + # "$mainMod SHIFT, 9, split-movetoworkspacesilent, 9" + # "$mainMod SHIFT, 0, split-movetoworkspacesilent, 10" # Move Windows "$mainMod SHIFT, H, movewindow, l" diff --git a/options/common/gpu/nvidia.nix b/options/common/gpu/nvidia.nix index c85efd4..8c0e0fd 100644 --- a/options/common/gpu/nvidia.nix +++ b/options/common/gpu/nvidia.nix @@ -7,7 +7,9 @@ hardware.graphics = { enable = true; package = pkgs.mesa.drivers; - # driSupport32Bit = true; + extraPackages = with pkgs; [ + vpl-gpu-rt + ]; }; hardware.nvidia = { modesetting.enable = true;