diff --git a/flake.lock b/flake.lock index 13774130..f7c11405 100644 --- a/flake.lock +++ b/flake.lock @@ -64,6 +64,27 @@ "type": "github" } }, + "crane": { + "inputs": { + "nixpkgs": [ + "hyprsome", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707685877, + "narHash": "sha256-XoXRS+5whotelr1rHiZle5t5hDg9kpguS5yk8c8qzOc=", + "owner": "ipetkov", + "repo": "crane", + "rev": "2c653e4478476a52c6aa3ac0495e4dea7449ea0e", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -175,6 +196,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flakelib": { "inputs": { "fl-config": "fl-config", @@ -234,6 +273,117 @@ "type": "github" } }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang", + "nixpkgs": "nixpkgs", + "systems": "systems", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1708452876, + "narHash": "sha256-UrFrNfIwd0pcCTZYc6RAppzvpL6icfhelFMgufY5vxU=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "13d985489788fa5349b3457d6eb1c19bad8f37e9", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708005943, + "narHash": "sha256-9TT3xk++LI5/SPYgjYX34xZ4ebR93c1uerIq+SE/ues=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "aeb3e012adc7b3235335c540b214b82267c2b983", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlang_2": { + "inputs": { + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704287638, + "narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "6624f2bb66d4d27975766e81f77174adbe58ec97", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprsome": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1708469806, + "narHash": "sha256-BBEVzd9Zy52FDGlr+7/kPHMvmifIuDqOf2qxKcXNkgs=", + "owner": "kittywitch", + "repo": "hyprsome", + "rev": "234ce1fc0946e3080e53dc33af72fca7a2da8432", + "type": "github" + }, + "original": { + "owner": "kittywitch", + "repo": "hyprsome", + "type": "github" + } + }, "konawall-py": { "inputs": { "flake-utils": [ @@ -244,11 +394,11 @@ ] }, "locked": { - "lastModified": 1707190092, - "narHash": "sha256-yn9ng8nXcbsWZ2RZ1DgWvYE4YykmfSh4eDye7wS9G8U=", + "lastModified": 1708208882, + "narHash": "sha256-Th5ybDsLfWJWDLGeLKLvrYYBQWLarZxWQyWWNNpZg+c=", "owner": "kittywitch", "repo": "konawall-py", - "rev": "a461bf400fae30ed513e97adfa7ac741cdf6e0c7", + "rev": "51fe663a47c4ad4d36dcd316495c58213e501785", "type": "github" }, "original": { @@ -376,15 +526,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706913249, - "narHash": "sha256-x3M7iV++CsvRXI1fpyFPduGELUckZEhSv0XWnUopAG8=", - "owner": "nixos", + "lastModified": 1707546158, + "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "e92b6015881907e698782c77641aa49298330223", + "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -406,6 +556,38 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1708407374, + "narHash": "sha256-EECzarm+uqnNDCwaGg/ppXCO11qibZ1iigORShkkDf0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f33dd27a47ebdf11dc8a5eb05e7c8fbdaf89e73f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1706913249, + "narHash": "sha256-x3M7iV++CsvRXI1fpyFPduGELUckZEhSv0XWnUopAG8=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e92b6015881907e698782c77641aa49298330223", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "plasma-manager": { "inputs": { "home-manager": [ @@ -455,12 +637,14 @@ "empty": "empty", "flake-compat": "flake-compat", "home-manager": "home-manager", + "hyprland": "hyprland", + "hyprsome": "hyprsome", "konawall-py": "konawall-py", "mach-nix": "mach-nix", "minecraft": "minecraft", "nix-index-database": "nix-index-database", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_3", "plasma-manager": "plasma-manager", "pypi-deps-db": "pypi-deps-db", "scalpel": "scalpel", @@ -592,6 +776,36 @@ } }, "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -631,7 +845,7 @@ }, "utils": { "inputs": { - "systems": "systems" + "systems": "systems_3" }, "locked": { "lastModified": 1705309234, @@ -647,6 +861,25 @@ "type": "github" } }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1706359063, + "narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2", + "type": "gitlab" + } + }, "wsl": { "inputs": { "flake-compat": [ @@ -672,6 +905,36 @@ "repo": "NixOS-WSL", "type": "github" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": "hyprlang_2", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1706521509, + "narHash": "sha256-AInZ50acOJ3wzUwGzNr1TmxGTMx+8j6oSTzz4E7Vbp8=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "c06fd88b3da492b8f9067be021b9184f7012b5a8", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index c696b4df..c4e6c1ba 100644 --- a/flake.nix +++ b/flake.nix @@ -91,6 +91,8 @@ url = "github:DavHau/pypi-deps-db"; flake = false; }; + hyprland.url = "github:hyprwm/Hyprland"; + hyprsome.url = "github:kittywitch/hyprsome"; # nixified python environments mach-nix = { url = "mach-nix/3.5.0"; diff --git a/home/environments/hyprland/gtk.nix b/home/environments/hyprland/gtk.nix new file mode 100644 index 00000000..9f673603 --- /dev/null +++ b/home/environments/hyprland/gtk.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: { + home.pointerCursor = { + gtk.enable = true; + # x11.enable = true; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 16; + }; + + gtk = { + enable = true; + theme = { + package = pkgs.flat-remix-gtk; + name = "Flat-Remix-GTK-Grey-Darkest"; + }; + + iconTheme = { + package = pkgs.gnome.adwaita-icon-theme; + name = "Adwaita"; + }; + + font = { + name = "Sans"; + size = 11; + }; + }; +} \ No newline at end of file diff --git a/home/environments/hyprland/hyprland.nix b/home/environments/hyprland/hyprland.nix new file mode 100644 index 00000000..c53c4bfc --- /dev/null +++ b/home/environments/hyprland/hyprland.nix @@ -0,0 +1,142 @@ +{ + config, + lib, + std, + pkgs, + inputs, + ... +}: let + inherit (std) list; +in { + home.packages = with pkgs; [ + grimblast + wl-clipboard + wlr-randr + wl-screenrec + slurp + grim + swww + inputs.hyprsome.packages.${pkgs.system}.default + ]; + home.sessionVariables = { + QT_QPA_PLATFORM = "wayland"; + SDL_VIDEODRIVER = "wayland"; + XDG_SESSION_TYPE = "wayland"; + }; + systemd.user.services.swayidle.Install.WantedBy = lib.mkForce ["hyprland-session.target"]; + wayland.windowManager.hyprland = { + enable = true; + systemd = { + enable = true; + variables = ["--all"]; + extraCommands = [ + "systemctl --user stop graphical-session.target" + "systemctl --user start hyprland-session.target" + ]; + }; + xwayland.enable = true; + settings = { + "$mod" = "SUPER"; + input = { + kb_options = "ctrl:nocaps"; + }; + monitor = [ + "HDMI-A-2, 1920x1080, 0x0, 1" + "eDP-1, 1920x1080, 1920x0, 1" + ]; + workspace = ["1,monitor:eDP-1,default:true"] ++ (list.map (workspace: + "${toString workspace},monitor:eDP-1" + ) (list.range 2 10)) ++ [ "11,monitor:DP-3,default:true"] ++ (list.map (workspace: + "${toString workspace},monitor:DP-3" + ) (list.range 12 20)); + /*list.concat (list.generate ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "${toString x},monitor:eDP-1" + "${toString (x + 10)},monitor:DP-3" + ] + ) + 10);*/ + exec-once = [ + "${pkgs.libsForQt5.polkit-kde-agent}/bin/polkit-kde-agent" + "${pkgs.networkmanagerapplet}/bin/nm-applet" + "${pkgs.mako}/bin/mako" + "${pkgs.swww}/bin/swww init" + "${pkgs.systemd}/bin/systemctl --user restart waybar.service" + "${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall" + ]; + xwayland = { + force_zero_scaling = true; + }; + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod ALT, mouse:272, resizewindow" + ]; + bind = + [ + "$mod, F, exec, firefox" + "$mod, R, exec, wofi -t wezterm -IS drun" + "$mod SHIFT, R, exec, wofi -t wezterm -IS run" + "$mod, Return, exec, wezterm" + ", Print, exec, grimblast copy area" + + "$mod SHIFT, E, exec, pkill Hyprland" + "$mod, Q, killactive," + "$mod, F, fullscreen," + "$mod, G, togglegroup," + "$mod SHIFT, N, changegroupactive, f" + "$mod SHIFT, P, changegroupactive, b" + "$mod, R, togglesplit," + "$mod, T, togglefloating," + "$mod, P, pseudo," + "$mod ALT, ,resizeactive," + "$mod, Escape, exec, wlogout -p layer-shell" + "$mod, L, exec, loginctl lock-session" + + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "$mod SHIFT, left, movewindow, l" + "$mod SHIFT, right, movewindow, r" + "$mod SHIFT, up, movewindow, u" + "$mod SHIFT, down, movewindow, d" + "CTRL, Print, exec, grimblast --notify --cursor copysave output" + "$mod SHIFT CTRL, R, exec, grimblast --notify --cursor copysave output" + + "ALT, Print, exec, grimblast --notify --cursor copysave screen" + "$mod SHIFT ALT, R, exec, grimblast --notify --cursor copysave screen" + + "$mod, bracketleft, workspace, m-1" + "$mod, bracketright, workspace, m+1" + + "$mod SHIFT, bracketleft, focusmonitor, l" + "$mod SHIFT, bracketright, focusmonitor, r" + + "$mod SHIFT ALT, bracketleft, movecurrentworkspacetomonitor, l" + "$mod SHIFT ALT, bracketright, movecurrentworkspacetomonitor, r" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + list.concat (list.generate ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, exec, hyprsome workspace ${toString (x + 1)}" + "$mod SHIFT, ${ws}, exec, hyprsome move ${toString (x + 1)}" + ] + ) + 10) + ); + }; + }; +} diff --git a/home/environments/hyprland/konawall.nix b/home/environments/hyprland/konawall.nix new file mode 100644 index 00000000..024ec803 --- /dev/null +++ b/home/environments/hyprland/konawall.nix @@ -0,0 +1,34 @@ +{ + inputs, + pkgs, + ... +}: let + desktop_entry = '' + [Desktop Entry] + Exec=${inputs.konawall-py.packages.${pkgs.system}.konawall-py}/bin/konawall + Icon= + Name=konawall + Path= + Terminal=False + Type=Application + ''; + konawallConfig = { + interval = 30 * 60; + rotate = true; + source = "konachan"; + tags = [ + "rating:s" + "touhou" + "score:>=50" + "width:>=1500" + ]; + logging = { + file = "INFO"; + console = "DEBUG"; + }; + }; +in { + xdg.configFile = { + "konawall/config.toml".source = (pkgs.formats.toml {}).generate "konawall-config" konawallConfig; + }; +} diff --git a/home/environments/hyprland/swaylock.nix b/home/environments/hyprland/swaylock.nix new file mode 100644 index 00000000..c65bb15e --- /dev/null +++ b/home/environments/hyprland/swaylock.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: { + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + clock = true; + font = "Iosevka"; + indicator = true; + }; + }; +} diff --git a/home/environments/hyprland/waybar.nix b/home/environments/hyprland/waybar.nix new file mode 100644 index 00000000..a10cacae --- /dev/null +++ b/home/environments/hyprland/waybar.nix @@ -0,0 +1,100 @@ +{ + kittywitch, + pkgs, + config, + ... +}: { + systemd.user.services.waybar.Unit.X-Restart-Triggers = [ + (builtins.hashString "md5" (builtins.toJSON config.programs.waybar.settings)) + ]; + programs.waybar = { + enable = true; + style = let + template = kittywitch.sassTemplate { + name = "waybar-style"; + src = ./waybar.sass; + }; + in + template.source; + systemd.enable = true; + settings.main = { + layer = "top"; + position = "top"; + height = 24; + + # Modules Placement + modules-left = [ + "hyprland/workspaces" + "hyprland/submap" + "hyprland/window" + ]; + modules-right = [ + "network" + "temperature" + "idle_inhibitor" + "tray" + "battery" + "clock" + ]; + + # Modules Definition + "hyprland/workspaces" = { + format = "{icon}"; + /*format-icons = { + # https://fontawesome.com/v5/cheatsheet + "1" = ""; # chats + "2" = ""; # cloud (browser) + "3" = ""; # music + "4" = ""; # brain + "5" = ""; # terminal >_ + };*/ + }; + "hyprland/window" = { + format = "{}"; + rewrite = { + "(.*) — Mozilla Firefox" = "🌎 $1"; + "(.*) - fish" = "> [$1]"; + }; + }; + tray = { + show-passive-items = true; + icon-size = 12; + spacing = 2; + }; + mpris = { + format = "{player_icon} {dynamic}"; + format-paused = "{status_icon} {dynamic}"; + player-icons = { + default = ""; + brave = ""; + mpv = ""; + spotify = ""; + }; + status-icons = { + paused = ""; + }; + }; + temperature = { + format = " {temperatureC}°C"; + critical-threshold = 80; + }; + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; + network = { + format-wifi = " {essid} ({signalStrength}%)"; + format-ethernet = " {ipaddr}/{cidr}"; + format-linked = " No IP"; + format-disconnected = " Disconnected"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; + clock = { + format = "{:%F %H:%M %Z}"; + }; + }; + }; +} diff --git a/home/environments/hyprland/waybar.sass b/home/environments/hyprland/waybar.sass new file mode 100644 index 00000000..aaea8750 --- /dev/null +++ b/home/environments/hyprland/waybar.sass @@ -0,0 +1,84 @@ +* + padding: 0 + margin: 0 + border: none + border-radius: 0 + background: none + font-family: "Iosevka", "Font Awesome 6 Free", "Font Awesome 6 Brands" + font-size: $font_size + text-shadow: none + box-shadow: none + +%widget_unpadded + transition: none + background: $base01 + color: $base07 + margin: 0 4px + +%widget + @extend %widget_unpadded + padding: 0 4px + +window#waybar + background: rgba($base00, 0.9) + border-bottom: 2px solid transparent + +// sway/workspaces +#workspaces + @extend %widget_unpadded + button + color: $base06 + &.focused + color: $base07 + background: $base0D + + &:hover + transition: none + box-shadow: inherit + text-shadow: inherit + background: $base06 + color: $base0C + + +// widgets +#mode, window#waybar #window, +#custom-clock, #mpris, +#clock, #pulseaudio, #backlight, #network, #temperature, #battery, #idle_inhibitor, #tray, #tray menu + @extend %widget + +// hide when empty +window#waybar.empty #window + opacity: 0 + + +// tooltips +tooltip + background: rgba($base00, 0.9) + label + color: $base07 + +// mpris player and state +#mpris + &.spotify + background: #191414 + color: #1DB954 + + &.paused + background: $base01 + color: $base03 + +/*.modules-left + #window + widget + label + margin: 0 + + &:first-child + margin-left: 0 + + &:last-child + margin-right: 0*/ + +.modules-center + +.modules-right diff --git a/home/environments/hyprland/wlogout.nix b/home/environments/hyprland/wlogout.nix new file mode 100644 index 00000000..c7493482 --- /dev/null +++ b/home/environments/hyprland/wlogout.nix @@ -0,0 +1,5 @@ +_: { + programs.wlogout = { + enable = true; + }; +} diff --git a/home/environments/hyprland/wofi.nix b/home/environments/hyprland/wofi.nix new file mode 100644 index 00000000..8d408389 --- /dev/null +++ b/home/environments/hyprland/wofi.nix @@ -0,0 +1,20 @@ +{kittywitch, ...}: { + programs.wofi = { + enable = true; + settings = { + style = let + template = kittywitch.sassTemplate { + name = "wofi-style"; + src = ./wofi.sass; + }; + in + template.source; + insensitive = true; + allow_images = true; + hide_scroll = true; + width = "25%"; + mode = "dmenu"; + prompt = ""; + }; + }; +} diff --git a/home/environments/hyprland/wofi.sass b/home/environments/hyprland/wofi.sass new file mode 100644 index 00000000..cf68cb41 --- /dev/null +++ b/home/environments/hyprland/wofi.sass @@ -0,0 +1,26 @@ +#scroll + background: $base01 + border: 1px solid $base03 + +#input + background: $base01 + border: 1px solid $base0C + margin: 1em + background: $base02 + color: $base04 + +window + font-family: $font + background: rgba($base00, .9) + border-radius: 1em + font-size: $font_size + color: $base07 + +#outer-box + margin: 1em + +#entry + border-bottom: 1px dashed $base04 + padding: .75em + &:selected + background-color: $base0D diff --git a/home/profiles/graphical/firefox.nix.old b/home/profiles/graphical/firefox.nix.old new file mode 100644 index 00000000..a29b8a4a --- /dev/null +++ b/home/profiles/graphical/firefox.nix.old @@ -0,0 +1,135 @@ +{ config, pkgs, ... }: { + home.sessionVariables = { + BROWSER = "firefox"; + }; + + programs.firefox = { + enable = true; + packageUnwrapped = pkgs.firefox-unwrapped; + wrapperConfig = { + extraPolicies = { + DisableAppUpdate = true; + }; + }; + profiles = { + main = { + id = 0; + isDefault = true; + settings = { + # Derived from https://github.com/arcnmx/home/blob/9eb1cd4dd43883e1a0c6a2a55c00d7c3bede1776/cfg/firefox/default.nix#L7 + # and https://git.ztn.sh/zotan/snowleopard/src/branch/dev/assets/prefs.js + "browser.download.dir" = "${config.xdg.userDirs.absolute.download}"; + "services.sync.engine.prefs" = false; + "services.sync.engine.prefs.modified" = false; + "services.sync.engine.passwords" = false; + "services.sync.declinedEngines" = "passwords,adblockplus,prefs"; + "media.eme.enabled" = true; # whee drm + "gfx.webrender.all.qualified" = true; + "gfx.webrender.all" = true; + "webgl.enable-draft-extensions" = true; + "layers.acceleration.force-enabled" = true; + "gfx.canvas.azure.accelerated" = true; + "browser.ctrlTab.recentlyUsedOrder" = false; + "privacy.resistFingerprinting.block_mozAddonManager" = true; + "extensions.webextensions.restrictedDomains" = ""; + "browser.shell.checkDefaultBrowser" = false; + "spellchecker.dictionary" = "en-CA"; + "ui.context_menus.after_mouseup" = true; + "browser.warnOnQuit" = false; + "browser.quitShortcut.disabled" = true; + "browser.startup.homepage" = "about:blank"; + "browser.contentblocking.category" = "strict"; + "browser.discovery.enabled" = false; + "browser.tabs.multiselect" = true; + "browser.tabs.remote.separatedMozillaDomains" = ""; + "browser.tabs.remote.separatePrivilegedContentProcess" = false; + "browser.tabs.remote.separatePrivilegedMozillaWebContentProcess" = false; + "browser.tabs.unloadOnLowMemory" = true; + "browser.tabs.closeWindowWithLastTab" = false; + "browser.newtab.privateAllowed" = true; + "browser.newtabpage.enabled" = false; + "browser.urlbar.placeholderName" = ""; + "extensions.privatebrowsing.notification" = false; + "browser.startup.page" = 3; + "devtools.chrome.enabled" = true; + #"devtools.debugger.remote-enabled" = true; + "devtools.inspector.showUserAgentStyles" = true; + "services.sync.prefs.sync.privacy.donottrackheader.value" = false; + "services.sync.prefs.sync.browser.safebrowsing.malware.enabled" = false; + "services.sync.prefs.sync.browser.safebrowsing.phishing.enabled" = false; + "app.shield.optoutstudies.enabled" = true; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "datareporting.sessions.current.clean" = true; + "devtools.onboarding.telemetry.logged" = false; + "toolkit.telemetry.updatePing.enabled" = false; + "browser.ping-centre.telemetry" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.hybridContent.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.reportingpolicy.firstRun" = false; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.server" = ""; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.coverage.opt-out" = true; + "toolkit.coverage.enabled" = false; + "toolkit.coverage.endpoint.base" = ""; + "toolkit.crashreporter.infoURL" = ""; + "browser.onboarding.enabled" = false; + "experiments.enabled" = false; + "network.allow-experiments" = false; + "social.directories" = ""; + "social.remote-install.enabled" = false; + "social.toast-notifications.enabled" = false; + "social.whitelist" = ""; + "browser.safebrowsing.malware.enabled" = false; + "browser.safebrowsing.blockedURIs.enabled" = false; + "browser.safebrowsing.downloads.enabled" = false; + "browser.safebrowsing.downloads.remote.enabled" = false; + "browser.safebrowsing.phishing.enabled" = false; + "dom.ipc.plugins.reportCrashURL" = false; + "breakpad.reportURL" = ""; + "beacon.enabled" = false; + "browser.search.geoip.url" = ""; + "browser.search.region" = "CA"; + "browser.search.suggest.enabled" = false; + "browser.search.update" = false; + "browser.selfsupport.url" = ""; + "extensions.getAddons.cache.enabled" = false; + "extensions.pocket.enabled" = true; + "geo.enabled" = false; + "geo.wifi.uri" = false; + "keyword.enabled" = false; + "media.getusermedia.screensharing.enabled" = false; + "media.video_stats.enabled" = false; + "device.sensors.enabled" = false; + "dom.battery.enabled" = false; + "dom.enable_performance" = false; + "network.dns.disablePrefetch" = false; + "network.http.speculative-parallel-limit" = 8; + "network.predictor.cleaned-up" = true; + "network.predictor.enabled" = true; + "network.prefetch-next" = true; + "security.dialog_enable_delay" = 300; + "dom.event.contextmenu.enabled" = true; + "reader.parse-on-load.enabled" = false; + "media.webspeech.synth.enabled" = false; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.fingerprinting.enabled" = true; + "privacy.trackingprotection.cryptomining.enabled" = true; + "privacy.trackingprotection.introCount" = 20; + "signon.rememberSignons" = false; + "xpinstall.whitelist.required" = false; + "xpinstall.signatures.required" = false; + "general.smoothScroll" = false; + "general.warnOnAboutConfig" = false; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/home/profiles/graphical/intellij.nix b/home/profiles/graphical/intellij.nix new file mode 100644 index 00000000..64b0df1c --- /dev/null +++ b/home/profiles/graphical/intellij.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + jetbrains.pycharm-community + ]; +} diff --git a/home/profiles/graphical/media.nix b/home/profiles/graphical/media.nix new file mode 100644 index 00000000..53a42f1e --- /dev/null +++ b/home/profiles/graphical/media.nix @@ -0,0 +1,42 @@ +{ pkgs, lib, ... }: let + inherit (lib.attrsets) mapAttrsToList; +in { + # TODO: remove the libs + programs.mpv = { + enable = true; + scripts = with pkgs.mpvScripts; [ + sponsorblock + paused + ]; + config = { + gpu-context = "wayland"; + profile = "gpu-hq"; + hwdec = "auto"; + vo = "gpu"; + volume-max = 200; + opengl-waitvsync = true; + script-opts = builtins.concatStringsSep "," + (mapAttrsToList (k: v: "${k}=${builtins.toString v}") { + ytdl_hook-ytdl_path = "${pkgs.yt-dlp}/bin/yt-dlp"; + osc-layout = "slimbox"; + osc-vidscale = "no"; + osc-deadzonesize = 0.75; + osc-minmousemove = 4; + osc-hidetimeout = 2000; + osc-valign = 0.9; + osc-timems = "yes"; + osc-seekbarstyle = "knob"; + osc-seekbarkeyframes = "no"; + osc-seekrangestyle = "slider"; + }); + }; + }; + + programs.zsh.shellAliases = { + yt = "mpv --ytdl-format='bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best[height<=720]'"; # Laptop doesn't like above 720p :c + }; + home.packages = with pkgs; [ + yt-dlp # Watch videos from multiple sources without having to use a browser for it + ytcc # Subscriptions manager and RSS feed exporter for YouTube + ]; +} diff --git a/home/profiles/graphical/packages.nix b/home/profiles/graphical/packages.nix index f2c4c834..8f077d95 100644 --- a/home/profiles/graphical/packages.nix +++ b/home/profiles/graphical/packages.nix @@ -15,6 +15,7 @@ # Chat discord + gtkcord4 nheko # Matrix tdesktop # Telegram dino # XMPP @@ -31,7 +32,6 @@ lm_sensors # Sensor Data cryptsetup # Encrypted block devices yubikey-manager # Yubikey - yt-dlp # Downloading media v4l-utils # Webcam ]; } diff --git a/modules/home/base16.nix b/modules/home/base16.nix index 3e4a6b88..1fbd0073 100644 --- a/modules/home/base16.nix +++ b/modules/home/base16.nix @@ -23,7 +23,7 @@ in { // { term_font = "Iosevka"; font = "Iosevka"; - font_size = "12px"; + font_size = "14px"; }; }; css_style = mkOption { @@ -34,11 +34,11 @@ in { }; config = mkIf (cfg.schemes != {}) { base16 = { - palette = set.fromList (k: v: - tuple.toPair (tuple.tuple2 ( + palette = set.fromList (set.mapToValues (k: v: + tuple.tuple2 k "#${v.hex}" - )) + ) (set.filter (n: _: string.hasPrefix "base" n) cfg.defaultScheme)); }; diff --git a/nixos/environments/hyprland/hyprland.nix b/nixos/environments/hyprland/hyprland.nix new file mode 100644 index 00000000..80e5d93c --- /dev/null +++ b/nixos/environments/hyprland/hyprland.nix @@ -0,0 +1,6 @@ +{ pkgs, inputs, ... }: { + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + }; +} diff --git a/nixos/environments/hyprland/profile-inheritance.nix b/nixos/environments/hyprland/profile-inheritance.nix new file mode 100644 index 00000000..140771c4 --- /dev/null +++ b/nixos/environments/hyprland/profile-inheritance.nix @@ -0,0 +1,9 @@ +{tree, ...}: { + imports = with tree.nixos.profiles; [ + graphical + ]; + + home-manager.users.kat.imports = with tree.home.environments; [ + hyprland + ]; +} diff --git a/nixos/environments/hyprland/xdg-portals.nix b/nixos/environments/hyprland/xdg-portals.nix new file mode 100644 index 00000000..c973a580 --- /dev/null +++ b/nixos/environments/hyprland/xdg-portals.nix @@ -0,0 +1,10 @@ +{pkgs, inputs, ...}: { + xdg = { + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + ]; + }; + }; +} diff --git a/nixos/profiles/graphical/packages.nix b/nixos/profiles/graphical/packages.nix index 19735192..5d5dd9c5 100644 --- a/nixos/profiles/graphical/packages.nix +++ b/nixos/profiles/graphical/packages.nix @@ -13,5 +13,6 @@ ]; services.udev.packages = [ pkgs.android-udev-rules + pkgs.via ]; } diff --git a/nixos/profiles/laptop/cpufreq.nix b/nixos/profiles/laptop/cpufreq.nix new file mode 100644 index 00000000..56f70d1b --- /dev/null +++ b/nixos/profiles/laptop/cpufreq.nix @@ -0,0 +1,3 @@ +_: { + powerManagement.cpuFreqGovernor = "performance"; +} diff --git a/nixos/profiles/laptop/power-profiles-daemon.nix b/nixos/profiles/laptop/power-profiles-daemon.nix index bce55e3d..8f192ea0 100644 --- a/nixos/profiles/laptop/power-profiles-daemon.nix +++ b/nixos/profiles/laptop/power-profiles-daemon.nix @@ -1,3 +1,12 @@ _: { - services.power-profiles-daemon.enable = true; + services.power-profiles-daemon.enable = false; + services.tlp = { + enable = true; + settings = { + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 0; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + }; + }; } diff --git a/systems/koishi.nix b/systems/koishi.nix index d2be41fa..bb87c16b 100644 --- a/systems/koishi.nix +++ b/systems/koishi.nix @@ -12,7 +12,8 @@ _: let laptop ]) ++ (with tree.nixos.environments; [ - kde + #kde + hyprland ]); home-manager.users.kat.imports = @@ -21,12 +22,16 @@ _: let devops ]) ++ (with tree.home.environments; [ - kde + #kde + hyprland ]); environment.systemPackages = with pkgs; [ parsec-bin ]; + + programs.adb.enable = true; + users.users.kat.extraGroups = ["adbusers"]; fileSystems = { "/" = {