diff --git a/common/default.nix b/common/default.nix index 2819aefe..ab350793 100644 --- a/common/default.nix +++ b/common/default.nix @@ -39,11 +39,13 @@ "https://nix-community.cachix.org" "https://nixpkgs-review-bot.cachix.org" "https://cachix.cachix.org" + "https://cosmic.cachix.org" ]; trusted-public-keys = [ "cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixpkgs-review-bot.cachix.org-1:eppgiDjPk7Hkzzz7XlUesk3rcEHqNDozGOrcLc8IqwE=" + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; }; optimise = { diff --git a/common/desktop/default.nix b/common/desktop/default.nix index 976f7b2d..62e84a2a 100644 --- a/common/desktop/default.nix +++ b/common/desktop/default.nix @@ -1,4 +1,10 @@ -{ pkgs, lib, inputs, ... }: { +{ + pkgs, + lib, + inputs, + ... +}: +{ # Bootloader. boot = { kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; @@ -14,29 +20,34 @@ }; }; - programs.nix-ld.enable = true; + # programs.nix-ld.enable = true; hardware.keyboard.qmk.enable = true; home-manager = { useGlobalPkgs = true; useUserPackages = true; users.vivian = import ./home.nix; - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = { + inherit inputs; + }; }; + + hardware.pulseaudio.enable = false; services = { # Enable my config for the gnome desktop environment - v.gnome.enable = true; + v.gnome.enable = lib.mkDefault true; # Enable CUPS to print documents. printing.enable = true; pipewire = { enable = true; - alsa.enable = true; - alsa.support32Bit = true; + audio.enable = true; + # alsa.enable = true; + # alsa.support32Bit = true; pulse.enable = true; # If you want to use JACK applications, uncomment this - #jack.enable = true; + jack.enable = true; # use the example session manager (no others are packaged yet so this is enabled by default, # no need to redefine it in your config for now) @@ -62,15 +73,12 @@ }; # Global Packages - environment.systemPackages = with pkgs; [ wireguard-tools sbctl ]; # ++ (if config.virtualisation.podman.enable then [ pkgs.podman-compose ] else []); + environment.systemPackages = with pkgs; [ + wireguard-tools + sbctl + ]; # ++ (if config.virtualisation.podman.enable then [ pkgs.podman-compose ] else []); - # programs.virt-manager = { - # enable = true; - # }; - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; security.rtkit.enable = true; virtualisation = { @@ -88,23 +96,28 @@ noto-fonts-emoji dejavu_fonts (nerdfonts.override { - fonts = - [ "DejaVuSansMono" "Ubuntu" "DroidSansMono" "NerdFontsSymbolsOnly" ]; + fonts = [ + "DejaVuSansMono" + "Ubuntu" + "DroidSansMono" + "NerdFontsSymbolsOnly" + ]; }) ]; programs = { steam = { - enable = true; # Open ports in the firewall for Steam Remote Play remotePlay.openFirewall = true; package = pkgs.steam.override { - extraPkgs = pkgs: with pkgs; [ gamescope mangohud ]; + extraPkgs = + pkgs: with pkgs; [ + gamescope + mangohud + ]; }; }; - gamemode.enable = true; - adb.enable = true; }; networking = { diff --git a/common/desktop/home.nix b/common/desktop/home.nix index bd4e201c..7d780ad5 100644 --- a/common/desktop/home.nix +++ b/common/desktop/home.nix @@ -20,6 +20,8 @@ let pyshark cryptography flask + ipwhois + pyasn ]; in { diff --git a/common/hm-modules/catppuccin/default.nix b/common/hm-modules/catppuccin/default.nix index a997a6ec..3fabb170 100644 --- a/common/hm-modules/catppuccin/default.nix +++ b/common/hm-modules/catppuccin/default.nix @@ -7,6 +7,12 @@ with lib; let cfg = config.themes.v.catppuccin; + mako = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "mako"; + rev = "9dd088aa5f4529a3dd4d9760415e340664cb86df"; + sha256 = "sha256-nUzWkQVsIH4rrCFSP87mXAka6P+Td2ifNbTuP7NM/SQ="; + }; in { options.themes.v.catppuccin = { @@ -24,8 +30,6 @@ in font.name = "DejaVuSansMono Nerd Font"; }; - # home.sessionVariables.GTK_USE_PORTAL = "1"; - gtk = { enable = true; theme = { @@ -45,24 +49,28 @@ in }; }; - xdg.configFile = { - "gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets"; - "gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css"; - "gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css"; - }; - qt = { enable = true; platformTheme = "qtct"; - style = { - name = "Catppuccin-Frappe-Pink"; - package = pkgs.catppuccin-kde.override { - flavour = [ "frappe" ]; - accents = [ "pink" ]; - }; - }; + style.name = "kvantum"; }; + xdg.configFile = { + "Kvantum/kvantum.kvconfig".text = '' + [General] + theme=Catppuccin-Frappe-Pink + ''; + }; + + home.packages = with pkgs; [ + (catppuccin-kvantum.override { + accent = "Pink"; + variant = "Frappe"; + }) + ]; + + programs.mako.extraConfig = builtins.readFile "${mako}/src/frappe"; + programs.vscode = { userSettings."workbench.colorTheme" = "Catppuccin FrappΓ©"; extensions = [ pkgs.vscode-extensions.catppuccin.catppuccin-vsc ]; diff --git a/common/hm-modules/nvim/default.nix b/common/hm-modules/nvim/default.nix index 7ca8dedd..53b966bf 100644 --- a/common/hm-modules/nvim/default.nix +++ b/common/hm-modules/nvim/default.nix @@ -40,6 +40,12 @@ with lib; clipboard.providers.wl-copy.enable = true; keymaps = [ + # General + { + mode = "n"; + key = ""; + action = ":noh"; + } # Telescope { mode = "n"; @@ -185,9 +191,12 @@ with lib; FixCursorHold-nvim nvim-web-devicons nvim-nio + nvim-surround ]; - extraConfigLua = ""; + extraConfigLua = " + require('nvim-surround').setup() + "; colorschemes.catppuccin = { enable = true; @@ -275,7 +284,7 @@ with lib; nixGrammars = true; disabledLanguages = [ "latex" ]; }; - surround.enable = true; + # surround.enable = true; fugitive.enable = true; gitgutter.enable = true; @@ -326,7 +335,8 @@ with lib; }; }; servers = { - nil_ls.enable = true; + cssls.enable = true; + nil_ls.enable = true; #NixOS dockerls.enable = true; rust-analyzer = { enable = true; diff --git a/common/modules/gnome/default.nix b/common/modules/gnome/default.nix index 964ca53c..333229ed 100644 --- a/common/modules/gnome/default.nix +++ b/common/modules/gnome/default.nix @@ -1,7 +1,14 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: with lib; -let cfg = config.services.v.gnome; -in { +let + cfg = config.services.v.gnome; +in +{ options.services.v.gnome = { enable = mkEnableOption "v.gnome"; hm = mkOption { @@ -36,7 +43,7 @@ in { }; # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; + displayManager.gdm.enable = lib.mkDefault true; desktopManager.gnome.enable = true; }; udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; @@ -49,7 +56,11 @@ in { # Add Home-manager dconf stuff home-manager.sharedModules = mkIf cfg.hm [ ./hm.nix ]; environment.gnome.excludePackages = - (with pkgs; [ gnome-photos gnome-tour gnome-connections ]) + (with pkgs; [ + gnome-photos + gnome-tour + gnome-connections + ]) ++ (with pkgs.gnome; [ atomix # puzzle game epiphany # web browser diff --git a/flake.lock b/flake.lock index 79f19fe6..b1bdf562 100644 --- a/flake.lock +++ b/flake.lock @@ -11,11 +11,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1707922053, - "narHash": "sha256-wSZjK+rOXn+UQiP1NbdNn5/UW6UcBxjvlqr2wh++MbM=", + "lastModified": 1711742460, + "narHash": "sha256-0O4v6e4a1toxXZ2gf5INhg4WPE5C5T+SVvsBt+45Mcc=", "owner": "zhaofengli", "repo": "attic", - "rev": "6eabc3f02fae3683bffab483e614bebfcd476b21", + "rev": "4dbdbee45728d8ce5788db6461aaaa89d98081f0", "type": "github" }, "original": { @@ -48,11 +48,11 @@ "stable": "stable" }, "locked": { - "lastModified": 1706509311, - "narHash": "sha256-QQKQ6r3CID8aXn2ZXZ79ZJxdCOeVP+JTnOctDALErOw=", + "lastModified": 1711386353, + "narHash": "sha256-gWEpb8Hybnoqb4O4tmpohGZk6+aerAbJpywKcFIiMlg=", "owner": "zhaofengli", "repo": "colmena", - "rev": "c84ccd0a7a712475e861c2b111574472b1a8d0cd", + "rev": "cd65ef7a25cdc75052fbd04b120aeb066c3881db", "type": "github" }, "original": { @@ -111,11 +111,11 @@ ] }, "locked": { - "lastModified": 1710003968, - "narHash": "sha256-g8+K+mLiNG5uch35Oy9oDQBAmGSkCcqrd0Jjme7xiG0=", + "lastModified": 1711299236, + "narHash": "sha256-6/JsyozOMKN8LUGqWMopKTSiK8N79T8Q+hcxu2KkTXg=", "owner": "ipetkov", "repo": "crane", - "rev": "10484f86201bb94bd61ecc5335b1496794fedb78", + "rev": "880573f80d09e18a11713f402b9e6172a085449f", "type": "github" }, "original": { @@ -131,11 +131,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1708091384, - "narHash": "sha256-dTGGw2y8wvfjr+J9CjQbfdulOq72hUG17HXVNxpH1yE=", + "lastModified": 1711733382, + "narHash": "sha256-XuKlYhc9Hk6jMIIwWTP6CTQVUWi0Sq3nJApnUJk6bu8=", "owner": "serokell", "repo": "deploy-rs", - "rev": "0a0187794ac7f7a1e62cda3dabf8dc041f868790", + "rev": "2bad21828ee2c5d1e42588d5f4c53f5b10300c6a", "type": "github" }, "original": { @@ -203,6 +203,22 @@ "type": "github" } }, + "flake-compat_10": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-compat_2": { "flake": false, "locked": { @@ -284,6 +300,22 @@ } }, "flake-compat_7": { + "flake": false, + "locked": { + "lastModified": 1688025799, + "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_8": { "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -297,7 +329,7 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_8": { + "flake-compat_9": { "flake": false, "locked": { "lastModified": 1696426674, @@ -313,22 +345,6 @@ "type": "github" } }, - "flake-compat_9": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -511,11 +527,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -605,11 +621,11 @@ ] }, "locked": { - "lastModified": 1703887061, - "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -648,11 +664,11 @@ ] }, "locked": { - "lastModified": 1702994344, - "narHash": "sha256-aJPjexHm6bLo+ky1Rw9nDStgXBYuxuWPmo5DSdjj23s=", + "lastModified": 1711359349, + "narHash": "sha256-dSHWgOtipLWgSSZFq9tvlaQF9b8Jfk/2mYCX4QS4x50=", "ref": "refs/heads/main", - "rev": "db96c4a4ebc05c8e4f1b427074fc5fe61c026998", - "revCount": 8, + "rev": "1017642795eb398881eff78a822621f2d2a93be7", + "revCount": 10, "type": "git", "url": "https://git.0x76.dev/v/gnome-autounlock-keyring.git" }, @@ -668,11 +684,11 @@ ] }, "locked": { - "lastModified": 1711133180, - "narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=", + "lastModified": 1711625603, + "narHash": "sha256-W+9dfqA9bqUIBV5u7jaIARAzMe3kTq/Hp2SpSVXKRQw=", "owner": "nix-community", "repo": "home-manager", - "rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb", + "rev": "c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2", "type": "github" }, "original": { @@ -689,11 +705,11 @@ ] }, "locked": { - "lastModified": 1711133180, - "narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=", + "lastModified": 1711604890, + "narHash": "sha256-vbI/gxRTq/gHW1Q8z6D/7JG/qGNl3JTimUDX+MwnC3A=", "owner": "nix-community", "repo": "home-manager", - "rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb", + "rev": "3142bdcc470e1e291e1fbe942fd69e06bd00c5df", "type": "github" }, "original": { @@ -715,11 +731,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1710837180, - "narHash": "sha256-WVkLclGrUliLJUl+XaJplo09VdxyqHxZtkEmmDW2QYY=", + "lastModified": 1711442573, + "narHash": "sha256-/A3YzcY5erYOPojp5Ffwgxv4X5MTnRiWwuaXfgXbK2g=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "ded8d23709f94aedb1407bee9e26581f258e9e3a", + "rev": "df7ac26bd24fac8baa94d60a02c3e0f0d4d16368", "type": "github" }, "original": { @@ -774,11 +790,11 @@ "spectrum": "spectrum" }, "locked": { - "lastModified": 1711159783, - "narHash": "sha256-nwl2Cygq7NrV9QcebJE/T/vXv7w+zLERD7ygHz0F5g8=", + "lastModified": 1711753492, + "narHash": "sha256-lLlXQBebD6wd2m7vjXg2zQ8tfJF2a70RL+zXdbaQqn0=", "owner": "astro", "repo": "microvm.nix", - "rev": "d31f7c7d3194c51372134832a3a2a256773c161a", + "rev": "1b7c70b198554d0f0306ec153c94906623437aed", "type": "github" }, "original": { @@ -836,11 +852,11 @@ ] }, "locked": { - "lastModified": 1710717205, - "narHash": "sha256-Wf3gHh5uV6W1TV/A8X8QJf99a5ypDSugY4sNtdJDe0A=", + "lastModified": 1711591334, + "narHash": "sha256-9d5ilxxq4CXw44eFw8VFrRneAKex7D8xjn95mwZjgf4=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "bcc8afd06e237df060c85bad6af7128e05fd61a3", + "rev": "f0dd0838c3558b59dc3b726d8ab89f5b5e35c297", "type": "github" }, "original": { @@ -851,11 +867,11 @@ }, "nixlib": { "locked": { - "lastModified": 1710636348, - "narHash": "sha256-/kB+ZWSdkZjbZ0FTqm0u84sf2jFS+30ysaEajmBjtoY=", + "lastModified": 1711241261, + "narHash": "sha256-knrTvpl81yGFHIpm1SsLDApe0thFkw1cl3ISAMPmP/0=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "fa827dda806c5aa98f454da4c567991ab8ce422c", + "rev": "b2a1eeef8c185f6bd27432b053ff09d773244cbc", "type": "github" }, "original": { @@ -864,6 +880,27 @@ "type": "github" } }, + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat_7", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1711761951, + "narHash": "sha256-De6fnc3EiBzaqtIZqPDfkODpS2WsOunVBcH7AOyzFEw=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "cf817213c972b089351ad42c49616076915f07bd", + "type": "github" + }, + "original": { + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, "nixos-generators": { "inputs": { "nixlib": "nixlib", @@ -872,11 +909,11 @@ ] }, "locked": { - "lastModified": 1711108213, - "narHash": "sha256-Q8cwpA2LQOInqeXVckrfFlbzHB8HOWrYntuOxqn3A3g=", + "lastModified": 1711626141, + "narHash": "sha256-0qV1pHeIyUZ18cp8ijQnMf7uV+Uk4+UqTCC6yGSGWvk=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "417a857dfb824e60930881a254dd67d6796f5884", + "rev": "63194fceafbfe583a9eb7d16ab499adc0a6c0bc2", "type": "github" }, "original": { @@ -887,11 +924,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1710783728, - "narHash": "sha256-eIsfu3c9JUBgm3cURSKTXLEI9Dlk1azo+MWKZVqrmkc=", + "lastModified": 1711352745, + "narHash": "sha256-luvqik+i3HTvCbXQZgB6uggvEcxI9uae0nmrgtXJ17U=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "1e679b9a9970780cd5d4dfe755a74a8f96d33388", + "rev": "9a763a7acc4cfbb8603bb0231fec3eda864f81c0", "type": "github" }, "original": { @@ -934,11 +971,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1702780907, - "narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=", + "lastModified": 1711460390, + "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f", + "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", "type": "github" }, "original": { @@ -950,11 +987,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1704874635, - "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { @@ -1014,26 +1051,26 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1711223581, - "narHash": "sha256-gxwEymONInAXL6mM5c0JyIu18kANnL9ckJCKPrYnzxo=", + "lastModified": 1712004559, + "narHash": "sha256-87vZKDepF3ZqpinX5zarC5Xb9dwpGgmfcl4Woy26lYA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "af8bf466f6a04f569f49b1d062fe4fab06fae357", + "rev": "5476cea4892cedbf6f8bbebdb93ba07e3f5f5e38", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "master", + "ref": "nixos-unstable-small", "type": "indirect" } }, "nixpkgs_6": { "locked": { - "lastModified": 1711001935, - "narHash": "sha256-URtGpHue7HHZK0mrHnSf8wJ6OmMKYSsoLmJybrOLFSQ=", + "lastModified": 1711523803, + "narHash": "sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "20f77aa09916374aa3141cbc605c955626762c9a", + "rev": "2726f127c15a4cc9810843b96cad73c7eb39e443", "type": "github" }, "original": { @@ -1078,7 +1115,7 @@ "nixvim": { "inputs": { "devshell": "devshell", - "flake-compat": "flake-compat_7", + "flake-compat": "flake-compat_8", "flake-parts": "flake-parts_2", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", @@ -1086,11 +1123,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1711199922, - "narHash": "sha256-Oz5WNOPp95K4JLyoNQKyEdaUM5JzliC62jwTpGPqYNE=", + "lastModified": 1711745924, + "narHash": "sha256-ZYVrOg12pWNbY1hx1lOu3cwER6xalEHUUIXnfbkCtUY=", "owner": "pta2002", "repo": "nixvim", - "rev": "7170aad28139cd3629b2b6ce4c9272bf41c2ad45", + "rev": "4f83bcf2906c1c933316396221024f3482a7b086", "type": "github" }, "original": { @@ -1101,11 +1138,11 @@ }, "nur": { "locked": { - "lastModified": 1711221702, - "narHash": "sha256-OXF5uu1CKPG+O2/I0ZT0m1iUcX3j91p4heSKHB0G9xM=", + "lastModified": 1711789378, + "narHash": "sha256-aFHVJ0j7p54FyjpfJ2nVMv5MDXrP4ttL8efcWu1lxf0=", "owner": "nix-community", "repo": "NUR", - "rev": "b1106d45a93dd804f3669d5271ff0bb03350d344", + "rev": "9c84c5419c332d79fbd2b3644c62f978beccfff9", "type": "github" }, "original": { @@ -1116,7 +1153,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_8", + "flake-compat": "flake-compat_9", "flake-utils": "flake-utils_9", "gitignore": "gitignore_2", "nixpkgs": [ @@ -1129,11 +1166,11 @@ ] }, "locked": { - "lastModified": 1710923068, - "narHash": "sha256-6hOpUiuxuwpXXc/xfJsBUJeqqgGI+JMJuLo45aG3cKc=", + "lastModified": 1711519547, + "narHash": "sha256-Q7YmSCUJmDl71fJv/zD9lrOCJ1/SE/okZ2DsrmRjzhY=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "e611897ddfdde3ed3eaac4758635d7177ff78673", + "rev": "7d47a32e5cd1ea481fab33c516356ce27c8cef4a", "type": "github" }, "original": { @@ -1160,11 +1197,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1708018599, - "narHash": "sha256-M+Ng6+SePmA8g06CmUZWi1AjG2tFBX9WCXElBHEKnyM=", + "lastModified": 1710923068, + "narHash": "sha256-6hOpUiuxuwpXXc/xfJsBUJeqqgGI+JMJuLo45aG3cKc=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "5df5a70ad7575f6601d91f0efec95dd9bc619431", + "rev": "e611897ddfdde3ed3eaac4758635d7177ff78673", "type": "github" }, "original": { @@ -1186,6 +1223,7 @@ "lanzaboote": "lanzaboote", "mailserver": "mailserver", "microvm": "microvm", + "nixos-cosmic": "nixos-cosmic", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_5", @@ -1208,11 +1246,11 @@ ] }, "locked": { - "lastModified": 1710641527, - "narHash": "sha256-R9JZEevtSyg7++LEryYJRrfyEe45azJxmu2k9VezEW0=", + "lastModified": 1711246447, + "narHash": "sha256-g9TOluObcOEKewFo2fR4cn51Y/jSKhRRo4QZckHLop0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "50db54295d3922a3b7a40d580b84d75150b36c34", + "rev": "dcc802a6ec4e9cc6a1c8c393327f0c42666f22e4", "type": "github" }, "original": { @@ -1543,7 +1581,7 @@ }, "vault-secrets": { "inputs": { - "flake-compat": "flake-compat_9", + "flake-compat": "flake-compat_10", "flake-utils": "flake-utils_11", "nix": "nix", "nixpkgs": "nixpkgs_8", diff --git a/flake.nix b/flake.nix index cdeb0e9e..b26819f0 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ # * https://github.com/Infinidoge/nix-minecraft inputs = { - nixpkgs.url = "nixpkgs/master"; + nixpkgs.url = "nixpkgs/nixos-unstable-small"; flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus/v1.4.0"; @@ -49,6 +49,11 @@ # Website(s) essentials.url = "github:jdonszelmann/essentials"; essentials.inputs.nixpkgs.follows = "nixpkgs"; + + nixos-cosmic = { + url = "github:lilyinstarlight/nixos-cosmic"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -63,6 +68,7 @@ gnome-autounlock-keyring, lanzaboote, t, + nixos-cosmic, ... }@inputs: let @@ -91,6 +97,14 @@ hostDefaults = { system = "x86_64-linux"; modules = [ + ({ pkgs, self, ...}: { + system.replaceRuntimeDependencies = [ + ({ + original = pkgs.xz; + replacement = pkgs.fixed-xz; + }) + ]; + }) home-manager.nixosModules.home-manager gnome-autounlock-keyring.nixosModules.default ./common @@ -114,6 +128,7 @@ aoife = { modules = [ lanzaboote.nixosModules.lanzaboote + nixos-cosmic.nixosModules.default ./common/desktop ./hosts/thalassa/aoife ]; diff --git a/hosts/thalassa/aoife/default.nix b/hosts/thalassa/aoife/default.nix index 63fe3d19..fb9f5d4b 100644 --- a/hosts/thalassa/aoife/default.nix +++ b/hosts/thalassa/aoife/default.nix @@ -2,7 +2,12 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running β€˜nixos-help’). -{ inputs, lib, pkgs, ... }: +{ + inputs, + lib, + pkgs, + ... +}: { imports = [ ./hardware-configuration.nix @@ -37,7 +42,26 @@ }; home-manager.users.vivian = import ./home; + programs.hyprland.enable = true; + services.gnome-autounlock-keyring = { + enable = true; + # target = "hyprland-session.target"; + }; + + services.interception-tools = { + enable = true; + plugins = [ pkgs.interception-tools-plugins.caps2esc ]; + udevmonConfig = '' + - JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.caps2esc}/bin/caps2esc | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE" + DEVICE: + EVENTS: + EV_KEY: [KEY_CAPSLOCK, KEY_ESC] + ''; + }; + + # services.desktopManager.cosmic.enable = true; + # services.displayManager.cosmic-greeter.enable = true; # Enable Ozone rendering for Chromium and Electron apps. environment.sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/hosts/thalassa/aoife/home/default.nix b/hosts/thalassa/aoife/home/default.nix index 2059881d..1a5e2341 100644 --- a/hosts/thalassa/aoife/home/default.nix +++ b/hosts/thalassa/aoife/home/default.nix @@ -21,6 +21,7 @@ localsend obsidian typst + prismlauncher ]; ## Hyprland Config diff --git a/hosts/thalassa/aoife/home/eww/eww.scss b/hosts/thalassa/aoife/home/eww/eww.scss index efa2a502..73435ed6 100644 --- a/hosts/thalassa/aoife/home/eww/eww.scss +++ b/hosts/thalassa/aoife/home/eww/eww.scss @@ -1,55 +1,138 @@ +$light-gray: #9699b7; + * { - all: unset; //Unsets everything so you can style everything from scratch + all: unset; //Unsets everything so you can style everything from scratch + font-family: "JetBrainsMono" +} + +tooltip { + background-color: $base; + border-radius: 5px +} + +button { + transition: background-color 200ms, color 200ms; +} + +.active { + color: $pink; + font-size: 1.4rem; +} + +.inactive { + color: $base; + font-size: 1.4rem; +} + +.inactive:hover { + color: $light-gray; } -//Global Styles .bar { - background-color: #3a3a3a; - color: #b0b4bc; - padding: 10px; + background-color: $mantle; } -// Styles on classes (see eww.yuck for more information) - -.sidestuff slider { - all: unset; - color: #ffd5cd; +.clock { + font-weight: bold; + background-color: $base; + color: $text; + border-radius: 10px; + padding: 0.2rem; + margin: 0.5rem; } -.metric scale trough highlight { - all: unset; - background-color: #D35D6E; - color: #000000; - border-radius: 10px; -} -.metric scale trough { - all: unset; - background-color: #4e4e4e; - border-radius: 50px; - min-height: 3px; - min-width: 50px; - margin-left: 10px; - margin-right: 20px; -} -.metric scale trough highlight { - all: unset; - background-color: #D35D6E; - color: #000000; - border-radius: 10px; -} -.metric scale trough { - all: unset; - background-color: #4e4e4e; - border-radius: 50px; - min-height: 3px; - min-width: 50px; - margin-left: 10px; - margin-right: 20px; -} -.label-ram { - font-size: large; -} -.workspaces button:hover { - color: #D35D6E; +.date { + font-size: 1.5rem; + color: $text; } + +.battery { + font-family: monospace; + font-size: 1.5rem; + color: $teal; +} + +.volume, +.dnd, +.wifi { + font-family: monospace; + font-size: 1.5rem; + color: $mauve; + padding: 0 5px; +} + + +// battery menu +.batterywindow { + background-color: $mantle; + border-radius: 5px; + font-size: 18px; + font-weight: normal; + color: $text; + + progressbar { + border-radius: 5px; + } + + progressbar progress { + background-color: $green; + } + + progressbar trough { + background-color: $base; + } + + .batterymenu { + padding: 10px; + } + +} + +// Calendar +.cal { + background-color: $mantle; + border-radius: 5px; + font-size: 18px; + font-weight: normal; + + .cal-in { + padding: 0px 10px 0px 10px; + color: $text; + + .cal { + &.highlight { + padding: 20px; + } + + padding: 5px 5px 5px 5px; + margin-left: 10px; + } + } +} + +calender { + color: $text; +} + +calendar:selected { + color: $mauve; +} + +calendar.header { + color: $overlay0; + font-weight: bold; +} + +calendar.button { + color: $base; +} + +calendar.highlight { + color: $overlay0; + font-weight: bold; +} + +calendar:indeterminate { + color: $text; +} \ No newline at end of file diff --git a/hosts/thalassa/aoife/home/eww/eww.yuck b/hosts/thalassa/aoife/home/eww/eww.yuck index a4a27d2c..04673aff 100644 --- a/hosts/thalassa/aoife/home/eww/eww.yuck +++ b/hosts/thalassa/aoife/home/eww/eww.yuck @@ -1,75 +1,164 @@ (defwidget bar [] - (centerbox :orientation "h" - (workspaces) - (music) - (sidestuff))) + (centerbox + :orientation "v" + (box + :valign "start" + :hexpand false + :vexpand false + :orientation "v" + :space-evenly false + ) + + (workspaces + :halign "center" + :vexpand true + :hexpand false + :orientation "v" + ) + + (box :valign "end" :hexpand false :vexpand true :orientation "v" :space-evenly false + (wifi) + (do-not-disturb) + (volume) + (battery) + (time) + ) + ) +) -(defwidget sidestuff [] - (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" - (metric :label "πŸ”Š" - :value volume - :onchange "amixer -D pulse sset Master {}%") - (metric :label "" - :value {EWW_RAM.used_mem_perc} - :onchange "") - (metric :label "πŸ’Ύ" - :value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)} - :onchange "") - time)) +;; ━━━ BATTERY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +(defwidget battery [] + (eventbox :onclick "eww open batterywindow --toggle" + (label + :text `${ + EWW_BATTERY.BAT0.status == "Charging" ? "ο–ƒ" : + EWW_BATTERY.BAT0.capacity < 10 ? "ο•Ή" : + EWW_BATTERY.BAT0.capacity < 20 ? "ο•Ή" : + EWW_BATTERY.BAT0.capacity < 30 ? "ο•»" : + EWW_BATTERY.BAT0.capacity < 40 ? "ο•Ό" : + EWW_BATTERY.BAT0.capacity < 50 ? "ο•½" : + EWW_BATTERY.BAT0.capacity < 60 ? "ο•Ύ" : + EWW_BATTERY.BAT0.capacity < 70 ? "ο•Ώ" : + EWW_BATTERY.BAT0.capacity < 80 ? "ο–€" : + EWW_BATTERY.BAT0.capacity < 90 ? "" : "ο•Έ" + }` + :class "battery" + )) +) +(defwidget batterymenu [] + (box :orientation "v" + :class "batterymenu" + (label :text "${EWW_BATTERY.BAT0.status}: ${EWW_BATTERY.BAT0.capacity}%") + (progress :value "${EWW_BATTERY.BAT0.capacity}" :orientation "h") ; TODO: change class (and color) on low juice + ) +) + +(defwindow batterywindow + :monitor 0 + :geometry (geometry + :x "53px" + :y "30px" + :anchor "bottom left" + ) + (batterymenu) +) + +; ━━━ do-not-disturb ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +(defvar dnd "ο–™") +(defwidget do-not-disturb [] + (eventbox + :orientation "h" + :halign "center" + :space-evenly false + :onclick "nohup ./scripts/do-not-disturb.sh &" + (label + :text {dnd} + :class "dnd" + ) + ) +) + +;; ━━━ WIFI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +(defpoll wifi :interval "30s" "./scripts/wifi.sh") + +(defwidget wifi [] + (box + :orientation "h" + :halign "center" + :space-evenly false + (label + :text {wifi.icon} + :tooltip {wifi.status} + :class "wifi" + ) + ) +) + +;; ━━━ VOLUME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +(defpoll volume :interval "1s" "./scripts/volume.sh") +(defwidget volume [] + (eventbox + :orientation "h" + :halign "center" + :space-evenly false + :onclick "pamixer -t" + (label + :text {volume.icon} + :tooltip "${volume.percent}%" + :class "volume" + ) + ) +) + +;; ━━━ TIME ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +(defpoll hour :interval "10s" "date +%H") +(defpoll minute :interval "10s" "date +%M") +(defpoll dateVar :interval "600s" "date '+%A %d.%m.%y'") + +(defwidget time [] + (eventbox + :cursor "hand" + :hexpand false + :vexpand false + :tooltip "${dateVar}" + :onclick "eww open calendar --toggle &" + (box :orientation "v" :hexpand false :vexpand false :space-evenly false :class "clock" + (label :class "date" :text "${hour}") + + (label :class "date" :text "${minute}") + ) + ) +) + +;; Calendar +(defpoll calendar_day :interval "20h" "date '+%d'") +(defpoll calendar_year :interval "20h" "date '+%Y'") +(defwidget cal [] + (box :class "cal" :orientation "v" + (box :class "cal-in" + (calendar :class "cal" + :day calendar_day + :year calendar_year)))) + +(defwindow calendar + :monitor 0 + :geometry (geometry :x "53px" + :y "5px" + :anchor "bottom left" + :width "270px" + :height "60px") + (cal)) + +(deflisten workspaces_listen "./scripts/workspaces.sh") (defwidget workspaces [] - (box :class "workspaces" - :orientation "h" - :space-evenly true - :halign "start" - :spacing 10 - (button :onclick "wmctrl -s 0" 1) - (button :onclick "wmctrl -s 1" 2) - (button :onclick "wmctrl -s 2" 3) - (button :onclick "wmctrl -s 3" 4) - (button :onclick "wmctrl -s 4" 5) - (button :onclick "wmctrl -s 5" 6) - (button :onclick "wmctrl -s 6" 7) - (button :onclick "wmctrl -s 7" 8) - (button :onclick "wmctrl -s 8" 9))) - -(defwidget music [] - (box :class "music" - :orientation "h" - :space-evenly false - :halign "center" - {music != "" ? "🎡${music}" : ""})) - - -(defwidget metric [label value onchange] - (box :orientation "h" - :class "metric" - :space-evenly false - (box :class "label" label) - (scale :min 0 - :max 101 - :active {onchange != ""} - :value value - :onchange onchange))) - - - -(deflisten music :initial "" - "playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true") - -(defpoll volume :interval "1s" - "scripts/getvol") - -(defpoll time :interval "10s" - "date '+%H:%M %b %d, %Y'") + (literal :content workspaces_listen)) (defwindow bar :monitor 0 - :windowtype "dock" - :geometry (geometry :x "0%" - :y "0%" - :width "90%" - :height "10px" - :anchor "top center") - :reserve (struts :side "top" :distance "4%") + :exclusive false + :geometry (geometry :height "1080px" :x "-4px" :y "0px" + :width "52px" + :anchor "top left") + :stacking "fg" (bar)) diff --git a/hosts/thalassa/aoife/home/eww/scripts/do-not-disturb.sh b/hosts/thalassa/aoife/home/eww/scripts/do-not-disturb.sh new file mode 100755 index 00000000..fe35e03c --- /dev/null +++ b/hosts/thalassa/aoife/home/eww/scripts/do-not-disturb.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env nix-shell +#! nix-shell -p jq -i bash + +if makoctl mode | rg -q "do-not-disturb"; then + eww update dnd="ο–™" + makoctl mode -r do-not-disturb > /dev/null +else + eww update dnd="ο–š" + makoctl mode -a do-not-disturb > /dev/null +fi diff --git a/hosts/thalassa/aoife/home/eww/scripts/volume.sh b/hosts/thalassa/aoife/home/eww/scripts/volume.sh new file mode 100755 index 00000000..57797371 --- /dev/null +++ b/hosts/thalassa/aoife/home/eww/scripts/volume.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +per="???" + +if pamixer --get-mute | rg -q true; then + icon="οͺ€" +elif [ "$per" -gt 66 ]; then + icon="ο©½" # high +elif [ "$per" -gt 33 ]; then + icon="ο©Ώ" # med +else + icon="ο©Ύ" #low +fi + +printf "{\"icon\": \"${icon}\", \"percent\": \"${per}\"}" diff --git a/hosts/thalassa/aoife/home/eww/scripts/wifi.sh b/hosts/thalassa/aoife/home/eww/scripts/wifi.sh new file mode 100755 index 00000000..e3601ad0 --- /dev/null +++ b/hosts/thalassa/aoife/home/eww/scripts/wifi.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if wpa_cli status | rg -q "wpa_state=COMPLETED"; then + icon="οͺ¨" + status="Connected" +else + icon="οͺ©" + status="offline" +fi + +printf "{\"icon\": \"${icon}\", \"status\": \"${status}\"}" diff --git a/hosts/thalassa/aoife/home/eww/scripts/workspaces.lua b/hosts/thalassa/aoife/home/eww/scripts/workspaces.lua new file mode 100755 index 00000000..43b14785 --- /dev/null +++ b/hosts/thalassa/aoife/home/eww/scripts/workspaces.lua @@ -0,0 +1,21 @@ +#!/usr/bin/env lua + +aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'") +active_workspace = aw:read("*a") +aw:close() + +box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" " + +for i = 1,10 do + if i == tonumber(active_workspace) then + local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..i.." \" \"ο„‘\")" + box = box .. btn + else + local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..i.."\" \"ο„‘\")" + box = box .. btn + end +end + +box = box .. ")" + +print(box) diff --git a/hosts/thalassa/aoife/home/eww/scripts/workspaces.sh b/hosts/thalassa/aoife/home/eww/scripts/workspaces.sh new file mode 100755 index 00000000..23cc9225 --- /dev/null +++ b/hosts/thalassa/aoife/home/eww/scripts/workspaces.sh @@ -0,0 +1,10 @@ +#!/bin/sh +workspaces() { + ./scripts/workspaces.lua +} + +workspaces + +tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep --line-buffered "Changed to workspace" | while read -r; do + workspaces +done diff --git a/hosts/thalassa/aoife/home/hyprland.conf b/hosts/thalassa/aoife/home/hyprland.conf deleted file mode 100644 index e148387c..00000000 --- a/hosts/thalassa/aoife/home/hyprland.conf +++ /dev/null @@ -1,156 +0,0 @@ -# See https://wiki.hyprland.org/Configuring/Monitors/ -monitor=,preferred,auto,auto - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more - -# Execute your favorite apps at launch -# exec-once = waybar & hyprpaper & firefox - -# Source a file (multi-file configs) -# source = ~/.config/hypr/myColors.conf - -# Set programs that you use -$terminal = kitty -$fileManager = dolphin -$menu = wofi --show drun - -# Some default env vars. -# env = XCURSOR_SIZE,24 - -# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ -input { - kb_options=caps:escape - touchpad { - natural_scroll= true - } -} - -general { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - gaps_in = 5 - gaps_out = 20 - border_size = 2 - col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg - col.inactive_border = rgba(595959aa) - - layout = dwindle - - # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on - allow_tearing = false -} - -decoration { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - - rounding = 10 - - blur { - enabled = true - size = 3 - passes = 1 - } - - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) -} - -animations { - enabled = yes - - # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - - animation = windows, 1, 7, myBezier - animation = windowsOut, 1, 7, default, popin 80% - animation = border, 1, 10, default - animation = borderangle, 1, 8, default - animation = fade, 1, 7, default - animation = workspaces, 1, 6, default -} - -dwindle { - # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = yes # you probably want this -} - -gestures { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - workspace_swipe = true -} - -misc { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - force_default_wallpaper = 2 # Set to 0 or 1 to disable the anime mascot wallpapers -} - -# Window Rules -windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. -windowrulev2 = workspace 1 silent, class:^(Element)$ -windowrulev2 = workspace 1 silent, class:^(discord)$ -windowrulev2 = workspace 2 silent, class:^(firefox)$ -windowrulev2 = float,class:^(firefox)$,title:^(Picture-in-Picture)$ - -# See https://wiki.hyprland.org/Configuring/Keywords/ for more -$mainMod = SUPER - -# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more -bind = $mainMod, RETURN, exec, $terminal -bind = $mainMod, Q, killactive, -bind = $mainMod SHIFT, escape, exit, -bind = $mainMod, E, exec, $fileManager -bind = $mainMod, V, togglefloating, -bind = $mainMod, D, exec, $menu -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, J, togglesplit, # dwindle - -# Fullscreen -bind=SUPER,m,fullscreen - -# Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d - -# Switch workspaces with mainMod + [0-9] -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 - -# Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 - -# Example special workspace (scratchpad) -bind = $mainMod, S, togglespecialworkspace, magic -bind = $mainMod SHIFT, S, movetoworkspace, special:magic - -# Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 - -# Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow - -# vim: ft=hyprlang diff --git a/hosts/thalassa/aoife/home/hyprland.nix b/hosts/thalassa/aoife/home/hyprland.nix index 2751c5df..6505e2ec 100644 --- a/hosts/thalassa/aoife/home/hyprland.nix +++ b/hosts/thalassa/aoife/home/hyprland.nix @@ -1,5 +1,32 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { + + systemd.user.services.mako = { + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + Service = { + Type = "dbus"; + BusName = "org.freedesktop.Notifications"; + + ExecCondition = '' + ${pkgs.bash}/bin/bash -c '[ -n "$WAYLAND_DISPLAY" ]' + ''; + + ExecStart = '' + ${pkgs.mako}/bin/mako + ''; + + ExecReload = '' + ${pkgs.mako}/bin/makoctl reload + ''; + + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + programs = { wofi = { enable = true; @@ -7,12 +34,14 @@ eww = { enable = true; - package = pkgs.eww-wayland; configDir = ./eww; }; + mako.enable = true; + waybar = { enable = true; + style = ./waybar.css; settings = { mainBar = { layer = "top"; @@ -20,7 +49,57 @@ height = 30; modules-left = [ "hyprland/workspaces" ]; modules-center = [ "clock" ]; - modules-right = [ "wireplumber" "power-profiles-daemon" "network" "battery" ]; + modules-right = [ + "wireplumber" + "power-profiles-daemon" + "network" + "battery" + ]; + + wireplumber = { + format = "σ°•Ύ {volume}%"; + format-muted = "󰖁"; + }; + + network = { + format-wifi = "σ°–© {essid} ({signalStrength}%)"; + format-ethernet = "σ°ˆ€ {ifname}: {ipaddr}/{cidr}"; + format-disconnected = "σ°Œ™ "; + tooltip-format = "{ifname}: {ipaddr}"; + }; + + power-profiles-daemon = { + format = "{icon}"; + format-icons = { + performance = "σ°“…"; + balanced = "σ°Ύ…"; + power-saver = "σ°Ύ†"; + }; + }; + + battery = { + states = { + warning = 30; + critical = 15; + }; + + format = "󱐋 {capacity}%"; + format-discharging = "{icon} {capacity}%"; + + format-icons = [ + "σ°‚Ž" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "σ°‚€" + "󰂁" + "σ°‚‚" + "󰁹" + ]; + }; }; }; systemd = { @@ -30,134 +109,164 @@ }; }; - wayland.windowManager.hyprland = { - enable = true; - systemd.enable = true; + wayland.windowManager.hyprland = + let + toggle_mirror = pkgs.writeScriptBin "toggle_mirror.sh" '' + #!/usr/bin/env bash + if [ $(hyprctl monitors all -j | ${pkgs.jq}/bin/jq '.[1].activeWorkspace.id') = '-1' ]; then + hyprctl keyword monitor ",preferred,auto,1" + else + hyprctl keyword monitor ",preferred,auto,1,mirror,eDP-1" + fi + ''; + in + { + enable = true; + systemd.enable = true; - settings = { - monitor = ",preferred,auto,auto"; - input = { - kb_options = "caps:escape"; - touchpad.natural_scroll = true; - }; - general = { - gaps_in = 5; - gaps_out = 20; - border_size = 2; - "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; - layout = "dwindle"; - # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on - allow_tearing = false; - }; - decoration = { - rounding = 10; + settings = + let + inherit (builtins) genList concatLists toString; + wpctl = "${pkgs.wireplumber}/bin/wpctl"; + brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; + menu = "${config.programs.wofi.package}/bin/wofi --show run,drun"; + terminal = "${config.programs.kitty.package}/bin/kitty"; + fileManager = "${pkgs.gnome.nautilus}/bin/nautilus"; + in + { + "$mod" = "SUPER"; + exec-once = [ + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + ]; + monitor = [ + "eDP-1, 3840x2400@60,0x0,2" + ",highres,auto,1" + ]; + input = { + touchpad.natural_scroll = true; + }; + general = { + gaps_in = 5; + gaps_out = 20; + border_size = 2; + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + layout = "dwindle"; + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false; + }; + decoration = { + rounding = 10; - blur = { - enabled = true; - size = 3; - passes = 1; + blur = { + enabled = true; + size = 3; + passes = 1; + }; + + drop_shadow = "yes"; + shadow_range = 4; + shadow_render_power = 3; + "col.shadow" = "rgba(1a1a1aee)"; + }; + animations = { + enabled = "yes"; + + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + + animation = [ + "windows, 1, 7, myBezier" + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + ]; + }; + dwindle = { + preserve_split = "yes"; + pseudotile = "yes"; + }; + gestures.workspace_swipe = true; + + misc = { + force_default_wallpaper = 1; + disable_splash_rendering = true; + }; + + windowrulev2 = [ + "suppressevent maximize, class:.* # You'll probably like this." + "workspace 1 silent, class:^(Element)$" + "workspace 1 silent, class:^(discord)$" + "workspace 2 silent, class:^(firefox)$" + "float,class:^(firefox)$,title:^(Picture-in-Picture)$" + ]; + + # l -> works when screen is locked + # e -> repeats when held + bindel = [ + ",XF86AudioRaiseVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ",XF86AudioLowerVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ",XF86MonBrightnessUp,exec,${brightnessctl} -q s +5%" + ",XF86MonBrightnessDown,exec,${brightnessctl} -q s 5%-" + ]; + + bindl = [ ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" ]; + + bind = + [ + "$mod, RETURN, exec, ${terminal}" + "$mod, Q, killactive," + "$mod SHIFT, escape, exit," + "$mod, E, exec, ${fileManager}" + "$mod, V, togglefloating," + "$mod, D, exec, ${menu}" + "$mod, P, pseudo, # dwindle" + "$mod, J, togglesplit, # dwindle" + "SUPER,m,fullscreen" + + # Move focus with arrow keys + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + + # Scratch workspace + "$mod, S, togglespecialworkspace, magic" + "$mod SHIFT, S, movetoworkspace, special:magic" + + # PrintScreen + ",Print,exec, grimblast copysave area /home/vivian/cloud/Pictures/Screenshots/$(date --iso=seconds).png" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + concatLists ( + genList ( + x: + let + ws = + let + c = (x + 1) / 10; + in + toString (x + 1 - (c * 10)); + in + [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}" + ] + ) 10 + ) + + ); + + # Bind mouse + bindm = [ + # Move/resize windows with mod + LMB/RMB and dragging + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; }; - - drop_shadow = "yes"; - shadow_range = 4; - shadow_render_power = 3; - "col.shadow" = "rgba(1a1a1aee)"; - }; - animations = { - enabled = "yes"; - - bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; - - animation = [ - "windows, 1, 7, myBezier" - "windowsOut, 1, 7, default, popin 80%" - "border, 1, 10, default" - "borderangle, 1, 8, default" - "fade, 1, 7, default" - "workspaces, 1, 6, default" - ]; - }; - dwindle = { - preserve_split = "yes"; - pseudotile = "yes"; - }; - gestures.workspace_swipe = true; }; - extraConfig = '' - $terminal = kitty - $fileManager = dolphin - $menu = wofi --show drun - misc { - # See https://wiki.hyprland.org/Configuring/Variables/ for more - force_default_wallpaper = 2 # Set to 0 or 1 to disable the anime mascot wallpapers - disable_splash_rendering = true - } - - # Window Rules - windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. - windowrulev2 = workspace 1 silent, class:^(Element)$ - windowrulev2 = workspace 1 silent, class:^(discord)$ - windowrulev2 = workspace 2 silent, class:^(firefox)$ - windowrulev2 = float,class:^(firefox)$,title:^(Picture-in-Picture)$ - - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - $mainMod = SUPER - - # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more - bind = $mainMod, RETURN, exec, $terminal - bind = $mainMod, Q, killactive, - bind = $mainMod SHIFT, escape, exit, - bind = $mainMod, E, exec, $fileManager - bind = $mainMod, V, togglefloating, - bind = $mainMod, D, exec, $menu - bind = $mainMod, P, pseudo, # dwindle - bind = $mainMod, J, togglesplit, # dwindle - - # Fullscreen - bind=SUPER,m,fullscreen - - # Move focus with mainMod + arrow keys - bind = $mainMod, left, movefocus, l - bind = $mainMod, right, movefocus, r - bind = $mainMod, up, movefocus, u - bind = $mainMod, down, movefocus, d - - # Switch workspaces with mainMod + [0-9] - bind = $mainMod, 1, workspace, 1 - bind = $mainMod, 2, workspace, 2 - bind = $mainMod, 3, workspace, 3 - bind = $mainMod, 4, workspace, 4 - bind = $mainMod, 5, workspace, 5 - bind = $mainMod, 6, workspace, 6 - bind = $mainMod, 7, workspace, 7 - bind = $mainMod, 8, workspace, 8 - bind = $mainMod, 9, workspace, 9 - bind = $mainMod, 0, workspace, 10 - - # Move active window to a workspace with mainMod + SHIFT + [0-9] - bind = $mainMod SHIFT, 1, movetoworkspace, 1 - bind = $mainMod SHIFT, 2, movetoworkspace, 2 - bind = $mainMod SHIFT, 3, movetoworkspace, 3 - bind = $mainMod SHIFT, 4, movetoworkspace, 4 - bind = $mainMod SHIFT, 5, movetoworkspace, 5 - bind = $mainMod SHIFT, 6, movetoworkspace, 6 - bind = $mainMod SHIFT, 7, movetoworkspace, 7 - bind = $mainMod SHIFT, 8, movetoworkspace, 8 - bind = $mainMod SHIFT, 9, movetoworkspace, 9 - bind = $mainMod SHIFT, 0, movetoworkspace, 10 - - # Example special workspace (scratchpad) - bind = $mainMod, S, togglespecialworkspace, magic - bind = $mainMod SHIFT, S, movetoworkspace, special:magic - - # Scroll through existing workspaces with mainMod + scroll - bind = $mainMod, mouse_down, workspace, e+1 - bind = $mainMod, mouse_up, workspace, e-1 - - # Move/resize windows with mainMod + LMB/RMB and dragging - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - ''; - }; } diff --git a/hosts/thalassa/aoife/home/waybar.css b/hosts/thalassa/aoife/home/waybar.css new file mode 100644 index 00000000..bdd07a44 --- /dev/null +++ b/hosts/thalassa/aoife/home/waybar.css @@ -0,0 +1,125 @@ +/* Catppucin Frappe */ +@define-color base #303446; +@define-color mantle #292c3c; +@define-color crust #232634; + +@define-color text #c6d0f5; +@define-color subtext0 #a5adce; +@define-color subtext1 #b5bfe2; + +@define-color surface0 #414559; +@define-color surface1 #51576d; +@define-color surface2 #626880; + +@define-color overlay0 #737994; +@define-color overlay1 #838ba7; +@define-color overlay2 #949cbb; + +@define-color blue #8caaee; +@define-color lavender #babbf1; +@define-color sapphire #85c1dc; +@define-color sky #99d1db; +@define-color teal #81c8be; +@define-color green #a6d189; +@define-color yellow #e5c890; +@define-color peach #ef9f76; +@define-color maroon #ea999c; +@define-color red #e78284; +@define-color mauve #ca9ee6; +@define-color pink #f4b8e4; +@define-color flamingo #eebebe; +@define-color rosewater #f2d5cf; + + +window { + border: none; + font-family: DejaVuSansM Nerd Font, sans-serif; + font-size: 13px; + color: @text; +} + +window#waybar { + color: @text; + background-color: rgba(0, 0, 0, 0); + transition-property: background-color; + transition-duration: 0.5s; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +#workspaces { + /* background: @overlay0; */ +} + +#workspaces button { + color: @text; + background: @background3; + /* margin: 7px 5px 10px 5px; */ +} + +#workspaces button:hover { + background: @surface0; + color: @text; +} + +#workspaces button.active { + color: @crust; + background: @overlay2; + border: none; +} + +#clock, +#battery, +#network, +#power-profiles-daemon, +#wireplumber { + padding: 0px 20px; + border-radius: 8px; + margin-left: 5px; + color: @crust; +} + +#wireplumber { + padding: 0px 20px 0px 17px; + background-color: @teal; +} + +#network { + padding: 0px 15px 0px 20px; + background-color: @green; +} + +#battery { + background-color: @lavender; +} + +#clock { + background-color: @pink; +} + +#power-profiles-daemon { + background-color: @mauve; +} + +@keyframes blink { + to { + background-color: rgba(30, 34, 42, 0.5); + color: #abb2bf; + } +} + +#battery.critical:not(.charging) { + color: #f53c3c; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +}