mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-14 16:42:43 +02:00
feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }'
This commit is contained in:
@@ -4,10 +4,12 @@
|
||||
lib,
|
||||
anyrun,
|
||||
...
|
||||
} @ args:
|
||||
with lib; let
|
||||
}@args:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hyprland;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# anyrun.homeManagerModules.default # the module is already in hm now.
|
||||
./options
|
||||
@@ -16,32 +18,36 @@ in {
|
||||
options.modules.desktop.hyprland = {
|
||||
enable = mkEnableOption "hyprland compositor";
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types; let
|
||||
valueType =
|
||||
nullOr (oneOf [
|
||||
bool
|
||||
int
|
||||
float
|
||||
str
|
||||
path
|
||||
(attrsOf valueType)
|
||||
(listOf valueType)
|
||||
])
|
||||
// {
|
||||
description = "Hyprland configuration value";
|
||||
};
|
||||
in
|
||||
type =
|
||||
with lib.types;
|
||||
let
|
||||
valueType =
|
||||
nullOr (oneOf [
|
||||
bool
|
||||
int
|
||||
float
|
||||
str
|
||||
path
|
||||
(attrsOf valueType)
|
||||
(listOf valueType)
|
||||
])
|
||||
// {
|
||||
description = "Hyprland configuration value";
|
||||
};
|
||||
in
|
||||
valueType;
|
||||
default = {};
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge ([
|
||||
mkMerge (
|
||||
[
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = cfg.settings;
|
||||
}
|
||||
]
|
||||
++ (import ./values args))
|
||||
++ (import ./values args)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{mylib, ...}: {
|
||||
{ mylib, ... }:
|
||||
{
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hyprland;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.modules.desktop.hyprland = {
|
||||
nvidia = mkEnableOption "whether nvidia GPU is used";
|
||||
};
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
anyrun,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs.anyrun = {
|
||||
enable = true;
|
||||
config = {
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
{mylib, ...} @ args:
|
||||
map
|
||||
(path: import path args)
|
||||
(mylib.scanPaths ./.)
|
||||
{ mylib, ... }@args: map (path: import path args) (mylib.scanPaths ./.)
|
||||
|
||||
@@ -2,19 +2,23 @@
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
package = pkgs.hyprland;
|
||||
in {
|
||||
xdg.configFile = let
|
||||
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
|
||||
hyprPath = "${config.home.homeDirectory}/nix-config/home/linux/gui/hyprland/conf";
|
||||
in {
|
||||
"mako".source = mkSymlink "${hyprPath}/mako";
|
||||
"waybar".source = mkSymlink "${hyprPath}/waybar";
|
||||
"wlogout".source = mkSymlink "${hyprPath}/wlogout";
|
||||
"hypr/hypridle.conf".source = mkSymlink "${hyprPath}/hypridle.conf";
|
||||
"hypr/configs".source = mkSymlink "${hyprPath}/configs";
|
||||
};
|
||||
in
|
||||
{
|
||||
xdg.configFile =
|
||||
let
|
||||
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
|
||||
hyprPath = "${config.home.homeDirectory}/nix-config/home/linux/gui/hyprland/conf";
|
||||
in
|
||||
{
|
||||
"mako".source = mkSymlink "${hyprPath}/mako";
|
||||
"waybar".source = mkSymlink "${hyprPath}/waybar";
|
||||
"wlogout".source = mkSymlink "${hyprPath}/wlogout";
|
||||
"hypr/hypridle.conf".source = mkSymlink "${hyprPath}/hypridle.conf";
|
||||
"hypr/configs".source = mkSymlink "${hyprPath}/configs";
|
||||
};
|
||||
|
||||
# status bar
|
||||
programs.waybar = {
|
||||
@@ -46,15 +50,17 @@ in {
|
||||
inherit package;
|
||||
enable = true;
|
||||
settings = {
|
||||
source = let
|
||||
configPath = "${config.home.homeDirectory}/.config/hypr/configs";
|
||||
in [
|
||||
"${configPath}/exec.conf"
|
||||
"${configPath}/fcitx5.conf"
|
||||
"${configPath}/keybindings.conf"
|
||||
"${configPath}/settings.conf"
|
||||
"${configPath}/windowrules.conf"
|
||||
];
|
||||
source =
|
||||
let
|
||||
configPath = "${config.home.homeDirectory}/.config/hypr/configs";
|
||||
in
|
||||
[
|
||||
"${configPath}/exec.conf"
|
||||
"${configPath}/fcitx5.conf"
|
||||
"${configPath}/keybindings.conf"
|
||||
"${configPath}/settings.conf"
|
||||
"${configPath}/windowrules.conf"
|
||||
];
|
||||
env = [
|
||||
"NIXOS_OZONE_WL,1" # for any ozone-based browser & electron apps to run on wayland
|
||||
"MOZ_ENABLE_WAYLAND,1" # for firefox to run on wayland
|
||||
@@ -71,7 +77,7 @@ in {
|
||||
# gammastep/wallpaper-switcher need this to be enabled.
|
||||
systemd = {
|
||||
enable = true;
|
||||
variables = ["--all"];
|
||||
variables = [ "--all" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
|
||||
}:
|
||||
{
|
||||
|
||||
home.packages = with pkgs; [
|
||||
swaybg # the wallpaper
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# firefox-wayland
|
||||
nixpaks.firefox
|
||||
@@ -31,25 +32,23 @@
|
||||
|
||||
vscode = {
|
||||
enable = true;
|
||||
package =
|
||||
pkgs.vscode.override
|
||||
{
|
||||
isInsiders = false;
|
||||
# https://wiki.archlinux.org/title/Wayland#Electron
|
||||
commandLineArgs = [
|
||||
"--ozone-platform-hint=auto"
|
||||
"--ozone-platform=wayland"
|
||||
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
||||
# (only supported by chromium/chrome at this time, not electron)
|
||||
"--gtk-version=4"
|
||||
# make it use text-input-v1, which works for kwin 5.27 and weston
|
||||
"--enable-wayland-ime"
|
||||
package = pkgs.vscode.override {
|
||||
isInsiders = false;
|
||||
# https://wiki.archlinux.org/title/Wayland#Electron
|
||||
commandLineArgs = [
|
||||
"--ozone-platform-hint=auto"
|
||||
"--ozone-platform=wayland"
|
||||
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
|
||||
# (only supported by chromium/chrome at this time, not electron)
|
||||
"--gtk-version=4"
|
||||
# make it use text-input-v1, which works for kwin 5.27 and weston
|
||||
"--enable-wayland-ime"
|
||||
|
||||
# TODO: fix https://github.com/microsoft/vscode/issues/187436
|
||||
# still not works...
|
||||
"--password-store=gnome" # use gnome-keyring as password store
|
||||
];
|
||||
};
|
||||
# TODO: fix https://github.com/microsoft/vscode/issues/187436
|
||||
# still not works...
|
||||
"--password-store=gnome" # use gnome-keyring as password store
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user