-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reviewed-on: https://codeberg.org/leana8959/.files/pulls/1 Co-authored-by: Léana 江 <[email protected]> Co-committed-by: Léana 江 <[email protected]>
- Loading branch information
Showing
60 changed files
with
701 additions
and
757 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
nixosConfig ? null, | ||
lib, | ||
... | ||
}: | ||
|
||
{ | ||
nix.gc = lib.mkIf (!nixosConfig.nix.gc.automatic or false) { | ||
automatic = true; | ||
frequency = "weekly"; | ||
options = "--delete-older-than 15d"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,49 @@ | ||
{ pkgs, lib, ... }: | ||
|
||
{ | ||
pkgs, | ||
lib, | ||
config, | ||
... | ||
}: | ||
{ | ||
options.programs.cmus.enable = lib.mkEnableOption "cmus"; | ||
|
||
config = lib.mkIf config.programs.cmus.enable { | ||
home.packages = [ pkgs.cmus ]; | ||
xdg.configFile."cmus/rc".text = lib.mkMerge [ | ||
(builtins.readFile ./rc) | ||
|
||
(lib.mkIf pkgs.stdenv.isLinux ( | ||
let | ||
# dispatch to multiple callbacks | ||
callback = pkgs.writeShellApplication { | ||
name = "cmus-callback-script"; | ||
runtimeInputs = [ | ||
pkgs.cmusfm | ||
pkgs.libnotify | ||
]; | ||
text = '' | ||
argv=("$@") | ||
declare -A map | ||
while [ $# -gt 0 ]; do | ||
map["$1"]="$2" | ||
shift | ||
shift | ||
done | ||
notify-send "''${map[title]}" "''${map[artist]} / ''${map[album]}" | ||
cmusfm "''${argv[@]}" | ||
''; | ||
}; | ||
in | ||
'' | ||
set status_display_program=${lib.getExe callback} | ||
'' | ||
)) | ||
|
||
(lib.mkIf pkgs.stdenv.isDarwin '' | ||
set status_display_program=${lib.getExe pkgs.cmusfm} | ||
'') | ||
|
||
(lib.mkIf pkgs.stdenv.isLinux '' | ||
set output_plugin=alsa | ||
'') | ||
|
||
# When switching over bluetooth, toggle the output device to coreaudio | ||
# and back to ao would fix the no sound issue. | ||
(lib.mkIf pkgs.stdenv.isDarwin '' | ||
# distortion fix https://github.com/cmus/cmus/issues/1130#issuecomment-1003324193 | ||
set output_plugin=ao | ||
'') | ||
]; | ||
}; | ||
|
||
programs.cmus.extraConfig = | ||
let | ||
# dispatch to multiple callbacks | ||
callback-script = pkgs.writeShellApplication { | ||
name = "cmus-callback-script"; | ||
runtimeInputs = [ | ||
pkgs.cmusfm | ||
pkgs.libnotify | ||
]; | ||
text = '' | ||
argv=("$@") | ||
declare -A map | ||
while [ $# -gt 0 ]; do | ||
map["$1"]="$2" | ||
shift | ||
shift | ||
done | ||
notify-send "''${map[title]}" "''${map[artist]} / ''${map[album]}" | ||
cmusfm "''${argv[@]}" | ||
''; | ||
}; | ||
in | ||
(builtins.readFile ./rc) | ||
|
||
+ (lib.optionalString pkgs.stdenv.isLinux '' | ||
set status_display_program=${lib.getExe callback-script} | ||
'') | ||
|
||
+ (lib.optionalString pkgs.stdenv.isDarwin '' | ||
set status_display_program=${lib.getExe pkgs.cmusfm} | ||
'') | ||
|
||
+ (lib.optionalString pkgs.stdenv.isLinux '' | ||
set output_plugin=alsa | ||
'') | ||
|
||
# When switching over bluetooth, toggle the output device to coreaudio | ||
# and back to ao would fix the no sound issue. | ||
+ (lib.optionalString pkgs.stdenv.isDarwin '' | ||
# distortion fix https://github.com/cmus/cmus/issues/1130#issuecomment-1003324193 | ||
set output_plugin=ao | ||
''); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ config, ... }: | ||
|
||
{ | ||
|
||
programs.direnv = { | ||
nix-direnv.enable = true; | ||
config = builtins.fromTOML '' | ||
[whitelist] | ||
prefix = [ "${config.home.homeDirectory}/.dotfiles" ] | ||
[global] | ||
strict_env = true | ||
''; | ||
config = { | ||
whitelist.prefix = [ "${config.home.homeDirectory}/.dotfiles" ]; | ||
global.strict_env = true; | ||
}; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
pkgs, | ||
config, | ||
lib, | ||
... | ||
}: | ||
|
||
{ | ||
|
||
i18n.inputMethod = { | ||
fcitx5.addons = [ | ||
pkgs.fcitx5-chinese-addons | ||
pkgs.fcitx5-table-extra | ||
]; | ||
}; | ||
|
||
xdg.configFile = lib.mkIf (config.i18n.inputMethod.enabled != null) { | ||
"fcitx5".source = ./fcitx; | ||
}; | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
|
||
programs.feh = { | ||
enable = true; | ||
keybindings = { | ||
prev_img = [ | ||
"Left" | ||
|
Oops, something went wrong.