mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 17:58:30 +02:00
feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }'
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
nur-ryan4yin,
|
||||
blender-bin,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs;
|
||||
}:
|
||||
{
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
# creative
|
||||
# gimp # image editing, I prefer using figma in browser instead of this one
|
||||
@@ -41,7 +43,8 @@
|
||||
# live streaming
|
||||
obs-studio = {
|
||||
enable = pkgs.stdenv.isx86_64;
|
||||
plugins = with pkgs.obs-studio-plugins;
|
||||
plugins =
|
||||
with pkgs.obs-studio-plugins;
|
||||
[
|
||||
# screen capture
|
||||
wlrobs
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{mylib, ...}: {
|
||||
{ mylib, ... }:
|
||||
{
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
android-tools
|
||||
];
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# Adjust the color temperature(& brightness) of your screen according to
|
||||
# your surroundings. This may help your eyes hurt less if you are
|
||||
# working in front of the screen at night.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
xdg.configFile = {
|
||||
"fcitx5/profile" = {
|
||||
source = ./profile;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
nix-gaming,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# nix-gaming.packages.${pkgs.system}.osu-laser-bin
|
||||
gamescope # SteamOS session compositing window manager
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# If your themes for mouse cursor, icons or windows don’t load correctly,
|
||||
# try setting them with home.pointerCursor and gtk.theme,
|
||||
# which enable a bunch of compatibility options that should make the themes load in all situations.
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
# TODO not used yet, need to test it.
|
||||
#
|
||||
##############################################################################################
|
||||
with lib; let
|
||||
with lib;
|
||||
let
|
||||
cfg = config.home.immutable-file;
|
||||
immutableFileOpts = _: {
|
||||
options = {
|
||||
@@ -42,24 +43,25 @@ with lib; let
|
||||
sudo cp $2 $1
|
||||
sudo chattr +i $1
|
||||
'';
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.home.immutable-file = mkOption {
|
||||
type = with types; attrsOf (submodule immutableFileOpts);
|
||||
default = {};
|
||||
default = { };
|
||||
};
|
||||
|
||||
config = mkIf (cfg != {}) {
|
||||
home.activation =
|
||||
mapAttrs'
|
||||
(name: {
|
||||
config = mkIf (cfg != { }) {
|
||||
home.activation = mapAttrs' (
|
||||
name:
|
||||
{
|
||||
src,
|
||||
dst,
|
||||
}:
|
||||
nameValuePair
|
||||
"make-immutable-${name}"
|
||||
(lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
nameValuePair "make-immutable-${name}" (
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
${mkImmutableFile} ${dst} ${src}
|
||||
''))
|
||||
cfg;
|
||||
''
|
||||
)
|
||||
) cfg;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
}:
|
||||
# media - control and enjoy audio/video
|
||||
{
|
||||
home.packages = with pkgs;
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
# audio control
|
||||
pavucontrol
|
||||
@@ -22,13 +23,13 @@
|
||||
nvitop
|
||||
]
|
||||
++ (lib.optionals pkgs.stdenv.isx86_64 [
|
||||
(zoom-us.override {hyprlandXdgDesktopPortalSupport = true;})
|
||||
(zoom-us.override { hyprlandXdgDesktopPortalSupport = true; })
|
||||
]);
|
||||
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
defaultProfiles = ["gpu-hq"];
|
||||
scripts = [pkgs.mpvScripts.mpris];
|
||||
defaultProfiles = [ "gpu-hq" ];
|
||||
scripts = [ pkgs.mpvScripts.mpris ];
|
||||
};
|
||||
|
||||
services = {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# GUI apps
|
||||
# e-book viewer(.epub/.mobi/...)
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; (lib.optionals pkgs.stdenv.isx86_64 [
|
||||
# https://joplinapp.org/help/
|
||||
joplin # joplin-cli
|
||||
joplin-desktop
|
||||
]);
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages =
|
||||
with pkgs;
|
||||
(lib.optionals pkgs.stdenv.isx86_64 [
|
||||
# https://joplinapp.org/help/
|
||||
joplin # joplin-cli
|
||||
joplin-desktop
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -4,26 +4,37 @@
|
||||
lib,
|
||||
wallpapers,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
systemd.user.services.wallpaper = {
|
||||
Unit = {
|
||||
Description = "Wallpaper Switcher daemon";
|
||||
After = ["graphical-session-pre.target" "xdg-desktop-autostart.target"];
|
||||
Wants = ["graphical-session-pre.target"];
|
||||
After = [
|
||||
"graphical-session-pre.target"
|
||||
"xdg-desktop-autostart.target"
|
||||
];
|
||||
Wants = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
Install.WantedBy = ["graphical-session.target"];
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
Service = {
|
||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
||||
name = "wallpaper";
|
||||
runtimeInputs = with pkgs; [procps feh swaybg python3];
|
||||
text = ''
|
||||
export WALLPAPERS_DIR="${wallpapers}"
|
||||
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
||||
export WALLPAPER_WAIT_MIN=60
|
||||
export WALLPAPER_WAIT_MAX=180
|
||||
exec ${./wallpaper-switcher.py}
|
||||
'';
|
||||
});
|
||||
ExecStart = lib.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "wallpaper";
|
||||
runtimeInputs = with pkgs; [
|
||||
procps
|
||||
feh
|
||||
swaybg
|
||||
python3
|
||||
];
|
||||
text = ''
|
||||
export WALLPAPERS_DIR="${wallpapers}"
|
||||
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
||||
export WALLPAPER_WAIT_MIN=60
|
||||
export WALLPAPER_WAIT_MAX=180
|
||||
exec ${./wallpaper-switcher.py}
|
||||
'';
|
||||
}
|
||||
);
|
||||
RestartSec = 3;
|
||||
Restart = "on-failure";
|
||||
};
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
||||
xdg-user-dirs
|
||||
@@ -31,53 +32,63 @@
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
# let `xdg-open` to open the url with the correct application.
|
||||
defaultApplications = let
|
||||
browser = ["google-chrome.desktop" "firefox.desktop"];
|
||||
editor = ["nvim.desktop" "Helix.desktop" "code.desktop" "code-insiders.desktop"];
|
||||
in {
|
||||
"application/json" = browser;
|
||||
"application/pdf" = browser; # TODO: pdf viewer
|
||||
defaultApplications =
|
||||
let
|
||||
browser = [
|
||||
"google-chrome.desktop"
|
||||
"firefox.desktop"
|
||||
];
|
||||
editor = [
|
||||
"nvim.desktop"
|
||||
"Helix.desktop"
|
||||
"code.desktop"
|
||||
"code-insiders.desktop"
|
||||
];
|
||||
in
|
||||
{
|
||||
"application/json" = browser;
|
||||
"application/pdf" = browser; # TODO: pdf viewer
|
||||
|
||||
"text/html" = browser;
|
||||
"text/xml" = browser;
|
||||
"text/plain" = editor;
|
||||
"application/xml" = browser;
|
||||
"application/xhtml+xml" = browser;
|
||||
"application/xhtml_xml" = browser;
|
||||
"application/rdf+xml" = browser;
|
||||
"application/rss+xml" = browser;
|
||||
"application/x-extension-htm" = browser;
|
||||
"application/x-extension-html" = browser;
|
||||
"application/x-extension-shtml" = browser;
|
||||
"application/x-extension-xht" = browser;
|
||||
"application/x-extension-xhtml" = browser;
|
||||
"application/x-wine-extension-ini" = editor;
|
||||
"text/html" = browser;
|
||||
"text/xml" = browser;
|
||||
"text/plain" = editor;
|
||||
"application/xml" = browser;
|
||||
"application/xhtml+xml" = browser;
|
||||
"application/xhtml_xml" = browser;
|
||||
"application/rdf+xml" = browser;
|
||||
"application/rss+xml" = browser;
|
||||
"application/x-extension-htm" = browser;
|
||||
"application/x-extension-html" = browser;
|
||||
"application/x-extension-shtml" = browser;
|
||||
"application/x-extension-xht" = browser;
|
||||
"application/x-extension-xhtml" = browser;
|
||||
"application/x-wine-extension-ini" = editor;
|
||||
|
||||
# define default applications for some url schemes.
|
||||
"x-scheme-handler/about" = browser; # open `about:` url with `browser`
|
||||
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
|
||||
"x-scheme-handler/http" = browser;
|
||||
"x-scheme-handler/https" = browser;
|
||||
# https://github.com/microsoft/vscode/issues/146408
|
||||
"x-scheme-handler/vscode" = ["code-url-handler.desktop"]; # open `vscode://` url with `code-url-handler.desktop`
|
||||
"x-scheme-handler/vscode-insiders" = ["code-insiders-url-handler.desktop"]; # open `vscode-insiders://` url with `code-insiders-url-handler.desktop`
|
||||
"x-scheme-handler/zoommtg" = ["Zoom.desktop"];
|
||||
# define default applications for some url schemes.
|
||||
"x-scheme-handler/about" = browser; # open `about:` url with `browser`
|
||||
"x-scheme-handler/ftp" = browser; # open `ftp:` url with `browser`
|
||||
"x-scheme-handler/http" = browser;
|
||||
"x-scheme-handler/https" = browser;
|
||||
# https://github.com/microsoft/vscode/issues/146408
|
||||
"x-scheme-handler/vscode" = [ "code-url-handler.desktop" ]; # open `vscode://` url with `code-url-handler.desktop`
|
||||
"x-scheme-handler/vscode-insiders" = [ "code-insiders-url-handler.desktop" ]; # open `vscode-insiders://` url with `code-insiders-url-handler.desktop`
|
||||
"x-scheme-handler/zoommtg" = [ "Zoom.desktop" ];
|
||||
|
||||
# all other unknown schemes will be opened by this default application.
|
||||
# "x-scheme-handler/unknown" = editor;
|
||||
# all other unknown schemes will be opened by this default application.
|
||||
# "x-scheme-handler/unknown" = editor;
|
||||
|
||||
"x-scheme-handler/tg" = ["org.telegram.desktop.desktop "];
|
||||
"x-scheme-handler/tg" = [ "org.telegram.desktop.desktop " ];
|
||||
|
||||
"audio/*" = ["mpv.desktop"];
|
||||
"video/*" = ["mpv.desktop"];
|
||||
"image/*" = ["imv-dir.desktop"];
|
||||
"image/gif" = ["imv-dir.desktop"];
|
||||
"image/jpeg" = ["imv-dir.desktop"];
|
||||
"image/png" = ["imv-dir.desktop"];
|
||||
"image/webp" = ["imv-dir.desktop"];
|
||||
"audio/*" = [ "mpv.desktop" ];
|
||||
"video/*" = [ "mpv.desktop" ];
|
||||
"image/*" = [ "imv-dir.desktop" ];
|
||||
"image/gif" = [ "imv-dir.desktop" ];
|
||||
"image/jpeg" = [ "imv-dir.desktop" ];
|
||||
"image/png" = [ "imv-dir.desktop" ];
|
||||
"image/webp" = [ "imv-dir.desktop" ];
|
||||
|
||||
"inode/directory" = ["yazi.desktop"];
|
||||
};
|
||||
"inode/directory" = [ "yazi.desktop" ];
|
||||
};
|
||||
|
||||
associations.removed = {
|
||||
# ......
|
||||
|
||||
Reference in New Issue
Block a user