From 009607df364cce2f73872722fb8ee242dbcc5859 Mon Sep 17 00:00:00 2001 From: Quinn Unger Date: Tue, 18 Aug 2026 17:02:45 +0100 Subject: [PATCH] moved sidonia config into dotfiles. TODO: remove up unnecessary flakes --- common/hm/programs/zsh.nix | 8 +- common/os/configuration.nix | 2 - common/os/default.nix | 1 - common/os/programs/steam.nix | 1 - flake.lock | 464 ++++++---- flake.nix | 98 +- homeModules/bemenu.nix | 39 + homeModules/default.nix | 24 + homeModules/discord.nix | 45 + homeModules/gtkwave.nix | 135 +++ homeModules/helix.nix | 46 + homeModules/hyprland.nix | 42 + homeModules/keybinds.nix | 88 ++ homeModules/niri.nix | 45 + homeModules/noctalia.nix | 135 +++ homeModules/sublimeMerge.nix | 866 ++++++++++++++++++ homeModules/sublimeText.nix | 105 +++ homeModules/surfer.nix | 146 +++ homeModules/vesktop.nix | 13 + homeModules/window.nix | 32 + hosts/yuhata/home/wayvr.nix | 14 +- .../os/modules => nixosModules}/default.nix | 3 +- .../distributedBuilds.nix | 0 .../os/modules => nixosModules}/netbird.nix | 0 nixosModules/sidonia.nix | 157 ++++ {common/os/modules => nixosModules}/vr.nix | 0 overlays.nix | 60 ++ 27 files changed, 2365 insertions(+), 204 deletions(-) create mode 100644 homeModules/bemenu.nix create mode 100644 homeModules/default.nix create mode 100644 homeModules/discord.nix create mode 100644 homeModules/gtkwave.nix create mode 100644 homeModules/helix.nix create mode 100644 homeModules/hyprland.nix create mode 100644 homeModules/keybinds.nix create mode 100644 homeModules/niri.nix create mode 100644 homeModules/noctalia.nix create mode 100644 homeModules/sublimeMerge.nix create mode 100644 homeModules/sublimeText.nix create mode 100644 homeModules/surfer.nix create mode 100644 homeModules/vesktop.nix create mode 100644 homeModules/window.nix rename {common/os/modules => nixosModules}/default.nix (86%) rename {common/os/modules => nixosModules}/distributedBuilds.nix (100%) rename {common/os/modules => nixosModules}/netbird.nix (100%) create mode 100644 nixosModules/sidonia.nix rename {common/os/modules => nixosModules}/vr.nix (100%) create mode 100644 overlays.nix diff --git a/common/hm/programs/zsh.nix b/common/hm/programs/zsh.nix index f05f28a..315bd8f 100644 --- a/common/hm/programs/zsh.nix +++ b/common/hm/programs/zsh.nix @@ -20,11 +20,13 @@ programs.oh-my-posh.settings = let - palette = lib.mapAttrs (n: v: "#${v}") config.catppuccin.lib.color; + cfg = config.catppuccin; + palette = + lib.mapAttrs (n: v: v.hex) + (lib.importJSON "${cfg.sources.palette}/palette.json").${cfg.flavor}.colors; in - with palette; + with palette // { accent = palette.${cfg.accent}; }; { - # builtins.toJSON "$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json"; properties = { upgrade_notice = false; diff --git a/common/os/configuration.nix b/common/os/configuration.nix index 289e95f..a04f4ff 100644 --- a/common/os/configuration.nix +++ b/common/os/configuration.nix @@ -128,8 +128,6 @@ lib.mkMerge [ lfs.enable = true; }; - nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ diff --git a/common/os/default.nix b/common/os/default.nix index bca0516..cf5474f 100644 --- a/common/os/default.nix +++ b/common/os/default.nix @@ -15,6 +15,5 @@ in ./programs ./services ./tweaks - ./modules ]; } diff --git a/common/os/programs/steam.nix b/common/os/programs/steam.nix index 3cccdc0..e134684 100644 --- a/common/os/programs/steam.nix +++ b/common/os/programs/steam.nix @@ -26,7 +26,6 @@ in localNetworkGameTransfers.openFirewall = lib.mkDefault true; extest.enable = lib.mkDefault true; extraCompatPackages = [ - pkgs.dwproton pkgs.proton-ge-bin pkgs.steam-play-none ]; diff --git a/flake.lock b/flake.lock index a40b8de..bc0754d 100644 --- a/flake.lock +++ b/flake.lock @@ -2,8 +2,8 @@ "nodes": { "aagl": { "inputs": { - "flake-compat": "flake-compat_2", - "nixpkgs": "nixpkgs_3", + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" }, "locked": { @@ -39,7 +39,7 @@ }, "catppuccin": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1780143400, @@ -56,27 +56,6 @@ "type": "github" } }, - "dw-proton": { - "inputs": { - "nixpkgs": [ - "sidonia", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1786162797, - "narHash": "sha256-HJjtLgoaJbvHauDG9JV/PgMIZW2ZZMRza7exvwUs+U4=", - "owner": "imaviso", - "repo": "dwproton-flake", - "rev": "e3b7f3772c9b07a35823eac00255ec2e6c0eb6f1", - "type": "github" - }, - "original": { - "owner": "imaviso", - "repo": "dwproton-flake", - "type": "github" - } - }, "fenix": { "inputs": { "nixpkgs": [ @@ -123,11 +102,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1747046372, - "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", "owner": "edolstra", "repo": "flake-compat", - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", "type": "github" }, "original": { @@ -139,11 +118,11 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1767039857, - "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "owner": "edolstra", "repo": "flake-compat", - "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -183,7 +162,6 @@ "flake-utils": { "inputs": { "systems": [ - "sidonia", "nixpkgs-xr", "systems" ] @@ -244,7 +222,7 @@ }, "helix": { "inputs": { - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay_2" }, "locked": { @@ -275,14 +253,14 @@ }, "home-manager": { "inputs": { - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1785119570, - "narHash": "sha256-Rgs2xKnGLFWQscxUaXX07oyZeuMDOHEbqDOsgliLFGM=", + "lastModified": 1786924861, + "narHash": "sha256-hftabkb+73OcGzvwFAjCiQorAhprs9TnU1+FkGO5CIw=", "owner": "nix-community", "repo": "home-manager", - "rev": "d4fd24667c8cbef124bb70a20380cab75ec8474d", + "rev": "09ae1b85a6db412d841d60f924b23f881f0d0a38", "type": "github" }, "original": { @@ -292,6 +270,27 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "zen-browser", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1786719456, + "narHash": "sha256-B74DLQs/VjlqyhnnX3tguWwghqJHWSJX30TKZuAljIg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "83b7606dcf44abe3a94b86e8bb2b3355d22e8797", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "htmx-src": { "flake": false, "locked": { @@ -419,7 +418,7 @@ }, "moppkgs": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1786116588, @@ -428,28 +427,25 @@ "rev": "4c8511e9b44fa01cb33e5e1fd363e6fc9076da4e", "revCount": 47, "type": "git", - "url": "https://tangled.org/moppu.dev/moppkgs" + "url": "https://knot.moppu.dev/did:plc:hv3kvjufxykn2w4mriztfkhj/" }, "original": { "type": "git", - "url": "https://tangled.org/moppu.dev/moppkgs" + "url": "https://knot.moppu.dev/did:plc:hv3kvjufxykn2w4mriztfkhj/" } }, "niri": { "inputs": { "niri-unstable": "niri-unstable", - "nixpkgs": [ - "sidonia", - "nixpkgs" - ], + "nixpkgs": "nixpkgs_6", "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1786752088, - "narHash": "sha256-tmZRrERoCnWGZ9NtdPDD72kPa2kl+LmmJt194SSuU4o=", + "lastModified": 1786924931, + "narHash": "sha256-4DE1SAxtJSiTNnt+o8bTOC4koT/itZlDX8zaKbXvIbU=", "ref": "refs/heads/main", - "rev": "01cb364fdb88786c0059fa80a2b539aa3a54e58e", - "revCount": 169, + "rev": "59dc01c8c5f43f7ad4e1225fd58953221d0b7780", + "revCount": 170, "type": "git", "url": "https://codeberg.org/bananad3v/niri-nix" }, @@ -461,7 +457,6 @@ "niri-legacy": { "inputs": { "nixpkgs": [ - "sidonia", "nixpkgs" ], "rust-overlay": "rust-overlay_3" @@ -499,18 +494,16 @@ }, "nix-minecraft": { "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "nixpkgs" - ], + "flake-compat": "flake-compat_2", + "nixpkgs": "nixpkgs_7", "systems": "systems" }, "locked": { - "lastModified": 1786757983, - "narHash": "sha256-Htc1CLWuzuZCO7RynXnckl2nvX6CpeQZ+7zByfJJwbE=", + "lastModified": 1787017184, + "narHash": "sha256-Zxn+F7RilDLeY5jWRWs35GjzF6+kOPx68vTHT+3QP3g=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "4c1aa0eeac8368ff4d1a45a7259f2b50bc657f05", + "rev": "98c732a980f4fc4154e38ad65148c513b9624344", "type": "github" }, "original": { @@ -521,10 +514,7 @@ }, "nix-monitored": { "inputs": { - "nixpkgs": [ - "sidonia", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1778497292, @@ -542,14 +532,14 @@ }, "nix-vscode-extensions": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_9" }, "locked": { - "lastModified": 1786757691, - "narHash": "sha256-0OhLos8LapEriD+2Qbxk8wkUI0XA4JQG8YIi/Ni80mE=", + "lastModified": 1787016972, + "narHash": "sha256-6B98mtehXRht8nSiX+1tqm8WyeQvjCjhf8IjCKLh/dU=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "0a01f92ee43468cd39d1adbca05b1851c7253c98", + "rev": "596319216632f6e6da839787295a350c027d39be", "type": "github" }, "original": { @@ -560,15 +550,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1785989512, - "narHash": "sha256-HFQhkQcl5D1hUNoen3SGHCSFCt2Bg6uP+HgbrnA3InQ=", - "owner": "NixOS", + "lastModified": 1785858998, + "narHash": "sha256-fKCq5jphd6l/Ms6gc3dptkw/TcKLYub9lQE5g6rbbkc=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "445d861c6d31b4af0c79d8d4be2331f762a361d7", + "rev": "04607e1165ac22c5fde6dcc54c9e0b3c0487c555", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixos-26.05", "repo": "nixpkgs", "type": "github" @@ -578,17 +568,17 @@ "inputs": { "flake-compat": "flake-compat_3", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_11", "nvfetcher": "nvfetcher", "systems": "systems_2", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1786673985, - "narHash": "sha256-3vslo8fVSsazKJTdkGaiV2+gRhC03tIvFmzBVNFeU0M=", + "lastModified": 1787015473, + "narHash": "sha256-x7DlR0Dugz1148+Qi7pIUBWwbHrv4e/GxsATrh7jFsE=", "owner": "nix-community", "repo": "nixpkgs-xr", - "rev": "385d5f569b97642d4c2f3be7f2dd2a46401f70fe", + "rev": "c9884f71ee2ffa2755f97425891a41b9034571ec", "type": "github" }, "original": { @@ -597,13 +587,13 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_10": { "locked": { - "lastModified": 1786711500, - "narHash": "sha256-QvnceIGTBeDvDd9oCn+GvdsnkquliuwbVgpiRH68qaQ=", + "lastModified": 1786943417, + "narHash": "sha256-b4qgjdFtlz5TAZ1Hi7DFJeqX3sjaDUnrwr9OO+O1rM0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "02e08985a27c65ffd33d434eeb2e660a2e4dc84d", + "rev": "0dd31db7e6dbf9ce05697c4545f6fe01accec994", "type": "github" }, "original": { @@ -613,13 +603,103 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_11": { "locked": { - "lastModified": 1785858998, - "narHash": "sha256-fKCq5jphd6l/Ms6gc3dptkw/TcKLYub9lQE5g6rbbkc=", + "lastModified": 1786862985, + "narHash": "sha256-FBJRXmbGXiSUDvYEbfLYRkckayyZ6SK1UEqhCrIZ2Cs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e5bdc4a41d4c072fe1e3787eaa0320a384741d44", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_12": { + "locked": { + "lastModified": 1786599213, + "narHash": "sha256-yjGG65gA1jORt0hWxjzrnw3AYkIn8EWolp8vezwXZ3I=", + "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1053317.0e251e24a4f2/nixexprs.tar.zst" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst" + } + }, + "nixpkgs_13": { + "locked": { + "lastModified": 1786599213, + "narHash": "sha256-yjGG65gA1jORt0hWxjzrnw3AYkIn8EWolp8vezwXZ3I=", + "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1053317.0e251e24a4f2/nixexprs.tar.zst" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst" + } + }, + "nixpkgs_14": { + "locked": { + "lastModified": 1787001381, + "narHash": "sha256-Ue1Yo8gfHdD4TMtNewhA4tkSYeFqXThju0nCyJc3ALo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ec2d622de0773551768cf98f3fc50cbcc003b9c5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_15": { + "locked": { + "lastModified": 1786943417, + "narHash": "sha256-b4qgjdFtlz5TAZ1Hi7DFJeqX3sjaDUnrwr9OO+O1rM0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0dd31db7e6dbf9ce05697c4545f6fe01accec994", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_16": { + "locked": { + "lastModified": 1782175435, + "narHash": "sha256-EMzXKmnOtBQ2MnvpiNOm7E+kOMvdPrIKaeg52Tip2Uk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "89570f24e97e614aa34aa9ab1c927b6578a43775", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_17": { + "locked": { + "lastModified": 1781216227, + "narHash": "sha256-9mUW6gNwoN2SWc/l0fW4svPNOulXLl8ijqKyeSOGgJE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "04607e1165ac22c5fde6dcc54c9e0b3c0487c555", + "rev": "a0374025a863d007d98e3297f6aa46cc3141c2f0", "type": "github" }, "original": { @@ -629,7 +709,23 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_18": { + "locked": { + "lastModified": 1786599213, + "narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1779622335, "narHash": "sha256-6lZN0CPBbeK9UVgFQ8EV4t2qSVQPhhlerFBGZRiz73Y=", @@ -642,7 +738,7 @@ "url": "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz" } }, - "nixpkgs_5": { + "nixpkgs_3": { "locked": { "lastModified": 1775036866, "narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=", @@ -658,7 +754,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_4": { "locked": { "lastModified": 1784707089, "narHash": "sha256-2V/6imsUgB7mPZlHY54oeVBRDoZbPKnvzwkAHUSSufk=", @@ -674,29 +770,61 @@ "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1785989512, + "narHash": "sha256-HFQhkQcl5D1hUNoen3SGHCSFCt2Bg6uP+HgbrnA3InQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "445d861c6d31b4af0c79d8d4be2331f762a361d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1786862985, + "narHash": "sha256-FBJRXmbGXiSUDvYEbfLYRkckayyZ6SK1UEqhCrIZ2Cs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e5bdc4a41d4c072fe1e3787eaa0320a384741d44", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_7": { "locked": { - "lastModified": 1784564315, - "narHash": "sha256-7OpsHHIZFUBLbeHNQ0oC40DZRQjsmGWodXge+OqgPgk=", + "lastModified": 1769461804, + "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0c2094806c9e542f31785ef3569ab9e900e3ce9c", + "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", "type": "github" }, "original": { "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", - "rev": "0c2094806c9e542f31785ef3569ab9e900e3ce9c", "type": "github" } }, "nixpkgs_8": { "locked": { - "lastModified": 1786599213, - "narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=", + "lastModified": 1777954456, + "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4", + "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", "type": "github" }, "original": { @@ -706,19 +834,32 @@ "type": "github" } }, + "nixpkgs_9": { + "locked": { + "lastModified": 1784564315, + "narHash": "sha256-7OpsHHIZFUBLbeHNQ0oC40DZRQjsmGWodXge+OqgPgk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0c2094806c9e542f31785ef3569ab9e900e3ce9c", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "0c2094806c9e542f31785ef3569ab9e900e3ce9c", + "type": "github" + } + }, "noctalia": { "inputs": { - "nixpkgs": [ - "sidonia", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_12" }, "locked": { - "lastModified": 1786798707, - "narHash": "sha256-0wlWn/Lj9ZKbU4osTXlWYiF+oyt53BQXkCoTkQtEJug=", + "lastModified": 1787066558, + "narHash": "sha256-nDiJkzVkxRmPQ/FRb8ZKDungVh88+Qzw5su6LXKC91M=", "owner": "noctalia-dev", "repo": "noctalia", - "rev": "9f66089e5ea84331ca9631fdfd462659b510b9e0", + "rev": "356a41a5cacd544730d40b936d2e66ed99e9995a", "type": "github" }, "original": { @@ -729,17 +870,14 @@ }, "noctalia-greeter": { "inputs": { - "nixpkgs": [ - "sidonia", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_13" }, "locked": { - "lastModified": 1786682522, - "narHash": "sha256-OEX7aUVtY4Qqddj9TFC4IL7MGZLCvWM8K3Ke+p8d97I=", + "lastModified": 1786882377, + "narHash": "sha256-NfnY22tYDrXfIuyexYyqB+jkO6IK23AqmhcNixkU7pw=", "owner": "noctalia-dev", "repo": "noctalia-greeter", - "rev": "5b270c6d220936fdf26893d4d812de086b453910", + "rev": "10d2c9074d3a9219e03b55b2c97f1cc743447af5", "type": "github" }, "original": { @@ -751,17 +889,14 @@ "nvfetcher": { "inputs": { "flake-compat": [ - "sidonia", "nixpkgs-xr", "flake-compat" ], "flake-utils": [ - "sidonia", "nixpkgs-xr", "flake-utils" ], "nixpkgs": [ - "sidonia", "nixpkgs-xr", "nixpkgs" ] @@ -783,13 +918,29 @@ }, "root": { "inputs": { + "aagl": "aagl", + "catppuccin": "catppuccin", + "helix": "helix", + "home-manager": "home-manager", "moppkgs": "moppkgs", + "niri": "niri", + "niri-legacy": "niri-legacy", "nix-minecraft": "nix-minecraft", - "nixpkgs": "nixpkgs_2", + "nix-monitored": "nix-monitored", + "nix-vscode-extensions": "nix-vscode-extensions", + "nixpkgs": "nixpkgs_10", + "nixpkgs-xr": "nixpkgs-xr", + "noctalia": "noctalia", + "noctalia-greeter": "noctalia-greeter", + "scopebuddy": "scopebuddy", "sidonia": "sidonia", + "sops-nix": "sops-nix", "steamcmd-flake": "steamcmd-flake", + "stextCatppuccin": "stextCatppuccin", + "stextPackageControl": "stextPackageControl", "tangled": "tangled", - "unstable": "unstable" + "unstable": "unstable", + "zen-browser": "zen-browser" } }, "rust-analyzer-src": { @@ -812,7 +963,6 @@ "rust-overlay": { "inputs": { "nixpkgs": [ - "sidonia", "aagl", "nixpkgs" ] @@ -834,7 +984,6 @@ "rust-overlay_2": { "inputs": { "nixpkgs": [ - "sidonia", "helix", "nixpkgs" ] @@ -856,7 +1005,6 @@ "rust-overlay_3": { "inputs": { "nixpkgs": [ - "sidonia", "niri-legacy", "nixpkgs" ] @@ -877,10 +1025,7 @@ }, "scopebuddy": { "inputs": { - "nixpkgs": [ - "sidonia", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1785787215, @@ -898,39 +1043,14 @@ }, "sidonia": { "inputs": { - "aagl": "aagl", - "catppuccin": "catppuccin", - "dw-proton": "dw-proton", - "helix": "helix", - "home-manager": "home-manager", - "moppkgs": [ - "moppkgs" - ], - "niri": "niri", - "niri-legacy": "niri-legacy", - "nix-monitored": "nix-monitored", - "nix-vscode-extensions": "nix-vscode-extensions", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-xr": "nixpkgs-xr", - "noctalia": "noctalia", - "noctalia-greeter": "noctalia-greeter", - "scopebuddy": "scopebuddy", - "sops-nix": "sops-nix", - "stextCatppuccin": "stextCatppuccin", - "stextPackageControl": "stextPackageControl", - "unstable": [ - "unstable" - ], - "zen-browser": "zen-browser" + "nixpkgs": "nixpkgs_15" }, "locked": { - "lastModified": 1786799309, - "narHash": "sha256-gnR/4rvvzdbc1DJMPVf/dO5cCsWaG3Qzh2NOoipcNWY=", + "lastModified": 1787065639, + "narHash": "sha256-Pf50mXbu65y56qveD3uoPfxZwYammJ//+8ymu/jWvLg=", "ref": "refs/heads/main", - "rev": "1ccb167a0d967ce397a3d199684473f1a1524976", - "revCount": 468, + "rev": "0c6608bb8a2fca992a4bdbc7693806cf7b880687", + "revCount": 469, "type": "git", "url": "https://tangled.org/moppu.dev/sidonia" }, @@ -941,10 +1061,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": [ - "sidonia", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_16" }, "locked": { "lastModified": 1786629091, @@ -1028,11 +1145,11 @@ "stextPackageControl": { "flake": false, "locked": { - "lastModified": 1786790764, - "narHash": "sha256-0sNzh7QcwUhJrbKSfJsDl3qOoww+9d7TURtheMogC0o=", + "lastModified": 1786800125, + "narHash": "sha256-QBzzwEjBOOD8AcRHOrPMxWWbplswPhZ17RdkZfY7iqg=", "owner": "wbond", "repo": "package_control", - "rev": "321badef02a4eb56115b3631e8bb72a6428199a8", + "rev": "e8dbc16c5ba46fcc2832133251a703651f3f0deb", "type": "github" }, "original": { @@ -1116,18 +1233,16 @@ "mathjax-src": "mathjax-src", "mermaid-src": "mermaid-src", "microvm": "microvm", - "nixpkgs": [ - "nixpkgs" - ], + "nixpkgs": "nixpkgs_17", "sqlite-lib-src": "sqlite-lib-src", "tailwindcss-animated-src": "tailwindcss-animated-src" }, "locked": { - "lastModified": 1786717989, - "narHash": "sha256-b1TcthI3G/0tLS1udegvGyY3TvoZcyhA8XfD0Apjuq8=", + "lastModified": 1787040060, + "narHash": "sha256-wgVkvl+SeABuduM+FBeV0RUfY1+TroN3GvHcYfWAIzI=", "ref": "refs/heads/master", - "rev": "7ccb643019f40022b48296c202091be23af90fcc", - "revCount": 3111, + "rev": "83cd2950465e8e612804d2874b97a035af8dbdfd", + "revCount": 3128, "type": "git", "url": "https://tangled.org/tangled.org/core" }, @@ -1139,17 +1254,16 @@ "treefmt-nix": { "inputs": { "nixpkgs": [ - "sidonia", "nixpkgs-xr", "nixpkgs" ] }, "locked": { - "lastModified": 1785945821, - "narHash": "sha256-NLSyTCW4K4ofhNBllt3omPasm6QpralXH1DBZOc91Dw=", + "lastModified": 1786901030, + "narHash": "sha256-WSFCsDSE5ffgD2MqzkM2CYjeFiKhRF/dJUN8uedb6YE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "ae7910970dddc408fe6ab1c8e4b277bb21d72dc0", + "rev": "27b3b12a8e6375f28ebe122f07d230ca5459bbfa", "type": "github" }, "original": { @@ -1160,11 +1274,11 @@ }, "unstable": { "locked": { - "lastModified": 1786599213, - "narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=", + "lastModified": 1787001381, + "narHash": "sha256-Ue1Yo8gfHdD4TMtNewhA4tkSYeFqXThju0nCyJc3ALo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4", + "rev": "ec2d622de0773551768cf98f3fc50cbcc003b9c5", "type": "github" }, "original": { @@ -1192,21 +1306,15 @@ }, "zen-browser": { "inputs": { - "home-manager": [ - "sidonia", - "home-manager" - ], - "nixpkgs": [ - "sidonia", - "unstable" - ] + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_18" }, "locked": { - "lastModified": 1786764320, - "narHash": "sha256-FO8IkyM+S1nFHPetg20r+EsLicLPuh+yy5WKqxG20JI=", + "lastModified": 1787021741, + "narHash": "sha256-/h16jgfnGkh48iwMFPK0tY4NBLG2zp4m5HloCXstPAA=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "a19fe7e45d173d5e455771d7ecce9bbd02a9598f", + "rev": "fd7d5b08ac2e4da35cf908cbbf762a9276f00ddd", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f368d9d..2324811 100644 --- a/flake.nix +++ b/flake.nix @@ -2,19 +2,30 @@ description = "A simple NixOS flake"; inputs = { - unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; - moppkgs.url = "git+https://tangled.org/moppu.dev/moppkgs"; + unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + moppkgs.url = "git+https://knot.moppu.dev/did:plc:hv3kvjufxykn2w4mriztfkhj/"; + sidonia.url = "git+https://tangled.org/moppu.dev/sidonia"; - sidonia = { - url = "git+https://tangled.org/moppu.dev/sidonia"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.unstable.follows = "unstable"; - inputs.moppkgs.follows = "moppkgs"; - }; + aagl.url = "github:ezKEa/aagl-gtk-on-nix/release-26.05"; + catppuccin.url = "github:catppuccin/nix/release-26.05"; + home-manager.url = "github:nix-community/home-manager/release-26.05"; - nix-minecraft = { - url = "github:Infinidoge/nix-minecraft"; + helix.url = "github:helix-editor/helix"; + niri.url = "git+https://codeberg.org/bananad3v/niri-nix"; + nix-minecraft.url = "github:Infinidoge/nix-minecraft"; + nix-monitored.url = "github:ners/nix-monitored"; + nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; + nixpkgs-xr.url = "github:nix-community/nixpkgs-xr"; + noctalia-greeter.url = "github:noctalia-dev/noctalia-greeter"; + noctalia.url = "github:noctalia-dev/noctalia"; + scopebuddy.url = "github:OpenGamingCollective/ScopeBuddy"; + sops-nix.url = "github:Mic92/sops-nix"; + tangled.url = "git+https://tangled.org/tangled.org/core"; + zen-browser.url = "github:0xc000022070/zen-browser-flake"; + + niri-legacy = { + url = "github:niri-wm/niri/v25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -23,16 +34,75 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - tangled = { - url = "git+https://tangled.org/tangled.org/core"; - inputs.nixpkgs.follows = "nixpkgs"; + # sublime text packages + stextPackageControl = { + url = "github:wbond/package_control"; + flake = false; + }; + stextCatppuccin = { + url = "github:catppuccin/sublime-text"; + flake = false; }; }; outputs = inputs: { nixosConfigurations = inputs.sidonia.mkSidonia ./hosts { specialArgs = { inherit inputs; }; - modules = [ ./common ]; + modules = [ + inputs.aagl.nixosModules.default + inputs.catppuccin.nixosModules.catppuccin + inputs.home-manager.nixosModules.home-manager + inputs.niri.nixosModules.default + inputs.nix-monitored.nixosModules.default + inputs.noctalia-greeter.nixosModules.default + inputs.sops-nix.nixosModules.default + ./common + ./nixosModules + { + home-manager.sharedModules = [ + ./homeModules + inputs.catppuccin.homeModules.catppuccin + inputs.niri.homeModules.default + inputs.noctalia.homeModules.default + inputs.zen-browser.homeModules.default + ]; + } + ( + { + config, + pkgs, + lib, + ... + }: + { + nixpkgs = { + config.allowUnfree = true; + overlays = (import ./overlays.nix) { inherit inputs lib; }; + }; + home-manager = { + backupFileExtension = inputs.nixpkgs.lib.mkDefault "backup"; + sharedModules = [ + { + nixpkgs = { + config = { inherit (config.nixpkgs.config) allowUnfree; }; + inherit (config.nixpkgs) overlays; + }; + catppuccin = { + inherit (config.catppuccin) enable accent flavor; + }; + home.stateVersion = config.system.stateVersion; + } + ]; + users.${config.sidonia.userName} = { + home = { + username = config.sidonia.userName; + homeDirectory = "/home/${config.sidonia.userName}"; + }; + }; + }; + } + ) + ]; }; }; } diff --git a/homeModules/bemenu.nix b/homeModules/bemenu.nix new file mode 100644 index 0000000..b041df3 --- /dev/null +++ b/homeModules/bemenu.nix @@ -0,0 +1,39 @@ +{ + osConfig, + config, + pkgs, + lib, + ... +}: +let + cfg = config.catppuccin; +in +{ + options.catppuccin.bemenu.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + }; + config = lib.mkIf (config.programs.bemenu.enable && cfg.bemenu.enable) { + programs.bemenu.settings = + let + palette = + lib.mapAttrs (n: v: v.hex) + (lib.importJSON "${cfg.sources.palette}/palette.json").${cfg.flavor}.colors; + in + with palette // { accent = palette.${cfg.accent}; }; + lib.mapAttrs (n: v: lib.mkDefault v) { + tb = base; + fb = base; + nb = base; + ab = base; + hb = base; + tf = accent; + ff = text; + nf = text; + af = text; + hf = accent; + bdr = accent; + fn = "monospace"; + }; + }; +} diff --git a/homeModules/default.nix b/homeModules/default.nix new file mode 100644 index 0000000..d61d09e --- /dev/null +++ b/homeModules/default.nix @@ -0,0 +1,24 @@ +{ + osConfig, + config, + pkgs, + lib, + ... +}: +{ + imports = [ + ./bemenu.nix + ./discord.nix + ./gtkwave.nix + ./helix.nix + ./hyprland.nix + ./keybinds.nix + ./niri.nix + ./noctalia.nix + ./sublimeMerge.nix + ./sublimeText.nix + ./surfer.nix + ./vesktop.nix + ./window.nix + ]; +} diff --git a/homeModules/discord.nix b/homeModules/discord.nix new file mode 100644 index 0000000..9cdb438 --- /dev/null +++ b/homeModules/discord.nix @@ -0,0 +1,45 @@ +{ + config, + osConfig, + pkgs, + lib, + ... +}: +{ + options.catppuccin.discord.enable = lib.mkOption { + type = lib.types.bool; + default = config.catppuccin.enable; + }; + config = + let + # https://github.com/nix-community/home-manager/blob/master/modules/programs/discord.nix + configDir = + if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome; + in + lib.mkIf config.programs.discord.enable ( + lib.mkMerge [ + (lib.mkIf osConfig.sidonia.legacyGpu { + home.packages = [ + (osConfig.sidonia.lib.addDesktopFlags config.programs.discord.package "discord" [ "--disable-gpu" ]) + ]; + }) + (lib.mkIf config.catppuccin.discord.enable { + programs.discord.package = pkgs.discord.override { + withOpenASAR = false; + withVencord = true; + }; + + # home-manager has issues with the backup files here + home.file."${configDir}/${config.programs.discord.configName}/settings.json".force = true; + + xdg.configFile."Vencord/settings/quickCss.css" = { + enable = config.catppuccin.discord.enable; + text = '' + @import url("https://catppuccin.github.io/discord/dist/catppuccin-${config.catppuccin.flavor}.theme.css"); + @import url("https://catppuccin.github.io/discord/dist/catppuccin-${config.catppuccin.flavor}-${config.catppuccin.accent}.theme.css"); + ''; + }; + }) + ] + ); +} diff --git a/homeModules/gtkwave.nix b/homeModules/gtkwave.nix new file mode 100644 index 0000000..d3608cb --- /dev/null +++ b/homeModules/gtkwave.nix @@ -0,0 +1,135 @@ +{ + config, + pkgs, + lib, + ... +}: +let + toGtkwaveRc = with lib.generators; toKeyValue { mkKeyValue = mkKeyValueDefault { } " "; }; +in +{ + options = { + programs.gtkwave = { + enable = lib.mkEnableOption "Enable gtkwave"; + settings = lib.mkOption { + type = lib.types.nullOr (lib.types.attrsOf lib.types.str); + default = null; + }; + }; + catppuccin.gtkwave.enable = lib.mkOption { + type = lib.types.bool; + default = config.catppuccin.enable; + }; + }; + config = lib.mkIf config.programs.gtkwave.enable { + home = { + packages = [ pkgs.gtkwave ]; + file = lib.mkIf (config.programs.gtkwave.settings != null) { + ".gtkwaverc".text = toGtkwaveRc config.programs.gtkwave.settings; + }; + }; + programs.gtkwave.settings = lib.mkIf config.catppuccin.gtkwave.enable ( + let + palette = + lib.mapAttrs (n: v: lib.strings.removePrefix "#" v.hex) + (lib.importJSON "${config.catppuccin.sources.palette}/palette.json") + .${config.catppuccin.flavor}.colors; + in + with palette // { accent = palette.${config.catppuccin.accent}; }; + let + traceRegular = green; + traceVector = green; + traceDontCare = yellow; + traceTriState = teal; + traceUndefined = red; + in + { + # background color + color_back = base; + # text color for timebar's background + color_timeb = mantle; + # text color for timebar + color_time = text; + + # color value for "normal" GTK state in signal window + color_normal = green; + # brick red color for comments + color_brkred = red; + # color value for "dark blue" in signal window + color_dkblue = accent; + # color for shadowed traces + color_ltblue = sky; + + # color value for trace groupings + color_gmstrd = maroon; + + # grid color (use Alt+G to show/hide grid). This is also the color used for high-light_wavewindow when enabled. + color_grid = mantle; + + # grid color for secondary pattern search + color_grid2 = flamingo; + + # middle mouse button marker color + color_baseline = text; + # color of the named markers + color_mark = peach; + # color of the unnamed (primary) marker + color_umark = mauve; + + # color value for "white" in signal window + color_white = base; + # color value for "black" in signal window + color_black = text; + # color value for "light gray" in signal window + color_ltgray = base; + # color value for "medium gray" in signal window + color_mdgray = mantle; + # color value for "dark gray" in signal window + color_dkgray = crust; + + # text color for vector values + color_value = text; + # vector color (horizontal) + color_vbox = traceVector; + # vector color (verticals/transitions) + color_vtrans = traceVector; + + # trace color when 0 + color_0 = traceRegular; + # trace color when 1 + color_1 = traceRegular; + # trace color (inside of box) when 1 + color_1fill = traceRegular; + # trace color when transitioning + color_trans = traceRegular; + + # trace color when don't care ("-") + color_dash = traceDontCare; + # trace color (inside of box) when don't care ("-") + color_dashfill = traceDontCare; + + # trace color when weak ("W") + color_w = traceTriState; + # trace color when high ("H") + color_high = traceTriState; + # trace color when low ("L") + color_low = traceTriState; + # trace color when floating ("Z") + color_mid = traceTriState; + # trace color (inside of box) when weak ("W") + color_wfill = traceTriState; + # trace color (inside of box) when high ("H") + color_highfill = traceTriState; + + # trace color when undefined ("X") (collision for VHDL) + color_x = traceUndefined; + # trace color (inside of box) when undefined ("X") (collision for VHDL) + color_xfill = traceUndefined; + # trace color when undefined ("U") + color_u = traceUndefined; + # trace color (inside of box) when undefined ("U") + color_ufill = traceUndefined; + } + ); + }; +} diff --git a/homeModules/helix.nix b/homeModules/helix.nix new file mode 100644 index 0000000..c66914e --- /dev/null +++ b/homeModules/helix.nix @@ -0,0 +1,46 @@ +{ + osConfig, + config, + pkgs, + lib, + ... +}: +let + cfg = config.catppuccin.helix; + subdir = if cfg.useItalics then "default" else "no_italics"; + inherit (config.catppuccin) sources; + tomlFormat = pkgs.formats.toml { }; +in +{ + options.catppuccin.helix.useTransparency = lib.mkOption { + type = lib.types.bool; + default = true; + }; + config = lib.mkMerge [ + { + catppuccin.helix = { + enable = lib.mkDefault false; # Override default theme so we can apply transparency + useItalics = lib.mkDefault true; + }; + } + (lib.mkIf config.catppuccin.enable { + programs.helix.settings = { + theme = "catppuccin-${cfg.flavor}-transparent"; + editor = { + color-modes = lib.mkDefault true; + rainbow-brackets = lib.mkDefault true; + }; + }; + xdg.configFile = { + "helix/themes/catppuccin-${cfg.flavor}.toml".source = + "${sources.helix}/${subdir}/catppuccin_${cfg.flavor}.toml"; + "helix/themes/catppuccin-${cfg.flavor}-transparent.toml".source = + tomlFormat.generate "catppuccin-transparent.toml" + { + inherits = "catppuccin-${cfg.flavor}"; + "ui.background" = { }; + }; + }; + }) + ]; +} diff --git a/homeModules/hyprland.nix b/homeModules/hyprland.nix new file mode 100644 index 0000000..b350925 --- /dev/null +++ b/homeModules/hyprland.nix @@ -0,0 +1,42 @@ +{ + osConfig, + config, + pkgs, + lib, + ... +}: +lib.mkIf (config.wayland.windowManager.hyprland.enable && config.catppuccin.hyprland.enable) { + wayland.windowManager.hyprland.settings = + let + inherit (config.catppuccin.lib) color; + rgb = lib.mapAttrs (n: v: "rgb(${v})") color; + rgba = lib.mapAttrs (n: v: (alpha: "rgba(${v}${alpha})")) color; + in + { + # Gradients: + general."col.active_border" = lib.mkDefault rgb.accent; # border color for the active window + general."col.inactive_border" = lib.mkDefault rgb.overlay2; # border color for inactive windows + general."col.nogroup_border_active" = lib.mkDefault rgb.maroon; # active border color for window that cannot be added to a group (see denywindowfromgroup dispatcher) + general."col.nogroup_border" = lib.mkDefault rgb.overlay2; # inactive border color for window that cannot be added to a group (see denywindowfromgroup dispatcher) + + group."col.border_active" = lib.mkDefault rgb.flamingo; # active group border color + group."col.border_inactive" = lib.mkDefault rgb.overlay2; # inactive (out of focus) group border color + group."col.border_locked_active" = lib.mkDefault "${rgb.flamingo} ${rgb.accent} 45deg"; # active locked group border color + group."col.border_locked_inactive" = lib.mkDefault rgb.overlay2; # inactive locked group border color + + group.groupbar."col.active" = lib.mkDefault rgb.flamingo; # active group border color + group.groupbar."col.inactive" = lib.mkDefault rgb.overlay2; # inactive (out of focus) group border color + group.groupbar."col.locked_active" = lib.mkDefault "${rgb.flamingo} ${rgb.accent} 45deg"; # active locked group border color + group.groupbar."col.locked_inactive" = lib.mkDefault rgb.overlay2; # inactive locked group border color + + # Colours: + group.groupbar.text_color = lib.mkDefault rgb.text; # controls the group bar text color + misc."col.splash" = lib.mkDefault rgb.text; # Changes the color of the splash text (requires a monitor reload to take effect). + misc.background_color = lib.mkDefault rgb.crust; # change the background color. (requires enabled disable_hyprland_logo) + + windowrule = [ + #"match:xwayland 1, match:focus 0, border_color ${rgb.overlay2}" + "match:xwayland 1, match:focus 1, border_color ${rgb.yellow}" + ]; + }; +} diff --git a/homeModules/keybinds.nix b/homeModules/keybinds.nix new file mode 100644 index 0000000..0be4caa --- /dev/null +++ b/homeModules/keybinds.nix @@ -0,0 +1,88 @@ +{ + osConfig, + config, + lib, + pkgs, + ... +}: +let + cfg = config.wayland.desktopManager.sidonia; + capitalize = + x: + let + chars = lib.stringToCharacters (lib.toLower x); + in + lib.concatStrings ([ (lib.toUpper (builtins.head chars)) ] ++ (builtins.tail chars)); +in +{ + options.wayland.desktopManager.sidonia.keybinds = lib.mkOption { + description = "List of keybinds to add to the desktop environment"; + type = lib.types.listOf ( + lib.types.submodule { + options = { + name = lib.mkOption { + description = "Name of the bound command"; + type = lib.types.str; + }; + mod = lib.mkOption { + description = "Modifier keys"; + type = + with lib.types; + coercedTo str (x: [ x ]) ( + listOf ( + coercedTo str (capitalize) (enum [ + "Super" + "Shift" + "Ctrl" + "Alt" + ]) + ) + ); + default = [ ]; + }; + key = lib.mkOption { + description = "Key"; + type = lib.types.str; + }; + exec = lib.mkOption { + description = "Command to execute"; + type = lib.types.nullOr lib.types.str; + default = null; + }; + perCompositor = { + niri = lib.mkOption { + description = "Niri specific keybind config"; + type = lib.types.nullOr lib.types.attrs; + default = null; + }; + }; + }; + } + ); + }; + config = + let + execs = builtins.filter (x: x.exec != null) cfg.keybinds; + niriBinds = builtins.filter (x: x.perCompositor.niri != null) cfg.keybinds; + in + lib.mkIf osConfig.sidonia.desktop.enable ( + lib.mkMerge [ + (lib.mkIf (osConfig.sidonia.desktop.compositor == "niri") { + wayland.windowManager.niri.settings.binds = lib.mkMerge ( + (map (x: { + "${lib.concatStringsSep "+" (x.mod ++ [ x.key ])}" = { + _props.hotkey-overlay-title = x.name; + spawn = "${pkgs.writeScript x.name x.exec}"; + }; + }) execs) + ++ (map (x: { + "${lib.concatStringsSep "+" (x.mod ++ [ x.key ])}" = { + _props.hotkey-overlay-title = x.name; + } + // x.perCompositor.niri; + }) niriBinds) + ); + }) + ] + ); +} diff --git a/homeModules/niri.nix b/homeModules/niri.nix new file mode 100644 index 0000000..e0ed1bc --- /dev/null +++ b/homeModules/niri.nix @@ -0,0 +1,45 @@ +{ + osConfig, + config, + pkgs, + lib, + ... +}: +let + cfg = config.catppuccin; +in +{ + options.catppuccin.niri.enable = lib.mkOption { + type = lib.types.bool; + default = cfg.enable; + }; + config = lib.mkIf (config.wayland.windowManager.niri.enable && config.catppuccin.niri.enable) { + wayland.windowManager.niri.settings = + let + hex = + let + p = + lib.mapAttrs (n: v: v.hex) + (lib.importJSON "${cfg.sources.palette}/palette.json").${cfg.flavor}.colors; + in + p // { accent = p.${cfg.accent}; }; + colors = { + active-color = lib.mkDefault hex.accent; + inactive-color = lib.mkDefault hex.overlay2; + urgent-color = lib.mkDefault hex.yellow; + }; + in + { + layout = { + background-color = lib.mkDefault hex.crust; + focus-ring = colors; + border = colors; + tab-indicator = colors; + insert-hint.color = lib.mkDefault "${hex.accent}80"; + }; + cursor = { + xcursor-theme = with config.catppuccin.cursors; "catppuccin-${flavor}-${accent}-cursors"; + }; + }; + }; +} diff --git a/homeModules/noctalia.nix b/homeModules/noctalia.nix new file mode 100644 index 0000000..15ef738 --- /dev/null +++ b/homeModules/noctalia.nix @@ -0,0 +1,135 @@ +{ + osConfig, + config, + pkgs, + lib, + ... +}: +let + cfg = config.catppuccin.noctalia; + mkHex = + flavor: + let + x = + lib.mapAttrs (n: v: v.hex) + (lib.importJSON "${config.catppuccin.sources.palette}/palette.json").${flavor}.colors; + in + x // { accent = x.${cfg.accent}; }; + + lightTheme = mkHex "latte"; + theme = mkHex config.catppuccin.flavor; + + replaceWith = + regex: replace: string: + let + matches = builtins.match regex string; + in + if ((isNull matches) || (builtins.any isNull matches)) then + string + else + lib.concatStrings (lib.zipListsWith (a: b: (a b)) replace matches); + replaceByLine = + regex: replace: string: + lib.concatLines (map (replaceWith regex replace) (lib.splitString "\n" string)); + + termTheme = fromTOML ( + # Add quotes to ini values to make them readable by fromTOML + replaceByLine ''(^[_a-zA-Z0-9\-]+=)(.*$)'' + [ + (m: m) + (m: ''"${m}"'') + ] + ( + builtins.readFile "${config.catppuccin.sources.foot}/catppuccin-${config.catppuccin.noctalia.flavor}.ini" + ) + ); + + paletteName = "catppuccin-${cfg.flavor}-${cfg.accent}"; + + mkPalette = + main: term: + (with main; rec { + mPrimary = accent; + mSecondary = peach; + mTertiary = teal; + mError = red; + mHover = mTertiary; + + mSurface = base; + mOnSurface = text; + mSurfaceVariant = surface0; + mOnSurfaceVariant = subtext0; + mOutline = surface1; + + mOnPrimary = crust; + mOnSecondary = crust; + mOnTertiary = crust; + mOnError = crust; + mShadow = crust; + mOnHover = crust; + }) + // (with term; { + terminal = + let + split = lib.splitString " " cursor; + in + { + inherit foreground background; + selectionFg = selection-foreground; + selectionBg = selection-background; + cursorText = builtins.elemAt split 0; + cursor = builtins.elemAt split 1; + normal = { + black = regular0; + red = regular1; + green = regular2; + yellow = regular3; + blue = regular4; + magenta = regular5; + cyan = regular6; + white = regular7; + }; + bright = { + black = bright0; + red = bright1; + green = bright2; + yellow = bright3; + blue = bright4; + magenta = bright5; + cyan = bright6; + white = bright7; + }; + }; + }); + +in +{ + options.catppuccin.noctalia = { + enable = lib.mkOption { + type = lib.types.bool; + default = config.catppuccin.enable; + }; + flavor = lib.mkOption { + type = lib.types.str; + default = config.catppuccin.flavor; + }; + accent = lib.mkOption { + type = lib.types.str; + default = config.catppuccin.accent; + }; + }; + config = lib.mkIf (config.programs.noctalia.enable && cfg.enable) { + xdg.configFile."noctalia/palettes/${paletteName}.json".text = builtins.toJSON { + dark = mkPalette theme termTheme.colors-dark; + light = mkPalette lightTheme (termTheme.colors-light or termTheme.colors-dark); + }; + programs.noctalia.settings = { + theme = { + mode = if cfg.flavor == "latte" then "light" else "dark"; + source = "custom"; + custom_palette = paletteName; + builtin = "Catppuccin"; + }; + }; + }; +} diff --git a/homeModules/sublimeMerge.nix b/homeModules/sublimeMerge.nix new file mode 100644 index 0000000..ea4da2f --- /dev/null +++ b/homeModules/sublimeMerge.nix @@ -0,0 +1,866 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.programs.sublime-merge; + capitalize = + str: + let + chars = lib.stringToCharacters str; + in + lib.concatStrings ([ (lib.toUpper (builtins.head chars)) ] ++ (builtins.tail chars)); + themeName = "Catppuccin ${capitalize config.catppuccin.flavor}"; + + remapAttrs = f: attrset: builtins.listToAttrs (map f (lib.attrsToList attrset)); + + mapDirs = + path: + (remapAttrs (attr: { + name = "${path}/${attr.name}"; + value.source = attr.value; + })); + mapFiles = + path: + (remapAttrs (attr: { + name = "${path}/${attr.name}"; + inherit (attr) value; + })); +in +{ + options = { + + programs.sublime-merge = { + enable = lib.mkEnableOption "Enable sublime merge"; + settings = lib.mkOption { + type = lib.types.nullOr lib.types.attrs; + default = null; + }; + userFile = lib.mkOption { + type = lib.types.attrs; + default = { }; + }; + packages = lib.mkOption { + type = lib.types.attrsOf lib.types.path; + default = { }; + }; + }; + + catppuccin.sublime-merge.enable = lib.mkOption { + type = lib.types.bool; + default = config.catppuccin.enable; + }; + }; + config = lib.mkIf cfg.enable { + home.packages = [ pkgs.sublime-merge ]; + xdg.configFile = + let + smergePackages = mapDirs "sublime-merge/Packages" cfg.packages; + smergeSettings = mapFiles "sublime-merge/Packages/User" ( + cfg.userFile + // ( + if cfg.settings != null then + { "Preferences.sublime-settings".text = builtins.toJSON cfg.settings; } + else + { } + ) + ); + in + (smergePackages // smergeSettings); + programs = lib.mkIf config.catppuccin.sublime-merge.enable { + sublime4.packages = { inherit (pkgs.sublimePackages) "Catppuccin color schemes"; }; + sublime-merge = { + settings.theme = "${themeName}.sublime-theme"; + userFile = + (builtins.listToAttrs ( + map + (x: { + name = "${x} - ${themeName}.sublime-settings"; + value.text = builtins.toJSON { color_scheme = "${themeName}.sublime-color-scheme"; }; + }) + [ + "Commit Message" + "Diff" + "File Mode" + ] + )) + // { + "${themeName}.sublime-theme".text = + let + palette = + lib.mapAttrs (n: v: v.hex) + (lib.importJSON "${config.catppuccin.sources.palette}/palette.json") + .${config.catppuccin.flavor}.colors; + in + with palette // { accent = palette.${config.catppuccin.accent}; }; + builtins.toJSON { + extends = "Merge.sublime-theme"; + variables = { + inherit + pink + red + maroon + yellow + green + teal + blue + lavender + text + ; + + white = "hsl(0, 0%, 95%)"; + text-heading = subtext1; + text-light = subtext0; # "color(${text} a(- 40%))" + darken = "hsl(0, 0%, 13%)"; + + orange = peach; + cyan = sapphire; + purple = mauve; + + # Alias for pink + magenta = pink; + dark_red = "color(${red} s(25%) l(35%))"; + dark_blue = "color(${blue} s(25%) l(35%))"; + + # Labels + label_color = "var(text-heading)"; + help_label_color = "var(text-light)"; # "color(var(text-heading) a(0.6))"; + + # Header + title_bar_style = "dark"; + header_bg = base; + header_fg = "var(text-heading)"; + header_button_bg = surface1; # "color(${base} l(25%))"; + icon_button_fg = text; + + info_shadow = "color(black a(0.2))"; + + diverged_bg = "color(var(orange) l(- 5%) s(- 20%))"; + diverged_button_bg = "var(button_bg)"; + diverged_button_fg = base; + + # Scroll shadow + scroll_shadow = "color(black a(0.3))"; + + # Focus highlight + focus_highlight_color = text; + + # Welcome overlay + welcome_bg = "color(${base} l(- 5%))"; + recent_repositories_row_bg-hover = "color(${base} l(+ 5%))"; + + # Preferences Page + preferences_overlay_bg = "color(${base} l(+ 5%))"; + preferences_section_table_bg = base; + + # Side bar + location_bar_fg = text; + location_bar_heading_fg = "var(text-heading)"; + location_bar_heading_shadow = "black"; + location_bar_row_bg-hover = "color(${base} l(+ 30%) a(0.25))"; + disclosure_fg = text; + + # Commit list + commit_list_bg = mantle; + commit_row_bg-hover = base; + commit_summary_fg-primary = "var(text-heading)"; + commit_summary_fg-secondary = "var(text-light)"; + commit_color_count = 8; + + commit_edge_0 = blue; + commit_edge_1 = mauve; + commit_edge_2 = pink; + commit_edge_3 = peach; + commit_edge_4 = yellow; + commit_edge_5 = green; + commit_edge_6 = red; + commit_edge_7 = sapphire; + + # Annotations + commit_annotation_fg = base; + commit_annotation_fg_inverted = base; + commit_annotation_bg = sapphire; + + commit_annotation_fg_0_border = "var(commit_edge_0)"; + commit_annotation_fg_1_border = "var(commit_edge_1)"; + commit_annotation_fg_2_border = "var(commit_edge_2)"; + commit_annotation_fg_3_border = "var(commit_edge_3)"; + commit_annotation_fg_4_border = "var(commit_edge_4)"; + commit_annotation_fg_5_border = "var(commit_edge_5)"; + commit_annotation_fg_6_border = "var(commit_edge_6)"; + commit_annotation_fg_7_border = "var(commit_edge_7)"; + + commit_annotation_bg_inverted_0 = "color(var(commit_edge_0))"; + commit_annotation_bg_inverted_1 = "color(var(commit_edge_1))"; + commit_annotation_bg_inverted_2 = "color(var(commit_edge_2))"; + commit_annotation_bg_inverted_3 = "color(var(commit_edge_3))"; + commit_annotation_bg_inverted_4 = "color(var(commit_edge_4))"; + commit_annotation_bg_inverted_5 = "color(var(commit_edge_5))"; + commit_annotation_bg_inverted_6 = "color(var(commit_edge_6))"; + commit_annotation_bg_inverted_7 = "color(var(commit_edge_7))"; + + # Location Bar + side_bar_container_bg = base; + + # Table of Contents + table_of_contents_bg = "color(${base} l(+ 3%))"; + table_of_contents_fg = text; + table_of_contents_heading_fg = "var(text-heading)"; + table_of_contents_row_bg = "color(${base} l(+ 30%))"; + + # Detail panel + detail_panel_bg = base; + field_name_fg = text; + author_fg = overlay2; # "color(var(white) a(0.4))"; + terminator_fg = text; + + remote_ann_fg = "color(${base} a(0.7))"; + remote_ann_bg = green; + + stash_ann_fg = text; + stash_ann_bg = surface1; # "color(var(white) a(20%))" + stash_ann_border = overlay2; # "color(var(white) a(50%))"; + + tag_ann_fg = base; + tag_ann_bg = yellow; + tag_ann_opacity = 0.4; + + file_ann_fg = base; + file_ann_bg = blue; + + submodule_ann_fg = text; + submodule_ann_bg = surface1; # "color(var(white) a(20%))" + submodule_light_ann_fg = text; + submodule_light_ann_bg = surface1; # "color(var(white) a(20%))" + + inserted_ann_bg = "color(${green} a(0.50))"; + deleted_ann_bg = "color(${red} a(0.50))"; + + # Diff headers + file_diff_shadow = "color(black a(0.5))"; + file_icon_bg = "color(${text} a(0.2))"; + + hunk_button_fg = text; + hunk_button_shadow = "color(black a(0.5))"; + + file_header_bg = surface0; # "color(${base} l(+ 5%))"; + file_header_bg-hover = surface1; # "color(${base} l(+ 10%))"; + + hunk_header_bg = base; # "color(${base} l(+ 12%))"; + + deleted_icon_fg = text; + deleted_header_bg = surface0; + deleted_header_bg-hover = surface1; + + unmerged_icon_fg = text; + unmerged_header_bg = surface0; + unmerged_header_bg-hover = surface1; + + recent_icon_fg = yellow; + recent_icon_bg = "transparent"; + untracked_header_bg = surface0; # "color(${base} s(- 5%) l(+ 15%))"; + untracked_header_bg-hover = surface1; # "color(var(untracked_header_bg) l(+ 5%))"; + + full_context_icon_bg = text; + + staged_icon_fg = text; + + renamed_file_inserted = "color(${green} s(30%) l(60%))"; + renamed_file_deleted = "color(${red} s(50%) l(65%))"; + + # Blame + blame_popup_bg = surface0; + + # Buttons + button_bg = overlay0; # "color(var(white) a(20%))" + button_fg = "var(label_color)"; + button_shadow = "color(black a(0.5))"; + + highlighted_button_light_bg = "color(${green} a(75%))"; + highlighted_button_light_fg = text; + highlighted_button_dark_bg = "color(${green} a(75%))"; + highlighted_button_dark_fg = text; + highlighted_button_shadow = "color(black a(0.5) l(+ 10%))"; + + toggle_button_bg = overlay0; # "color(var(white) a(20%))" # This matches the header hover buttons + toggle_button_fg = text; + toggle_button_fg_selected = "var(text-heading)"; + + # Tabs + tab_bar_bg = base; + tab_separator_bg = base; + + # Radio buttons + radio_back = base; + radio_selected = accent; + radio_border-selected = accent; + + # Checkbox buttons + checkbox_back = base; + checkbox_selected = accent; + checkbox_border-selected = accent; + + # Dialogs + dialog_bg = base; + dialog_button_bg = overlay0; # "color(var(white) a(20%))" + + # Progress bar + progress_bg = "var(header_button_bg)"; + progress_fg = "color(${accent})"; + + # Quick panel + quick_panel_bg = base; + quick_panel_row_bg = surface0; + quick_panel_fg = text; + quick_panel_fg-match = accent; + quick_panel_fg-selected = text; + quick_panel_fg-selected-match = accent; + quick_panel_path_fg = "var(text-light)"; + quick_panel_path_fg-match = accent; + quick_panel_path_fg-selected = "var(text-light)"; + quick_panel_path_fg-selected-match = accent; + + switch_repo_bg = base; + + # Image Diffs + image_diff_checkerboard_alt_bg = surface0; + image_metadata_label_bg = surface1; + + # Hints + failed_label_fg = base; + + # Loading + loading_ball_1 = pink; + loading_ball_2 = green; + + # Command Palette + preview_fg = "white"; + + # Merge Helper + merge_helper_highlight_bg = surface1; + console_border = "color(${base} l(+ 10%))"; + + # Tabs + repository_tab_bar_bg = base; + repository_tab_bar_border_bg = base; + + file_badge_created_fg = green; + file_badge_deleted_fg = pink; + file_badge_modified_fg = peach; + file_badge_modified_bg = surface1; # "color(var(white) a(20%))" + file_badge_unmerged_fg = sapphire; + file_badge_unmerged_bg = surface1; # "color(var(white) a(20%))" + file_badge_untracked_fg = mauve; + file_badge_untracked_bg = surface1; # "color(var(white) a(20%))" + file_badge_staged_fg = green; + file_badge_staged_bg = surface1; # "color(var(white) a(20%))" + + }; + rules = + ( + with builtins; + concatLists ( + genList (x: [ + { + class = "commit_annotation"; + parents = [ + { + class = "commit_annotations"; + attributes = [ "column_${toString (x + 1)}" ]; + } + ]; + border_color = "var(commit_annotation_fg_${toString x}_border)"; + background_color = "var(commit_annotation_bg_inverted_${toString x})"; + } + ]) 8 + ) + ) + ++ [ + { + class = "condensed_branch_annotation_container"; + border_color = crust; + background_color = crust; + } + { + class = "tab_control"; + "layer3.opacity" = 0.0; + "layer2.opacity" = 0.0; + "layer2.draw_center" = false; + "layer2.inner_margin" = [ + 0 + 0 + 0 + 1 + ]; + "layer2.tint" = accent; + } + { + class = "tab_control"; + attributes = [ "hover" ]; + "layer2.opacity" = 0.5; + } + { + class = "tab_control"; + attributes = [ "selected" ]; + "layer2.opacity" = 1.0; + # File Tabs + } + { + class = "tab_separator"; + "layer0.inner_margin" = [ + 0 + 0 + ]; + content_margin = [ + 0 + 0 + 0 + 0 + ]; + } + { + class = "tab"; + "layer0.tint" = base; + "layer2.draw_center" = false; + "layer2.inner_margin" = [ + 0 + 0 + 0 + 1 + ]; + "layer2.tint" = accent; + "layer2.opacity" = 0.0; + } + { + class = "tab"; + attributes = [ "hover" ]; + "layer2.opacity" = 0.5; + } + { + class = "tab"; + attributes = [ "selected" ]; + "layer2.opacity" = 1.0; + } + { + class = "overlay_container_control"; + "layer0.opacity" = 0.6; + "layer0.tint" = "color(${base} l(+ 10%))"; + } + { + class = "commit_annotations"; + num_unique_columns = "var(commit_color_count)"; + } + { + class = "stash_annotation"; + color = "var(stash_ann_fg)"; + background_color = "var(stash_ann_bg)"; + border_color = "var(stash_ann_border)"; + } + { + class = "tag_annotation_icon"; + "layer0.opacity" = 1; + "layer0.tint" = base; + } + { + class = "tag_annotation"; + color = "var(tag_ann_fg)"; + } + { + class = "panel_control"; + parents = [ { class = "switch_project_window"; } ]; + "layer0.tint" = base; + } + { + class = "tool_tip_label_control"; + color = text; + } + { + class = "tool_tip_control"; + "layer0.tint" = base; + } + { + class = "info_area"; + "layer0.opacity" = 0.5; + "layer0.tint" = "var(header_button_bg)"; + } + { + class = "info_area"; + attributes = [ "hover" ]; + "layer0.opacity" = 0.75; + } + { + class = "location_bar_heading"; + color = "var(location_bar_heading_fg)"; + } + { + class = "table_of_contents_heading"; + color = "var(table_of_contents_heading_fg)"; + } + { + class = "text_line_control"; + "layer0.tint" = mantle; + color_scheme_tint = mantle; + color_scheme_tint_2 = mantle; + } + { + class = "search_text_control"; + "layer0.tint" = base; + } + { + class = "search_help"; + headline_color = "var(text-light)"; + } + { + class = "quick_panel_label hint"; + color = overlay2; + } + { + class = "quick_panel_label key_binding"; + color = overlay2; + } + { + class = "diff_text_control"; + "line_selection_color" = "color(${accent} alpha(0.05))"; + "line_selection_border_color" = "color(${accent} alpha(0.5))"; + "line_selection_border_width" = 2.0; + "line_selection_border_radius" = 2.0; + } + { + class = "branch_stat"; + "layer0.tint" = overlay2; + } + { + class = "branch_stat_label"; + color = text; + } + { + class = "icon_behind"; + "layer0.opacity" = 1.0; + "layer0.tint" = pink; + } + { + class = "icon_ahead"; + "layer0.opacity" = 1.0; + "layer0.tint" = green; + } + { + class = "commit_edges_control"; + num_colors = "var(commit_color_count)"; + color0 = "var(commit_edge_0)"; + color1 = "var(commit_edge_1)"; + color2 = "var(commit_edge_2)"; + color3 = "var(commit_edge_3)"; + color4 = "var(commit_edge_4)"; + color5 = "var(commit_edge_5)"; + color6 = "var(commit_edge_6)"; + color7 = "var(commit_edge_7)"; + } + { + class = "blame_text_control"; + num_colors = 8; + color0 = sapphire; + color1 = mauve; + color2 = pink; + color3 = peach; + color4 = yellow; + color5 = green; + color6 = red; + color7 = blue; + } + { + class = "new_badge"; + parents = [ { class = "file_diff_header"; } ]; + "layer0.tint" = red; + } + { + class = "staged_badge"; + "layer0.tint" = "var(file_badge_staged_bg)"; + } + { + class = "staged_badge"; + parents = [ { class = "file_diff_header"; } ]; + "layer0.tint" = "var(file_badge_staged_bg)"; + } + { + class = "staged_badge"; + parents = [ + { + class = "file_diff_header"; + attributes = [ "hover" ]; + } + ]; + "layer0.tint" = "var(file_badge_staged_bg)"; + } + { + class = "modified_badge"; + "layer0.tint" = "var(file_badge_modified_bg)"; + } + { + class = "modified_badge"; + parents = [ { class = "file_diff_header"; } ]; + "layer0.tint" = "var(file_badge_modified_bg)"; + } + { + class = "modified_badge"; + parents = [ + { + class = "file_diff_header"; + attributes = [ "hover" ]; + } + ]; + "layer0.tint" = "var(file_badge_modified_bg)"; + } + { + class = "unmerged_badge"; + "layer0.tint" = "var(file_badge_unmerged_bg)"; + } + { + class = "unmerged_badge"; + parents = [ { class = "file_diff_header"; } ]; + "layer0.tint" = "var(file_badge_unmerged_bg)"; + } + { + class = "unmerged_badge"; + parents = [ + { + class = "file_diff_header"; + attributes = [ "hover" ]; + } + ]; + "layer0.tint" = "var(file_badge_unmerged_bg)"; + } + { + class = "untracked_badge"; + "layer0.tint" = "var(file_badge_untracked_bg)"; + } + { + class = "untracked_badge"; + parents = [ { class = "file_diff_header"; } ]; + "layer0.tint" = "var(file_badge_untracked_bg)"; + } + { + class = "untracked_badge"; + parents = [ + { + class = "file_diff_header"; + attributes = [ "hover" ]; + } + ]; + "layer0.tint" = "var(file_badge_untracked_bg)"; + } + { + class = "icon_created"; + "layer0.tint" = "var(file_badge_created_fg)"; + } + { + class = "icon_deleted"; + "layer0.tint" = "var(file_badge_deleted_fg)"; + } + { + class = "label_control"; + parents = [ { class = "modified_badge"; } ]; + fg = "var(file_badge_modified_fg)"; + } + { + class = "label_control"; + parents = [ { class = "unmerged_badge"; } ]; + fg = "var(file_badge_unmerged_fg)"; + } + { + class = "label_control"; + parents = [ { class = "untracked_badge"; } ]; + fg = "var(file_badge_untracked_fg)"; + } + { + class = "label_control"; + parents = [ { class = "staged_badge"; } ]; + fg = "var(file_badge_staged_fg)"; + } + { + class = "icon_deleted"; + parents = [ { class = "modified_badge"; } ]; + "layer0.tint" = "var(file_badge_deleted_fg)"; + } + { + class = "icon_unmerged"; + parents = [ { class = "unmerged_badge"; } ]; + "layer0.tint" = "var(file_badge_unmerged_fg)"; + } + { + class = "tab_label"; + parents = [ + { + class = "tab_control"; + attributes = [ "selected" ]; + } + ]; + fg = text; + } + { + class = "tab_label"; + parents = [ + { + class = "tab_control"; + attributes = [ "!selected" ]; + } + ]; + fg = subtext0; + } + { + class = "tab_label"; + parents = [ + { + class = "tab_control"; + attributes = [ + "!selected" + "hover" + ]; + } + ]; + fg = subtext1; + } + { + class = "tab_close_button"; + "layer0.texture" = "Theme - Default/common/tab_close.png"; + "layer0.tint" = overlay1; + "layer0.opacity" = 0.0; + } + { + class = "tab_close_button"; + parents = [ + { + class = "tab_control"; + attributes = [ "selected" ]; + } + ]; + "layer0.opacity" = 1.0; + } + { + class = "tab_close_button"; + parents = [ + { + class = "tab_control"; + attributes = [ "hover" ]; + } + ]; + "layer0.opacity" = 1.0; + } + { + class = "tab_close_button"; + parents = [ + { + class = "tab_control"; + attributes = [ "dirty" ]; + } + ]; + "layer0.texture" = "Theme - Merge/tab_dirty.png"; + "layer0.tint" = maroon; + "layer0.opacity" = 1.0; + } + { + class = "tab_close_button"; + "layer0.texture" = "Theme - Default/common/tab_close.png"; + attributes = [ "hover" ]; + "layer0.tint" = text; + "layer0.opacity" = 1.0; + } + { + class = "icon_folder"; + "layer0.texture" = "Theme - Default/common/folder_closed.png"; + } + { + class = "icon_folder"; + parents = [ + { + class = "tab_control"; + attributes = [ "selected" ]; + } + ]; + "layer0.texture" = "Theme - Default/common/folder_open.png"; + "layer0.opacity" = 1.0; + "layer0.tint" = accent; + } + { + class = "icon_folder"; + parents = [ + { + class = "tab_control"; + attributes = [ "!selected" ]; + } + ]; + "layer0.opacity" = 1.0; + "layer0.tint" = overlay0; + } + { + class = "icon_folder"; + parents = [ + { + class = "tab_control"; + attributes = [ + "!selected" + "hover" + ]; + } + ]; + "layer0.opacity" = 1.0; + "layer0.tint" = overlay1; + } + ] + ++ (lib.optionals (config.catppuccin.flavor != "latte") [ + { + class = "branch_table"; + "dark_content" = true; + } + { + class = "commit_table"; + "dark_content" = true; + } + { + class = "scroll_track_control"; + parents = [ { class = "commit_table_container"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_bar.png"; + } + { + class = "puck_control"; + parents = [ { class = "commit_table_container"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_puck.png"; + } + { + class = "scroll_track_control"; + parents = [ { class = "side_bar_container"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_bar.png"; + } + { + class = "puck_control"; + parents = [ { class = "side_bar_container"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_puck.png"; + } + { + class = "scroll_track_control"; + parents = [ { class = "details_panel"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_bar.png"; + } + { + class = "puck_control"; + parents = [ { class = "details_panel"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_puck.png"; + } + { + class = "scroll_track_control"; + parents = [ { class = "overlay_control"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_bar.png"; + } + { + class = "puck_control"; + parents = [ { class = "overlay_control"; } ]; + "layer0.texture" = "Theme - Merge/dark_scroll_puck.png"; + } + ]); + }; + }; + }; + }; + }; +} diff --git a/homeModules/sublimeText.nix b/homeModules/sublimeText.nix new file mode 100644 index 0000000..66bf303 --- /dev/null +++ b/homeModules/sublimeText.nix @@ -0,0 +1,105 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.programs.sublime4; + capitalize = + str: + let + chars = lib.stringToCharacters str; + in + lib.concatStrings ([ (lib.toUpper (builtins.head chars)) ] ++ (builtins.tail chars)); + + remapAttrs = f: attrset: builtins.listToAttrs (builtins.map (f) (lib.attrsToList attrset)); + + mapDirs = + path: + (remapAttrs (attr: { + name = "${path}/${attr.name}"; + value.source = attr.value; + })); + mapFiles = + path: + (remapAttrs (attr: { + name = "${path}/${attr.name}"; + inherit (attr) value; + })); +in +{ + options = { + programs.sublime4 = { + enable = lib.mkEnableOption "Enable sublime text 4"; + settings = lib.mkOption { + type = lib.types.nullOr lib.types.attrs; + default = null; + }; + userFile = lib.mkOption { + type = lib.types.attrs; + default = { }; + }; + packageControl = { + enable = lib.mkEnableOption "Enable declarative package control configuration"; + packages = lib.mkOption { + type = lib.types.nullOr (lib.types.listOf lib.types.str); + default = null; + }; + extraSettings = lib.mkOption { + type = lib.types.nullOr lib.types.attrs; + default = null; + }; + }; + packages = lib.mkOption { + type = lib.types.attrsOf lib.types.path; + default = { }; + }; + }; + + catppuccin.sublime4.enable = lib.mkOption { + type = lib.types.bool; + default = config.catppuccin.enable; + }; + }; + config = lib.mkIf cfg.enable { + home.packages = [ pkgs.sublime4 ]; + xdg.configFile = + let + stextPackages = mapDirs "sublime-text/Packages" cfg.packages; + stextSettings = mapFiles "sublime-text/Packages/User" ( + cfg.userFile + // ( + if cfg.settings != null then + { "Preferences.sublime-settings".text = builtins.toJSON cfg.settings; } + else + { } + ) + // ( + if (cfg.packageControl.enable) && (cfg.packageControl.extraSettings != null) then + { "Package Control.sublime-settings".text = builtins.toJSON cfg.packageControl.extraSettings; } + else + { } + ) + ); + in + (stextPackages // stextSettings); + programs.sublime4 = lib.mkMerge [ + (lib.mkIf cfg.packageControl.enable { + packages = { inherit (pkgs.sublimePackages) "Package Control"; }; + }) + (lib.mkIf (cfg.packageControl.enable && (cfg.packageControl.packages != null)) { + packageControl.extraSettings.installed_packages = cfg.packageControl.packages; + }) + (lib.mkIf config.catppuccin.sublime4.enable { + settings = { + color_scheme = "Catppuccin ${capitalize config.catppuccin.flavor}.sublime-color-scheme"; + theme = "Adaptive.sublime-theme"; + }; + packages = { + inherit (pkgs.sublimePackages) "Catppuccin color schemes"; + }; + }) + ]; + }; +} diff --git a/homeModules/surfer.nix b/homeModules/surfer.nix new file mode 100644 index 0000000..de117cc --- /dev/null +++ b/homeModules/surfer.nix @@ -0,0 +1,146 @@ +{ + config, + pkgs, + lib, + ... +}: +let + tomlFormat = pkgs.formats.toml { }; + palette = + let + cfg = config.catppuccin; + p = builtins.mapAttrs ( + n: v: lib.strings.removePrefix "#" v.hex + ) (lib.importJSON "${cfg.sources.palette}/palette.json").${cfg.flavor}.colors; + in + p // { accent = p.${cfg.accent}; }; + + surferTheme = with palette; { + foreground = text; + alt_text_color = surface0; # negated foreground + border_color = surface0; + selected_elements_colors = { + background = surface1; + foreground = text; + }; + canvas_colors = { + background = crust; + alt_background = base; + foreground = text; + }; + primary_ui_color = { + background = mantle; + foreground = text; + }; + secondary_ui_color = { + background = crust; + foreground = text; + }; + accent_info = { + background = blue; + foreground = text; + }; + accent_warn = { + background = surface0; + foreground = text; + }; + accent_error = { + background = red; + foreground = text; + }; + clock_highlight_line = { + color = overlay0; + width = 2; + }; + clock_highlight_cycle = base; + clock_rising_marker = false; + variable_default = green; + variable_undef = red; + variable_highimp = yellow; + variable_dontcare = blue; + variable_weak = overlay1; + variable_parameter = text; + transaction_default = green; + waveform_opacity = 0.2; + wide_opacity = 0.0; + cursor = { + color = accent; + width = 2; + }; + gesture = { + color = yellow; + width = 2; + }; + measure = { + color = overlay1; + width = 2; + }; + linewidth = 2; + vector_transition_width = 6; + alt_frequency = 3; + viewport_separator = { + color = text; + width = 4; + }; + drag_threshold = 1.0; + drag_hint_color = subtext1; + drag_hint_width = 2.0; + highlight_background = surface1; + + colors = { + Green = green; + Red = red; + Yellow = yellow; + Blue = blue; + Pink = mauve; + Orange = peach; + Gray = overlay1; + Violet = lavender; + }; + + ticks = { + style = { + color = base; + width = 2; + }; + density = 1; + }; + + relation_arrow = { + style = { + color = red; + width = 1.3; + }; + head_angle = 25; + head_length = 8; + }; + }; +in +{ + options = { + programs.surfer = { + enable = lib.mkEnableOption "Enable surfer waveform viewer"; + # https://gitlab.com/surfer-project/surfer/-/blob/main/default_config.toml + settings = lib.mkOption { + type = lib.types.nullOr tomlFormat.type; + default = null; + }; + }; + catppuccin.surfer.enable = lib.mkOption { + type = lib.types.bool; + default = config.catppuccin.enable; + }; + }; + config = lib.mkIf config.programs.surfer.enable { + home.packages = [ pkgs.surfer ]; + xdg.configFile."surfer/config.toml".source = lib.mkIf (config.programs.surfer.settings != null) ( + tomlFormat.generate "config.toml" config.programs.surfer.settings + ); + programs.surfer.settings = lib.mkIf config.catppuccin.surfer.enable { + theme = lib.mkDefault "catppuccin"; + }; + xdg.configFile."surfer/themes/catppuccin.toml".source = lib.mkIf config.catppuccin.surfer.enable ( + tomlFormat.generate "catppuccin.toml" surferTheme + ); + }; +} diff --git a/homeModules/vesktop.nix b/homeModules/vesktop.nix new file mode 100644 index 0000000..eae331a --- /dev/null +++ b/homeModules/vesktop.nix @@ -0,0 +1,13 @@ +{ + config, + osConfig, + pkgs, + lib, + ... +}: + +lib.mkIf (config.programs.vesktop.enable && osConfig.sidonia.legacyGpu) { + home.packages = [ + (osConfig.sidonia.lib.addDesktopFlags config.programs.vesktop.package "vesktop" [ "--disable-gpu" ]) + ]; +} diff --git a/homeModules/window.nix b/homeModules/window.nix new file mode 100644 index 0000000..d703dd4 --- /dev/null +++ b/homeModules/window.nix @@ -0,0 +1,32 @@ +{ + osConfig, + config, + lib, + pkgs, + ... +}: +{ + options.wayland.desktopManager.sidonia.window = { + decoration = { + rounding = lib.mkOption { + description = "Window rounding"; + type = lib.types.int; + default = 10; + }; + borderWidth = lib.mkOption { + description = "Border width"; + type = lib.types.int; + default = 4; + }; + opacity = lib.mkOption { + description = "Decimal value for inactive window opacity."; + type = lib.types.float; + default = 0.965; + apply = dec: { + inherit dec; + hex = lib.toHexString (builtins.floor (dec * 255)); + }; + }; + }; + }; +} diff --git a/hosts/yuhata/home/wayvr.nix b/hosts/yuhata/home/wayvr.nix index 736f63d..5cb4ba4 100644 --- a/hosts/yuhata/home/wayvr.nix +++ b/hosts/yuhata/home/wayvr.nix @@ -7,9 +7,17 @@ ... }: let + palette = + let + cfg = config.catppuccin; + p = + builtins.mapAttrs (n: v: v.hex) + (lib.importJSON "${cfg.sources.palette}/palette.json").${cfg.flavor}.colors; + in + p // { accent = p.${cfg.accent}; }; # See: https://github.com/wlx-team/wayvr/wiki wayvrConfig = - with (builtins.mapAttrs (n: v: "#${v}") config.catppuccin.lib.color); + with palette; (pkgs.formats.yaml { }).generate "config.yaml" { # This is the main config for WayVR # Place this file in ~/.config/wayvr/conf.d and tweak the values. @@ -90,8 +98,6 @@ let in { # https://github.com/NixOS/nixpkgs/pull/479448 - home.packages = [ - pkgs.wayvr - ]; + home.packages = [ pkgs.wayvr ]; xdg.configFile."wayvr/conf.d/config.yaml".source = wayvrConfig; } diff --git a/common/os/modules/default.nix b/nixosModules/default.nix similarity index 86% rename from common/os/modules/default.nix rename to nixosModules/default.nix index 812b136..2e96c90 100644 --- a/common/os/modules/default.nix +++ b/nixosModules/default.nix @@ -6,8 +6,9 @@ }: { imports = [ - ./vr.nix ./distributedBuilds.nix ./netbird.nix + ./sidonia.nix + ./vr.nix ]; } diff --git a/common/os/modules/distributedBuilds.nix b/nixosModules/distributedBuilds.nix similarity index 100% rename from common/os/modules/distributedBuilds.nix rename to nixosModules/distributedBuilds.nix diff --git a/common/os/modules/netbird.nix b/nixosModules/netbird.nix similarity index 100% rename from common/os/modules/netbird.nix rename to nixosModules/netbird.nix diff --git a/nixosModules/sidonia.nix b/nixosModules/sidonia.nix new file mode 100644 index 0000000..5834f43 --- /dev/null +++ b/nixosModules/sidonia.nix @@ -0,0 +1,157 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.sidonia; + fromHexString = hex: (fromTOML "getInt = 0h${hex}").getInt; +in +{ + options = { + sidonia = { + lib = lib.mkOption { + readOnly = true; + type = lib.types.attrs; + default = { + capitalize = + str: + let + chars = lib.stringToCharacters str; + in + lib.concatStrings ([ (lib.toUpper (builtins.head chars)) ] ++ (builtins.tail chars)); + fromHexToRgb = + hex: + lib.concatStringsSep ", " ( + map (x: toString (fromHexString x)) [ + (builtins.substring 0 2 hex) + (builtins.substring 2 2 hex) + (builtins.substring 4 2 hex) + ] + ); + patchDesktop = + pkg: appName: f: + lib.hiPrio ( + pkgs.writeTextFile { + name = "${appName}.desktop"; + destination = "/share/applications/${appName}.desktop"; + text = lib.concatLines ( + lib.mapAttrsToList + ( + group: keys: + lib.concatLines ([ "[${group}]" ] ++ (lib.mapAttrsToList (key: value: "${key}=${value}") keys)) + ) + ( + f ( + lib.importTOML ( + pkgs.runCommand "desktop-to-toml-${appName}" { } '' + sed -r 's/^(\[)(.*)(\])$/\1"\2"\3/;s/^(.*=)(.*)$/\1"\2"/' ${pkg}/share/applications/${appName}.desktop > $out + '' + ) + ) + ) + ); + checkPhase = ''${pkgs.desktop-file-utils}/bin/desktop-file-validate "$target"''; + } + ); + addDesktopFlags = + pkg: appName: flags: + cfg.lib.patchDesktop pkg appName ( + prev: + lib.recursiveUpdate prev { + "Desktop Entry" = { + Exec = lib.concatStringsSep " " ([ prev."Desktop Entry".Exec ] ++ flags); + }; + } + ); + + home = { + applications = "/home/${cfg.userName}/.nix-profile/share/applications"; + autostart = "/home/${cfg.userName}/.config/autostart"; + }; + configContainerCredential = + f: service: path: + let + hash = builtins.hashString "sha256" "${path}"; + rootCredName = "${service}-${hash}-Root"; + localCredName = "${service}-${hash}-Local"; + in + { + extraFlags = [ "--load-credential=${rootCredName}:${path}" ]; + config = lib.mkMerge [ + { + systemd.services."${service}".serviceConfig.LoadCredential = [ "${localCredName}:${rootCredName}" ]; + } + (f "/run/credentials/${service}.service/${localCredName}") + ]; + }; + }; + }; + ssh = { + pubKey = lib.mkOption { + type = lib.types.str; + default = ""; + }; + privKeyPath = lib.mkOption { + type = lib.types.path; + default = "/home/${cfg.userName}/.ssh/id_ed25519"; + }; + }; + userName = lib.mkOption { + description = "Username of main user"; + type = lib.types.str; + }; + geolocation.enable = lib.mkEnableOption "Turn on geolocation related services such as automatic timezone changing and geoclue"; + isLaptop = lib.mkEnableOption "Apply laptop-specific tweaks"; + legacyGpu = lib.mkEnableOption "Apply tweaks for OpenGL ES 2 device support"; + text = { + comicCode = lib.mkOption { + default = { }; + type = lib.types.submodule { + options = { + enable = lib.mkEnableOption "Use Comic Code monospace font"; + ligatures.enable = lib.mkOption { + description = "Use ligatures by default"; + default = true; + type = lib.types.bool; + }; + source = lib.mkOption { + description = "Source zip file containing the font"; + type = lib.types.nullOr lib.types.path; + default = null; + }; + }; + }; + apply = x: { + inherit (x) enable; + package = + if (isNull x.source) then pkgs.comic-code else (pkgs.comic-code.overrideAttrs { src = x.source; }); + name = + if x.enable then + if x.ligatures.enable then "Comic Code Ligatures" else "Comic Code" + else + "ComicShannsMono Nerd Font"; + }; + }; + }; + desktop = { + enable = lib.mkEnableOption "Enable desktop environment"; + compositor = lib.mkOption { + description = "Which compositor to use"; + type = lib.types.enum [ + "niri" + ]; + default = "niri"; + }; + shell = lib.mkOption { + description = "What desktop shell to use"; + type = lib.types.enum [ + "noctalia" + ]; + default = "noctalia"; + }; + }; + }; + }; +} diff --git a/common/os/modules/vr.nix b/nixosModules/vr.nix similarity index 100% rename from common/os/modules/vr.nix rename to nixosModules/vr.nix diff --git a/overlays.nix b/overlays.nix new file mode 100644 index 0000000..23af4cd --- /dev/null +++ b/overlays.nix @@ -0,0 +1,60 @@ +{ inputs, lib }: +let + getSystem = overlayPkgs: overlayPkgs.stdenv.hostPlatform.system; + overlayMissingFromFlake = + flake: + ( + final: prev: + if builtins.hasAttr (getSystem prev) flake.packages then + lib.filterAttrs (n: v: !(builtins.hasAttr n prev)) flake.packages.${getSystem prev} + else + { } + ); +in +[ + inputs.moppkgs.overlays.default + inputs.noctalia.overlays.default + inputs.niri.overlays.niri-nix + ( + final: prev: + let + getVsxVersion = + pkg: if pkg.version == "1.116.02821" then "1.116.0" else (pkg.vscodeVersion or pkg.version); + getFlakeExts = + version: inputs.nix-vscode-extensions.extensions.${getSystem prev}.forVSCodeVersion version; + overlayExtensions = + pkg: + with getFlakeExts (getVsxVersion pkg); + lib.zipAttrsWith (name: values: (lib.mergeAttrsList values)) [ + final.vscode-extensions + open-vsx + open-vsx-release + vscode-marketplace + vscode-marketplace-release + ]; + in + { + vsxExtensionsFor = overlayExtensions; + } + ) + (final: prev: { + helix-unstable = inputs.helix.packages.${getSystem prev}.helix; + + scopebuddy = inputs.scopebuddy.packages.${getSystem prev}.default; + + sublimePackages = { + "Catppuccin color schemes" = inputs.stextCatppuccin; + "Package Control" = inputs.stextPackageControl; + }; + + niri-legacy = inputs.niri-legacy.packages.${getSystem prev}.niri; + }) + (overlayMissingFromFlake inputs.nixpkgs-xr) # use nixpkgs stable where possible + ( + final: prev: + if (builtins.hasAttr "pnpm_10_29_2" prev) then + { pnpm_10_29_2 = final.pnpm_10; } + else + (builtins.warn "pnpm_10_29_2 is no longer in nixpkgs. Remove the workaround from overlays.nix" { }) + ) +] -- 2.51.2