diff --git a/TODO.md b/TODO.md index 5e68e9b7..b126f227 100644 --- a/TODO.md +++ b/TODO.md @@ -1,18 +1,31 @@ # To-dos - [ ] Make personal homepage o: +- [ ] Figure out storing bookmarks, lists, data ... - [ ] Make my own quickshell config +- [ ] Look into Matrix and Fedi accounts and setting up app(s) +- [ ] Test performance for virtual machines on laptop and desktop ## New service deployments - [ ] Fauna +- [ ] Jellyfin - [ ] Immich +- [ ] Prosody +- [ ] continuwuation or tuwunnel ## Migrations - [ ] Move away from flakes to either npins or lon (not that they replied; https://github.com/nikstur/lon/issues/57#issue-3652308987) - [ ] Move to a setup similar to https://notashelf.dev/posts/impermanence - investigate encrypted swap WITH hibernation support -- [ ] Move away from gmail fully +- [ ] Move away from Gmail fully - [ ] Move away from Discord primarily + - [x] Cancel Nitro subscription + - [ ] Matrix account(s) + - [ ] XMPP - [ ] Move away from Spotify fully + - [ ] Cancel Spotify subscription - [ ] Move away from Cloudflare for DNS and hosting +- [ ] Move away from the primary bluesky PDS and appview(?) +- [ ] Finish moving away from iPhone + - [ ] Cancel iCloud subscription diff --git a/flake.lock b/flake.lock index fe23a55c..b756781a 100644 --- a/flake.lock +++ b/flake.lock @@ -169,11 +169,11 @@ ] }, "locked": { - "lastModified": 1764720660, - "narHash": "sha256-zrU6DwLb5zXCg6JxfVJyNCJex0LjuTUXchotq44Vn+w=", + "lastModified": 1764847736, + "narHash": "sha256-FMYnfCH2TMNnTJvbc/mraZpRszIL7nc5YI6w/pWNyNs=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "1739cb8049b3184496279dc6a272b56d466ddd58", + "rev": "e3f8349d60d5daf58951b9ccd089fecb79ea5443", "type": "github" }, "original": { @@ -476,6 +476,24 @@ "type": "github" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1762040540, + "narHash": "sha256-z5PlZ47j50VNF3R+IMS9LmzI5fYRGY/Z5O5tol1c9I4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "0010412d62a25d959151790968765a70c436598b", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-schemas": { "locked": { "lastModified": 1721999734, @@ -983,11 +1001,11 @@ ] }, "locked": { - "lastModified": 1764655750, - "narHash": "sha256-tBrcUSu/47u+E+81SUVUpXrqhkcM3Xqg/4taWFI/99k=", + "lastModified": 1764746434, + "narHash": "sha256-6ymFuw+Z1C90ezf8H0BP3c2JFZhJYwMq31px2StwWHU=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "1127a4fc66425cceae683becb93f038819cf2633", + "rev": "b4c0b604148adacf119b89824ed26df8926ce42c", "type": "github" }, "original": { @@ -1315,11 +1333,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1764641206, - "narHash": "sha256-M9GlOr9JKPUJkDb8nsCPr/BF8RAu4pvdXpXdO8wB3uk=", + "lastModified": 1764900011, + "narHash": "sha256-iG5HqIzZ12qzTi3xCwBinw/PR0xNlJNXLLQyV2En1OY=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "de4835b61bcd48b1ddb93df0c25b2dd4c8b4aefd", + "rev": "e1829ce2d33b1e289b3ecca7530dee84da8d9e85", "type": "github" }, "original": { @@ -1489,11 +1507,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1764517877, - "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=", + "lastModified": 1764667669, + "narHash": "sha256-7WUCZfmqLAssbDqwg9cUDAXrSoXN79eEEq17qhTNM/Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c", + "rev": "418468ac9527e799809c900eda37cbff999199b6", "type": "github" }, "original": { @@ -1533,6 +1551,21 @@ "type": "github" } }, + "nixpkgs-lib_3": { + "locked": { + "lastModified": 1761765539, + "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1730741070, @@ -1627,6 +1660,22 @@ "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1761236834, + "narHash": "sha256-+pthv6hrL5VLW2UqPdISGuLiUZ6SnAXdd2DdUE+fV2Q=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d5faa84122bc0a1fd5d378492efce4e289f8eac1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { "flake-parts": [ @@ -1797,7 +1846,52 @@ "type": "github" } }, + "qml-niri": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "nixpkgs" + ], + "quickshell": "quickshell", + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1763154417, + "narHash": "sha256-EMMGP1HRbEcJ1lD/bx7Hv2938l9A3FjADwXM+pBJA2k=", + "owner": "juuyokka", + "repo": "qml-niri", + "rev": "448f27c815f9af550e595c33a1c40d50ba705159", + "type": "github" + }, + "original": { + "owner": "juuyokka", + "ref": "feat-nix-flake", + "repo": "qml-niri", + "type": "github" + } + }, "quickshell": { + "inputs": { + "nixpkgs": [ + "qml-niri", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761897390, + "narHash": "sha256-er4gYrIoThYLjlsOMTysoRfn67d1Gci+ZpqDrtQxrA0=", + "ref": "refs/heads/master", + "rev": "fc704e6b5d445899a1565955268c91942a4f263f", + "revCount": 700, + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/outfoxxed/quickshell" + } + }, + "quickshell_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -1892,7 +1986,8 @@ "norg": "norg", "norg-meta": "norg-meta", "nur": "nur", - "quickshell": "quickshell", + "qml-niri": "qml-niri", + "quickshell": "quickshell_2", "rbw-bitw": "rbw-bitw", "rust": "rust", "rust-overlay": "rust-overlay", @@ -1907,7 +2002,7 @@ "stylix": "stylix", "systems": "systems_4", "tree": "tree", - "treefmt-nix": "treefmt-nix_2", + "treefmt-nix": "treefmt-nix_3", "ucodenix": "ucodenix", "wezterm": "wezterm" } @@ -2427,6 +2522,24 @@ } }, "treefmt-nix_2": { + "inputs": { + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1762410071, + "narHash": "sha256-aF5fvoZeoXNPxT0bejFUBXeUjXfHLSL7g+mjR/p5TEg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "97a30861b13c3731a84e09405414398fbf3e109f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_3": { "inputs": { "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index 56c88243..2d69b644 100644 --- a/flake.nix +++ b/flake.nix @@ -86,6 +86,10 @@ #url = "github:nixos/nixpkgs/nixos-unstable"; #inputs.nixpkgs.follows = "chaotic/nixpkgs"; }; + qml-niri = { + url = "github:juuyokka/qml-niri/feat-nix-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; clipboard-sync = { url = "github:dnut/clipboard-sync"; inputs = { diff --git a/home/environments/niri/noctalia.nix b/home/environments/niri/noctalia.nix index 40a0550b..df9eb04e 100644 --- a/home/environments/niri/noctalia.nix +++ b/home/environments/niri/noctalia.nix @@ -1,10 +1,16 @@ { config, lib, + pkgs, + inputs, ... }: let inherit (lib.meta) getExe; in { + home.packages = [ + pkgs.quickshell + inputs.qml-niri.packages.${pkgs.system}.default + ]; programs.noctalia-shell = { enable = true; settings = { diff --git a/home/profiles/graphical/librewolf/ublock.nix b/home/profiles/graphical/librewolf/ublock.nix index 057f3ddc..d5cbe69c 100644 --- a/home/profiles/graphical/librewolf/ublock.nix +++ b/home/profiles/graphical/librewolf/ublock.nix @@ -1,7 +1,7 @@ {nur, ...}: { programs.librewolf.profiles.main.extensions = { packages = with nur.repos.rycee.firefox-addons; [ - adnauseum + adnauseam ]; settings = { }; diff --git a/nixos/profiles/gaming/sound.nix b/nixos/profiles/gaming/sound.nix deleted file mode 100644 index dc72ac3a..00000000 --- a/nixos/profiles/gaming/sound.nix +++ /dev/null @@ -1,5 +0,0 @@ -_: { - services.pipewire.lowLatency = { - enable = true; - }; -} diff --git a/nixos/profiles/gaming/steam.nix b/nixos/profiles/gaming/steam.nix index d32e1aa0..60a8d78e 100644 --- a/nixos/profiles/gaming/steam.nix +++ b/nixos/profiles/gaming/steam.nix @@ -6,7 +6,6 @@ programs.steam = { enable = true; remotePlay.openFirewall = true; - platformOptimizations.enable = true; extraCompatPackages = [ inputs.chaotic.packages.${pkgs.system}.proton-cachyos_x86_64_v3 inputs.chaotic.packages.${pkgs.system}.proton-ge-custom diff --git a/nixos/profiles/gaming/wine.nix b/nixos/profiles/gaming/wine.nix index 7acf1c96..e72e33be 100644 --- a/nixos/profiles/gaming/wine.nix +++ b/nixos/profiles/gaming/wine.nix @@ -24,8 +24,8 @@ in { PROTON_EXPERIMENTAL = "/games/Steam Library/steamapps/common/Proton - Experimental"; PROTON_HOTFIX = "/games/Steam Library/steamapps/common/Proton Hotfix/"; PROTON_VRC = "/home/kat/.local/share/Steam/compatibilitytools.d/GE-Proton10-20-rtsp19/"; - WINE_TKG = pkgs.wine-tkg; - WINE_CACHYOS = pkgs.wine-cachyos; + WINE_TKG = inputs.nix-gaming.packages.${pkgs.system}.wine-tkg; + WINE_CACHYOS = inputs.nix-gaming.packages.${pkgs.system}.wine-cachyos; }; pathPackages = with pkgs; [ mangohud @@ -347,9 +347,11 @@ in { home-manager.users.kat.home.file = let inherit (lib.attrsets) listToAttrs nameValuePair attrNames; inherit (lib.lists) concatMap; - dxvks = { - "x64" = pkgs.dxvk-w32; - "x32" = pkgs.dxvk-w64; + dxvks = let + gaming = inputs.nix-gaming.packages.${pkgs.system}; + in { + "x64" = gaming.dxvk-w32; + "x32" = gaming.dxvk-w64; }; pfxes = [ "Games/VNs/drive_c/windows" diff --git a/nixos/profiles/graphical/sound.nix b/nixos/profiles/graphical/sound.nix index 3f7fbbed..1c1ac372 100644 --- a/nixos/profiles/graphical/sound.nix +++ b/nixos/profiles/graphical/sound.nix @@ -29,6 +29,21 @@ in { "default.clock.min-quantum" = ll_quant_int; "default.clock.max-quantum" = hl_quant_int; }; + "context.modules" = [ + { + name = "libpipewire-module-rt"; + flags = [ + "ifexists" + "nofail" + ]; + args = { + "nice.level" = -15; + "rt.prio" = 88; + "rt.time.soft" = 200000; + "rt.time.hard" = 200000; + }; + } + ]; }; pipewire-pulse = { "91-discord-latency" = { diff --git a/nixos/profiles/performance/kernel.nix b/nixos/profiles/performance/kernel.nix index 1d07b03e..965a6f97 100644 --- a/nixos/profiles/performance/kernel.nix +++ b/nixos/profiles/performance/kernel.nix @@ -1,4 +1,5 @@ {pkgs, ...}: { - boot.zfs.package = pkgs.zfs_cachyos; - boot.kernelPackages = pkgs.linuxPackages_cachyos; + #boot.zfs.package = pkgs.zfs_cachyos; + #boot.kernelPackages = pkgs.linuxPackages_cachyos; + boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_stable; } diff --git a/nixos/servers/forgejo-runner/forgejo-runner.nix b/nixos/servers/forgejo-runner/forgejo-runner.nix index c777921e..d9d41475 100644 --- a/nixos/servers/forgejo-runner/forgejo-runner.nix +++ b/nixos/servers/forgejo-runner/forgejo-runner.nix @@ -33,7 +33,7 @@ }; networking.firewall.interfaces."podman*".allowedUDPPorts = [53]; services.gitea-actions-runner = { - package = pkgs.forgejo-actions-runner; + package = pkgs.forgejo-runner; instances.default = { enable = true; name = config.networking.hostName; diff --git a/nixvim/plugins/lsp.nix b/nixvim/plugins/lsp.nix index e2e95149..c372b485 100644 --- a/nixvim/plugins/lsp.nix +++ b/nixvim/plugins/lsp.nix @@ -34,6 +34,9 @@ in { (genAttrs serversToGen (_: baseServer)) (genAttrs disabledPackageServers (_: disablePackage)) { + qmlls.config = { + cmd = "-E"; + }; } ]; plugins = let @@ -65,7 +68,6 @@ in { bash json make - qml markdown regex toml diff --git a/overlays.nix b/overlays.nix index cfebdb59..a39e4f2b 100644 --- a/overlays.nix +++ b/overlays.nix @@ -38,7 +38,6 @@ inputs.darwin.overlays.default inputs.deploy-rs.overlays.default inputs.neorg-overlay.overlays.default - inputs.nix-gaming.overlays.default inputs.niri.overlays.niri (import tree.packages.default {inherit inputs tree;}) (_final: prev: { diff --git a/quickshell/Components/Clock.qml b/quickshell/Components/Clock.qml new file mode 100644 index 00000000..69492297 --- /dev/null +++ b/quickshell/Components/Clock.qml @@ -0,0 +1,12 @@ +import QtQuick +import QtQuick.Layouts +import "root:/DataSources" + +Text { + id: clock + font.pointSize: 13 + color: Settings.variable + Layout.alignment: Qt.AlignCenter + + text: Time.time +} diff --git a/quickshell/Components/DistroIcon.qml b/quickshell/Components/DistroIcon.qml new file mode 100644 index 00000000..6557282a --- /dev/null +++ b/quickshell/Components/DistroIcon.qml @@ -0,0 +1,11 @@ +import Quickshell +import QtQuick +import "root:/Helpers" + +Image { + id: root + source: ThemeIcons.iconFromName("nix-snowflake", "") + sourceSize.width: 24 + sourceSize.height: 24 + visible: true +} diff --git a/quickshell/Components/FocusedWindow.qml b/quickshell/Components/FocusedWindow.qml new file mode 100644 index 00000000..1e832649 --- /dev/null +++ b/quickshell/Components/FocusedWindow.qml @@ -0,0 +1,49 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell +import Niri 0.1 +import "root:/DataSources" +import "root:/Helpers" + +RowLayout { + id: root + property string title: get_text() + property string icon_path: get_icon() + property string app_id: get_app_id() + + function get_app_id() { + var app_id = niri.focusedWindow?.appId; + return app_id + } + + function get_text() { + var full_title = niri.focusedWindow?.title ?? ""; + var shortened_title = full_title.substring(0, 20); + if (full_title.length > 20) { + shortened_title += "…" + } + return shortened_title + } + + function get_icon() { + var icon = ThemeIcons.iconForAppId(app_id); + if (icon && icon !== "") { + return icon + } + } + + spacing: 10 + + Image { + anchors.verticalCenter: parent.verticalCenter + source: icon_path + visible: title != "" + sourceSize.width: 24 + sourceSize.height: 24 + smooth: true + } + Text { + text: title + color: Settings.defaultFg + } +} diff --git a/quickshell/Components/SystemTray.qml b/quickshell/Components/SystemTray.qml new file mode 100644 index 00000000..81331b79 --- /dev/null +++ b/quickshell/Components/SystemTray.qml @@ -0,0 +1,126 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell +import QtQuick.Controls +import Quickshell.Widgets +import Quickshell.Services.SystemTray +import "root:/DataSources" + +RowLayout { + id: systray + + Layout.alignment: Qt.AlignCenter + + Repeater { + model: SystemTray.items + + delegate: Item { + id: delagate + required property SystemTrayItem modelData + property var openItem + + width: 24 + height: 24 + + IconImage { + source: modelData.icon + width: 20 + height: 20 + anchors.centerIn: parent + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + + onClicked: popupLoader.item.visible = !popupLoader.item.visible + } + + QsMenuOpener { + id: menu + menu: modelData.menu + } + + LazyLoader { + id: popupLoader + + loading: true + + PopupWindow { + id: popup + anchor.window: delagate.QsWindow.window + anchor.rect.x: parentWindow.width * 1.15 + anchor.rect.y: parentWindow.height / 1.25 + + color: "transparent" + + implicitWidth: 200 + implicitHeight: 200 + + Rectangle { + anchors.fill: parent + color: Settings.colors.background + radius: 5 + } + + ListView { + model: menu.children + + anchors { + top: parent.top + topMargin: 5 + bottom: parent.bottom + bottomMargin: 5 + } + + width: parent.width + height: parent.height + spacing: 5 + + ScrollBar.horizontal: ScrollBar {} + + delegate: Item { + required property QsMenuHandle modelData + + width: parent.width + height: 40 + + Rectangle { + anchors { + fill: parent + leftMargin: 5 + rightMargin: 5 + } + + color: Settings.colors.backgroundLighter + radius: 5 + + Text { + anchors.centerIn: parent + text: modelData.text + color: Settings.colors.foreground + font.pointSize: 12 + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + + onClicked: mouse => { + modelData.triggered(); + // TODO: moar + var idx = ObjectModel.indexOf(modelData); + if (openItem && openItem.idx != idx) { + + } + popup.visible = false; + } + } + } + } + } + } + } + } + } +} diff --git a/quickshell/Components/WorkspaceButton.qml b/quickshell/Components/WorkspaceButton.qml new file mode 100644 index 00000000..173b7a92 --- /dev/null +++ b/quickshell/Components/WorkspaceButton.qml @@ -0,0 +1,70 @@ +import QtQuick +import QtQuick.Layouts +import "root:/DataSources" + +Item { + property var modelData + property var screenData + + property int index: modelData.index + property string name: modelData.name + property string generated_name: gen_text() + property bool isVisible: modelData.output == screenData.name + + id: root + + function gen_text() { + if (name.length == 0) { + return index + } else { + return name + } + } + + function gen_width() { + if (isVisible) { + return 10 + (generated_name.length * 15) + } else { + return 0 + } + } + + function get_color() { + if (modelData.isUrgent) { + return Settings.base0F + } + if (modelData.isFocused) { + return Settings.base0E + } + if (modelData.isActive) { + return Settings.base0C + } + if (modelData.activeWindowId > 0) { + return Settings.base0F + } + return Settings.lighterBg + } + + visible: isVisible + implicitHeight: 25 + implicitWidth: gen_width() + + Rectangle { + anchors.fill: parent + color: get_color() + radius: 5 + + Text { + anchors.centerIn: parent + color: Settings.defaultBg + text: gen_text() + font.pixelSize: 20 + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: niri.focusWorkspaceById(modelData.id) + } + } +} diff --git a/quickshell/Components/Workspaces.qml b/quickshell/Components/Workspaces.qml new file mode 100644 index 00000000..a168a090 --- /dev/null +++ b/quickshell/Components/Workspaces.qml @@ -0,0 +1,24 @@ +import QtQuick +import QtQuick.Layouts +import "root:/DataSources" +import "root:/Components" +import Niri 0.1 + +import QtQuick +import QtQuick.Layouts +import Quickshell + +RowLayout { + id: root + property var screen + spacing: 10 + + Repeater { + model: niri.workspaces + + WorkspaceButton { + modelData: model + screenData: screen + } + } +} diff --git a/quickshell/DataSources/Settings.qml b/quickshell/DataSources/Settings.qml new file mode 100644 index 00000000..1f44af25 --- /dev/null +++ b/quickshell/DataSources/Settings.qml @@ -0,0 +1,97 @@ +pragma Singleton + +import QtQuick +import Quickshell +import Quickshell.Io + +Singleton { + id: root + readonly property Scheme scheme: Scheme {} + + readonly property color base00: scheme.base00 + readonly property color base01: scheme.base01 + readonly property color base02: scheme.base02 + readonly property color base03: scheme.base03 + readonly property color base04: scheme.base04 + readonly property color base05: scheme.base05 + readonly property color base06: scheme.base06 + readonly property color base07: scheme.base07 + readonly property color base08: scheme.base08 + readonly property color base09: scheme.base09 + readonly property color base0A: scheme.base0A + readonly property color base0B: scheme.base0B + readonly property color base0C: scheme.base0C + readonly property color base0D: scheme.base0D + readonly property color base0E: scheme.base0E + readonly property color base0F: scheme.base0F + readonly property color defaultBg: scheme.defaultBg + readonly property color lighterBg: scheme.lighterBg + readonly property color selectionBg: scheme.selectionBg + readonly property color comments: scheme.comments + readonly property color darkFg: scheme.darkFg + readonly property color defaultFg: scheme.defaultFg + readonly property color lightFg: scheme.lightFg + readonly property color lightBg: scheme.lightBg + readonly property color variable: scheme.variable + readonly property color integer: scheme.integer + readonly property color classy: scheme.classy + readonly property color stringy: scheme.stringy + readonly property color support: scheme.support + readonly property color functiony: scheme.functiony + readonly property color keyword: scheme.keyword + readonly property color deprecated: scheme.deprecated + + function load(data: string): void { + const colours = scheme; + const scheme_json = JSON.parse(data); + + for (const [name, colour] of Object.entries(scheme_json)) { + colours[name] = colour + } + } + + FileView { + path: "./stylix.json" + blockLoading: true + watchChanges: true + onFileChanged: reload() + onLoaded: root.load(text(), false) + } + component Scheme: QtObject { + property string author: "" + property string scheme: "" + property string slug: "" + property color base00: "#000000" + property color base01: "#000000" + property color base02: "#000000" + property color base03: "#000000" + property color base04: "#000000" + property color base05: "#000000" + property color base06: "#000000" + property color base07: "#000000" + property color base08: "#000000" + property color base09: "#000000" + property color base0A: "#000000" + property color base0B: "#000000" + property color base0C: "#000000" + property color base0D: "#000000" + property color base0E: "#000000" + property color base0F: "#000000" + property color defaultBg: "#000000" + property color lighterBg: "#000000" + property color selectionBg: "#000000" + property color comments: "#000000" + property color darkFg: "#000000" + property color defaultFg: "#000000" + property color lightFg: "#000000" + property color lightBg: "#000000" + property color variable: "#000000" + property color integer: "#000000" + property color classy: "#000000" + property color stringy: "#000000" + property color support: "#000000" + property color functiony: "#000000" + property color keyword: "#000000" + property color deprecated: "#000000" + } +} diff --git a/quickshell/DataSources/Time.qml b/quickshell/DataSources/Time.qml new file mode 100644 index 00000000..c1f25bea --- /dev/null +++ b/quickshell/DataSources/Time.qml @@ -0,0 +1,16 @@ +pragma Singleton + +import Quickshell +import QtQuick + +Singleton { + id: root + readonly property string time: { + Qt.formatDateTime(clock.date, "yyyy-MM-dd hh:mm:ss t") + } + + SystemClock { + id: clock + precision: SystemClock.Seconds + } +} diff --git a/quickshell/Helpers/ThemeIcons.qml b/quickshell/Helpers/ThemeIcons.qml new file mode 100644 index 00000000..b644840c --- /dev/null +++ b/quickshell/Helpers/ThemeIcons.qml @@ -0,0 +1,53 @@ +// https://github.com/noctalia-dev/noctalia-shell/blob/main/Commons/ThemeIcons.qml +pragma Singleton + +import QtQuick +import Quickshell + +Singleton { + id: root + + function iconFromName(iconName, fallbackName) { + const fallback = fallbackName || "application-x-executable"; + try { + if (iconName && typeof Quickshell !== 'undefined' && Quickshell.iconPath) { + const p = Quickshell.iconPath(iconName, fallback); + if (p && p !== "") + return p; + } + } catch (e) + + // ignore and fall back + {} + try { + return Quickshell.iconPath ? (Quickshell.iconPath(fallback, true) || "") : ""; + } catch (e2) { + return ""; + } + } + + // Resolve icon path for a DesktopEntries appId - safe on missing entries + function iconForAppId(appId, fallbackName) { + const fallback = fallbackName || "application-x-executable"; + if (!appId) + return iconFromName(fallback, fallback); + try { + if (typeof DesktopEntries === 'undefined' || !DesktopEntries.byId) + return iconFromName(fallback, fallback); + const entry = (DesktopEntries.heuristicLookup) ? DesktopEntries.heuristicLookup(appId) : DesktopEntries.byId(appId); + const name = entry && entry.icon ? entry.icon : ""; + return iconFromName(name || fallback, fallback); + } catch (e) { + return iconFromName(fallback, fallback); + } + } + + // Distro logo helper (absolute path or empty string) + function distroLogoPath() { + try { + return (typeof OSInfo !== 'undefined' && OSInfo.distroIconPath) ? OSInfo.distroIconPath : ""; + } catch (e) { + return ""; + } + } +} diff --git a/quickshell/Modules/Bar.qml b/quickshell/Modules/Bar.qml new file mode 100644 index 00000000..790659e2 --- /dev/null +++ b/quickshell/Modules/Bar.qml @@ -0,0 +1,80 @@ +import Quickshell +import Quickshell.Io +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import "root:/DataSources" +import "root:/Components" + +Scope { + id: root + + Variants { + model: Quickshell.screens + + PanelWindow { + property var modelData + screen: modelData + implicitHeight: 40 + color: "transparent" + + anchors { + top: true + left: true + right: true + } + + margins { + left: 4 + right: 4 + top: 4 + bottom: 4 + } + + Rectangle { + id: bar + anchors.fill: parent + radius: 10 + color: Settings.defaultBg + + RowLayout { + anchors { + left: parent.left + top: parent.top + bottom: parent.bottom + + leftMargin: 10 + } + + spacing: 15 + + Workspaces { + screen: modelData + } + FocusedWindow {} + } + + RowLayout { + anchors.centerIn: parent + spacing: 20 + } + + RowLayout { + anchors { + top: parent.top + bottom: parent.bottom + right: parent.right + + rightMargin: 15 + } + + spacing: 15 + + SystemTray {} + Clock {} + DistroIcon {} + } + } + } + } +} diff --git a/quickshell/expr.nix b/quickshell/expr.nix new file mode 100644 index 00000000..ce0567d7 --- /dev/null +++ b/quickshell/expr.nix @@ -0,0 +1,31 @@ +{hostname}: let + nixfiles = import ../.; + inherit (nixfiles) lib nixosConfigurations; + palette' = nixosConfigurations.${hostname}.config.stylix.generated.palette; + palette = lib.mapAttrs (k: v: + if (lib.strings.hasPrefix "base" k) + then "#${lib.strings.toUpper v}" + else v) + palette'; + paletteWithAliases = palette: { + defaultBg = palette.base00; + lighterBg = palette.base01; + selectionBg = palette.base02; + comments = palette.base03; + darkFg = palette.base04; + defaultFg = palette.base05; + lightFg = palette.base06; + lightBg = palette.base07; + variable = palette.base08; + integer = palette.base09; + classy = palette.base0A; + stringy = palette.base0B; + support = palette.base0C; + functiony = palette.base0D; + keyword = palette.base0E; + deprecated = palette.base0F; + }; + fullPalette = palette // (paletteWithAliases palette); +in { + expr = fullPalette; +} diff --git a/quickshell/shell.qml b/quickshell/shell.qml index 7e834803..f913b7a3 100644 --- a/quickshell/shell.qml +++ b/quickshell/shell.qml @@ -1,48 +1,22 @@ import Quickshell import Quickshell.Io import QtQuick +import Niri 0.1 -Scope { - id: root - property string time +import "root:/Modules" - Variants { - model: Quickshell.screens +ShellRoot{ + id: root - PanelWindow { - required property var modelData - screen: modelData + Niri { + id: niri + Component.onCompleted: connect() - anchors { - top: true - left: true - right: true - } - - implicitHeight: 30 - - Text { - font.family: "M+2 Nerd Font Regular" - anchors.centerIn: parent - text: root.time - } + onConnected: console.info("Connected to niri") + onErrorOccurred: function(error) { + console.error("Niri error:", error) + } } - } - Process { - id: dateProc - command: ["date", "+%F %T %Z"] - running: true - - stdout: StdioCollector { - onStreamFinished: root.time = this.text - } - } - - Timer { - interval: 1000 - running: true - repeat: true - onTriggered: dateProc.running = true - } + LazyLoader{ active: true; component: Bar{} } } diff --git a/quickshell/stylix.json b/quickshell/stylix.json new file mode 100644 index 00000000..608a5f9e --- /dev/null +++ b/quickshell/stylix.json @@ -0,0 +1 @@ +{"author":"Stylix","base00":"#191A2D","base01":"#4F415B","base02":"#6363AC","base03":"#A39AB2","base04":"#B1B8D5","base05":"#D5CEEB","base06":"#D8CCEA","base07":"#D8CDEA","base08":"#7D8CC9","base09":"#908EAB","base0A":"#9B8AA9","base0B":"#948BB5","base0C":"#8391B0","base0D":"#6693D8","base0E":"#9C85CC","base0F":"#AB83A0","classy":"#9B8AA9","comments":"#A39AB2","darkFg":"#B1B8D5","defaultBg":"#191A2D","defaultFg":"#D5CEEB","deprecated":"#AB83A0","functiony":"#6693D8","integer":"#908EAB","keyword":"#9C85CC","lightBg":"#D8CDEA","lightFg":"#D8CCEA","lighterBg":"#4F415B","scheme":"Stylix","selectionBg":"#6363AC","slug":"stylix","stringy":"#948BB5","support":"#8391B0","variable":"#7D8CC9"} diff --git a/quickshell/stylix.sh b/quickshell/stylix.sh new file mode 100755 index 00000000..dd9ab085 --- /dev/null +++ b/quickshell/stylix.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +HOST=$(hostname -s) +nix eval --argstr hostname "$HOST" -f expr.nix --json expr > ./stylix.json diff --git a/systems/goliath.nix b/systems/goliath.nix index 0a8c0570..ca4f68e9 100644 --- a/systems/goliath.nix +++ b/systems/goliath.nix @@ -137,6 +137,11 @@ _: let x = 1920; y = 0; }; + mode = { + width = 2560; + height = 1440; + refresh = 59.951; + }; }; "Samsung Electric Company SAMSUNG Unknown" = { position = { diff --git a/systems/rinnosuke.nix b/systems/rinnosuke.nix index 2f43245f..60687897 100644 --- a/systems/rinnosuke.nix +++ b/systems/rinnosuke.nix @@ -53,14 +53,14 @@ _: let ipv6.addresses = [ { address = "2602:ffd5:1:301::1a"; - prefixLength = 64; + prefixLength = 36; } ]; }; defaultGateway = "154.12.117.33"; defaultGateway6 = { address = "2602:ffd5:1:100::1"; - interface = "ens18"; + interface = "ens19"; }; nameservers = [ "1.1.1.1" diff --git a/tree.nix b/tree.nix index 5fab3270..0eb3653f 100644 --- a/tree.nix +++ b/tree.nix @@ -93,8 +93,6 @@ chaotic.nixosModules.default nixpkgs-xr.nixosModules.nixpkgs-xr spicetify-nix.nixosModules.spicetify - nix-gaming.nixosModules.pipewireLowLatency - nix-gaming.nixosModules.platformOptimizations clipboard-sync.nixosModules.default nixos-cli.nixosModules.nixos-cli stylix.nixosModules.stylix