Compare commits

...

7 Commits

Author SHA1 Message Date
Jill 2f4ec6cf3f lock keybind 2024-03-21 11:54:28 +03:00
Jill 8f998751c9 sddm ! 2024-03-21 11:25:37 +03:00
Jill f3bf6aafe0 further package consistency 2024-03-21 11:25:28 +03:00
Jill 5f201dcaea add back launch keybind 2024-03-21 11:25:17 +03:00
Jill d5d74d9c3b switch all font packages to unstable 2024-03-17 15:12:54 +03:00
Jill 17acdd6171 steam gamescope experimentation (unsuccessful. bummer!!) 2024-03-17 13:26:49 +03:00
Jill 9a5f7fbec3 consistency w/ hypr* packages 2024-03-17 13:26:33 +03:00
14 changed files with 361 additions and 23 deletions

View File

@ -422,6 +422,24 @@
"type": "github"
}
},
"hyprlang_5": {
"inputs": {
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1704230242,
"narHash": "sha256-S8DM+frECqmAdaUb3y5n3RjY73ajZcL5rnmx5YO+CkY=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "db5e1399b90d5a339330bdd49c5bca6fe58d6f60",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlock": {
"inputs": {
"hyprlang": "hyprlang_4",
@ -442,6 +460,25 @@
"type": "github"
}
},
"hyprpaper": {
"inputs": {
"hyprlang": "hyprlang_5",
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1710275050,
"narHash": "sha256-MMwlYYdPSkLEnvltef9liIBpoqUtilxuGiJE231prag=",
"owner": "hyprwm",
"repo": "hyprpaper",
"rev": "f57d991e3a73bcc447dc4b87e1689132295c7076",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprpaper",
"type": "github"
}
},
"nix-colors": {
"inputs": {
"base16-schemes": "base16-schemes",
@ -590,6 +627,38 @@
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1702645756,
"narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1703637592,
"narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1710162809,
"narHash": "sha256-i2R2bcnQp+85de67yjgZVvJhd6rRnJbSYNpGmB6Leb8=",
@ -614,8 +683,9 @@
"hyprland": "hyprland",
"hyprland-catppuccin": "hyprland-catppuccin",
"hyprlock": "hyprlock",
"hyprpaper": "hyprpaper",
"nix-colors": "nix-colors",
"nixpkgs": "nixpkgs_6",
"nixpkgs": "nixpkgs_8",
"nixpkgs-unstable": "nixpkgs-unstable",
"waybar-catppuccin": "waybar-catppuccin"
}

View File

@ -18,6 +18,7 @@
hyprland.url = "github:hyprwm/Hyprland";
hyprlock.url = "github:hyprwm/hyprlock";
hypridle.url = "github:hyprwm/hypridle";
hyprpaper.url = "github:hyprwm/hyprpaper";
waybar-catppuccin.url = "github:catppuccin/waybar";
waybar-catppuccin.flake = false;

View File

@ -90,6 +90,8 @@
rofi.enable = true;
nwg-drawer.enable = true;
sddm.enable = true;
themes.active = "catppuccin";
};
software = {

View File

@ -41,17 +41,17 @@ in {
size = 11;
};
monospace = mkFontOption "monospace" {
package = pkgs.cozette;
package = pkgs.unstable.cozette;
family = "CozetteVector";
size = 10;
};
monospaceBitmap = mkFontOption "bitmap monospace" {
package = pkgs.cozette;
package = pkgs.unstable.cozette;
family = "Cozette";
size = 10;
};
emoji = mkFontOption "emoji" {
package = pkgs.twitter-color-emoji;
package = pkgs.unstable.twitter-color-emoji;
family = "Twitter Color Emoji";
size = 10; # not applicable, but whatever
};
@ -69,7 +69,7 @@ in {
emoji = [ cfg.fonts.emoji.family ];
};
enableGhostscriptFonts = true;
packages = with pkgs; [
packages = with pkgs.unstable; [
corefonts
noto-fonts
noto-fonts-cjk-sans
@ -95,7 +95,7 @@ in {
};
} // (mkIf cfg.baseFonts {
fonts.enableDefaultPackages = true;
fonts.packages = with pkgs; [
fonts.packages = with pkgs.unstable; [
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease

View File

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, system, inputs, ... }:
with lib;
let
@ -6,16 +6,24 @@ let
in {
options.modules.desktop.hypridle = {
enable = mkEnableOption "Enable hypridle, Hyprland's idle daemon";
package = mkOption {
type = types.package;
default = inputs.hypridle.packages.${system}.hypridle;
example = "pkgs.hypridle";
};
};
config = mkIf cfg.enable {
hm.services.hypridle = {
enable = true;
package = cfg.package;
lockCmd = "${lib.getExe config.hm.programs.hyprlock.package}";
lockCmd = "${lib.getExe config.modules.desktop.hyprlock.package}";
unlockCmd = "pkill -USR1 hyprlock";
listeners = [
listeners = let
hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl";
in [
{
timeout = 60 * 1; # 1 min
onTimeout = "${lib.getExe pkgs.brightnessctl} -s set 20";
@ -23,8 +31,8 @@ in {
}
{
timeout = 90; # 1.5 min
onTimeout = "hyprctl dispatch dpms off"; # turn off screen
onResume = "hyprctl dispatch dpms on"; # turn it back on
onTimeout = "${hyprctl} dispatch dpms off"; # turn off screen
onResume = "${hyprctl} dispatch dpms on"; # turn it back on
}
{
timeout = 60 * 2; # 2 min

View File

@ -3,19 +3,28 @@
with lib;
let
cfg = config.modules.desktop.hyprland;
hyprpkgs = inputs.hyprland.packages.${system};
in {
options.modules.desktop.hyprland = {
enable = mkEnableOption "Enable Hyprland, a dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks";
allowTearing = mkEnableOption "Enable tearing, reduces latency in games but unsupported on some GPUs";
package = mkOption {
type = types.package;
default = hyprpkgs.hyprland;
example = "pkgs.hyprland";
};
portalPackage = mkOption {
type = types.package;
default = hyprpkgs.xdg-desktop-portal-hyprland;
example = "pkgs.xdg-desktop-portal-hyprland";
};
};
config = let
hyprpkgs = inputs.hyprland.packages.${system};
in mkIf cfg.enable {
services.xserver.displayManager.sessionPackages = [ hyprpkgs.hyprland ];
config = mkIf cfg.enable {
services.xserver.displayManager.sessionPackages = [ cfg.package ];
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk hyprpkgs.xdg-desktop-portal-hyprland ];
extraPortals = [ pkgs.xdg-desktop-portal-gtk cfg.portalPackage ];
config = {
common = {
default = [ "hyprland" "gtk" ];
@ -30,7 +39,7 @@ in {
hm.wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
package = hyprpkgs.hyprland;
package = cfg.package;
settings = {
source = [];
@ -55,7 +64,11 @@ in {
"SUPER, Super_L, exec, ${lib.getExe pkgs.nwg-drawer}"
];
bind =
[
let
grabScript = pkgs.writeScript "grab-password" ''
${lib.getExe pkgs.rbw} get $(${lib.getExe pkgs.gnome.zenity} --entry --text="" --title="") | ${lib.getExe pkgs.xclip} -selection clipboard
'';
in [
"$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run"
", Print, exec, ${lib.getExe pkgs.grimblast} copy area"
"$mod, T, exec, ${lib.getExe pkgs.wezterm}"
@ -79,6 +92,9 @@ in {
# Scroll through existing workspaces with mod + scroll
"$mod, mouse_down, workspace, e+1"
"$mod, mouse_up, workspace, e-1"
", XF86Launch1, exec, ${grabScript}"
", XF86ScreenSaver, exec, ${lib.getExe config.modules.desktop.hyprlock.package}"
]
++ (
# workspaces

View File

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, inputs, system, ... }:
with lib;
let
@ -6,12 +6,21 @@ let
in {
options.modules.desktop.hyprlock = {
enable = mkEnableOption "Enable hyprlock, a simple, yet fast, multi-threaded and GPU-accelerated screen lock for hyprland";
package = mkOption {
type = types.package;
default = inputs.hyprlock.packages.${system}.hyprlock;
example = "pkgs.hyprlock";
};
};
config = mkIf cfg.enable {
security.pam.services.hyprlock.text = "auth include login";
powerManagement.resumeCommands = ''
${cfg.package}
'';
hm.programs.hyprlock = with config.colorScheme.colors; {
enable = true;
package = cfg.package;
general = {
hide_cursor = false;
no_fade_in = true;

View File

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, inputs, system, ... }:
with lib;
let
@ -6,10 +6,15 @@ let
in {
options.modules.desktop.hyprpaper = {
enable = mkEnableOption "Enable Hyprpaper, a blazing fast wayland wallpaper utility";
package = mkOption {
type = types.package;
default = inputs.hyprpaper.packages.${system}.hyprpaper;
example = "pkgs.hyprpaper";
};
};
config = mkIf cfg.enable {
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe pkgs.hyprpaper}" ];
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe cfg.package}" ];
hm.xdg.configFile."hypr/hyprpaper.conf" = let
img = ../../assets/wallpaper.png;
in {

30
modules/desktop/sddm.nix Normal file
View File

@ -0,0 +1,30 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.sddm;
in {
options.modules.desktop.sddm = {
enable = mkEnableOption "Enable SDDM, a display manager for X11 and Wayland windowing systems";
};
config = mkIf cfg.enable {
services.xserver.enable = true; # oouhhuuhuuhuuuruuhuhuhu
environment.systemPackages = with pkgs; [
config.modules.desktop.themes.sddmTheme.package
libsForQt5.qt5.qtsvg
libsForQt5.qt5.qtgraphicaleffects
libsForQt5.qt5.qtquickcontrols2
];
services.xserver.displayManager.sddm = {
enable = true;
wayland.enable = true;
theme = config.modules.desktop.themes.sddmTheme.name;
settings = {
Theme = {
CursorTheme = config.modules.desktop.themes.cursor.name;
};
};
};
};
}

View File

@ -32,6 +32,16 @@ in {
name = "graphite-dark";
};
sddmTheme = {
name = "catppuccin-sddm-corners";
package = (pkgs.my.catppuccin-sddm-corners.override {
config.General = {
Background = ../../../../assets/lockscreen.png;
Font = config.modules.desktop.fonts.fonts.sansSerif.family;
};
});
};
editor = {
vscode = {
name = "Catppuccin Mocha";

View File

@ -26,6 +26,10 @@ in {
name = mkOpt str "";
package = mkPackageOption pkgs "cursor" {};
};
sddmTheme = {
name = mkOpt str "";
package = mkPackageOption pkgs "catppuccin-sddm-corners" {};
};
editor = {
vscode = {

View File

@ -70,13 +70,13 @@ in {
format = "";
tooltip = true;
tooltip-format = "Exit Hyprland";
on-click = "hyprctl dispatch exit";
on-click = "${config.modules.desktop.hyprland.package}/bin/hyprctl dispatch exit";
};
"custom/lock" = {
format = "";
tooltip = true;
tooltip-format = "Lock the system";
on-click = "hyprlock";
on-click = "${lib.getExe config.modules.desktop.hyprlock.package}";
};
"custom/reboot" = {
format = "";

View File

@ -16,6 +16,14 @@ in {
enableRenice = true;
settings = {};
};
programs.gamescope = {
enable = true;
capSysNice = true;
};
programs.steam.gamescopeSession = {
enable = true;
args = [ "-W 1600" "-H 900" "-r 60" "--expose-wayland" "-e" ];
};
user.packages = [ pkgs.protontricks pkgs.steam-run ];
};
}

View File

@ -0,0 +1,175 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
, writeText
, config ? {}
}:
let
defaultConfig = {
General = {
### GENERAL
# path to the wallpaper. you can drop files in backgrounds/ to use a relative path, or you can just use an absolute path.
Background="backgrounds/flatppuccin_macchiato.png";
# the font to use throughout the theme. use the name of the font family.
Font="Liga SFMono Nerd Font";
# the distance that stuff should be from the screen edge.
Padding="50";
# specify how round corners should be, or set to 0 to disable rounded corners.
CornerRadius="5";
# the font size used for everything excluding the date and time.
GeneralFontSize="9";
# this allows you to adjust the relative scale of UI elements. you should probably keep the value below 1.
LoginScale="0.175";
### USER PICTURE
# the width of the outline around the user avatar. set to 0 to disable.
UserPictureBorderWidth="5";
# the color of the outline around the user avatar.
UserPictureBorderColor="#c0caf5";
# the color of the default, blank avatar. note that this isonly visible when you don't have a custom picture set.
UserPictureColor="#414868";
### TEXT FIELD (USER AND PASSWORD)
# the color of the text field background for the user and password fields.
TextFieldColor="#414868";
# the color of the text inside the user and password fields.
TextFieldTextColor="#c0caf5";
# the color of the border around the currently selected text field.
TextFieldHighlightColor="#c0caf5";
# the border width of the currently selected text field. set to 0 to disable the border.
TextFieldHighlightWidth="3";
# the placeholder text shown in the user field when nothing is typed.
UserFieldBgText="User";
# the placeholder text shown in the password field when nothing is typed.
PasswordFieldBgText="Password";
### LOGIN BUTTON
# the color of the login button text.
LoginButtonTextColor="#414868";
# the color of the login button background.
LoginButtonBgColor="#c0caf5";
# the text to be displayed on the login button.
LoginButtonText="Login";
### POPUP (POWER, SESSION, AND USER)
# the background color of the popup. this applies to the power panel, session panel, and user panel.
PopupBgColor="#c0caf5";
# the color of the currently selected entry in the popup. this applies to the power panel, session panel, and user panel.
PopupHighlightColor="#414868";
# the color of the text for the currently selectedoption. only applies to session and user popups.
PopupHighlightedTextColor="#c0caf5";
### SESSION BUTTON
# the color of the session button background.
SessionButtonColor="#c0caf5";
# the color of the icon inside the session button.
SessionIconColor="#414868";
### POWER BUTTON
# the color of the power button background.
PowerButtonColor="#c0caf5";
# the color of the power button background.
PowerIconColor="#414868";
### DATE
# the text color of the date.
DateColor="#c0caf5";
# the font size of the date.
DateSize="36";
# whether the date is bolded. accepts either `true` or `false`.
DateIsBold="false";
# whether the date is bolded. accepts either `true` or `false`.
DateOpacity="0.8";
# specify the formatting of the date.
DateFormat="dddd, MMMM d";
### TIME
# the text color of the time.
TimeColor="#c0caf5";
# the font size of the time.
TimeSize="48";
# whether the time is bolded. accepts either `true` or `false`.
TimeIsBold="true";
# the opacity of the time text. set to 1 to disable transparency.
TimeOpacity="0.8";
# specify the formatting of the time.
TimeFormat="hh:mm AP";
};
};
mergedConfig = lib.attrsets.recursiveUpdate defaultConfig config;
in stdenvNoCC.mkDerivation {
pname = "catppuccin-sddm-corners";
version = "unstable-2023-02-17";
src = fetchFromGitHub {
owner = "khaneliman";
repo = "catppuccin-sddm-corners";
rev = "7b7a86ee9a5a2905e7e6623d2af5922ce890ef79";
hash = "sha256-sTnt8RarNXz3RmYfmx4rD+nMlY8rr2n0EN3ntPzOurw=";
};
dontConfigure = true;
dontBuild = true;
installPhase = let
configFile = writeText "catppuccin-sddm-corners-theme-conf" (lib.generators.toINI {
# specifies how to format a key/value pair
mkKeyValue = lib.generators.mkKeyValueDefault {
mkValueString = v: ''"${builtins.toString v}"'';
} " = ";
} mergedConfig);
in ''
runHook preInstall
cp ${configFile} catppuccin/theme.conf
mkdir -p "$out/share/sddm/themes/"
cp -r catppuccin/ "$out/share/sddm/themes/catppuccin-sddm-corners"
runHook postInstall
'';
meta = {
description = "Soothing pastel theme for SDDM based on corners theme.";
homepage = "https://github.com/khaneliman/sddm-catppuccin-corners";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ khaneliman ];
platforms = lib.platforms.linux;
};
}