Skip to content

Commit

Permalink
nix: update to 24.11
Browse files Browse the repository at this point in the history
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
leana8959 authored and Léana committed Nov 30, 2024
1 parent 57ed96f commit f6a89cb
Show file tree
Hide file tree
Showing 60 changed files with 701 additions and 757 deletions.
39 changes: 0 additions & 39 deletions .config/xmobar/xmobarrc

This file was deleted.

14 changes: 8 additions & 6 deletions .config/xmonad/xmonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ myUnmaps =

myKeymaps =
[ -- Display
((0, xF86XK_MonBrightnessDown ), spawn "light -U 5" )
, ((0, xF86XK_MonBrightnessUp ), spawn "light -A 5" )
((0, xF86XK_MonBrightnessDown), spawn "light -U 5" )
, ((0, xF86XK_MonBrightnessUp ), spawn "light -A 5" )
, ((controlMask, xF86XK_MonBrightnessDown), spawn "xbrightness DP-2-2 -0.1")
, ((controlMask, xF86XK_MonBrightnessUp ), spawn "xbrightness DP-2-2 +0.1")

Expand All @@ -160,8 +160,8 @@ myKeymaps =
, ((superMask .|. shiftMask, xK_period), sendMessage Expand)

-- Increment / decrement the number of windows in the master area
, ((superMask ,xK_comma ), sendMessage (IncMasterN -1))
, ((superMask ,xK_period), sendMessage (IncMasterN 1))
, ((superMask, xK_comma ), sendMessage (IncMasterN -1))
, ((superMask, xK_period), sendMessage (IncMasterN 1))

-- sink
, ((superMask .|. shiftMask, xK_s), withFocused $ windows . W.sink)
Expand All @@ -185,10 +185,12 @@ myKeymaps =
, ((controlMask .|. altMask, xK_p), namedScratchpadAction myScratchpads "pass" )
, ((controlMask .|. altMask, xK_r), namedScratchpadAction myScratchpads "ranger")
, ((superMask, xK_o), spawn launchDmenu )
, ((superMask, xK_l), spawn lock )
]
where
launchFirefox = "if type firefox; then firefox; else firefox-esr; fi"
launchDmenu = "dmenu_run -i -fn \"Iosevka Extended-17\" -nb \"#36363a\" -nf \"#e2e2e4\" -sb \"#f7f7f8\" -sf \"#36363a\" -l 10"
lock = "xscreensaver-command -lock"

yeetingBindings =
gotoWorkspace
Expand Down Expand Up @@ -246,8 +248,8 @@ myStartupHook = do
spawn "feh --no-fehbg --bg-fill ~/.wallpaper &" -- wallpaper

xmobarOf :: ScreenId -> IO StatusBarConfig
xmobarOf 0 = pure $ statusBarProp "xmobar -x 0 ~/.config/xmobar/xmobarrc" (pure myPrettyPrinter)
xmobarOf 1 = pure $ statusBarProp "xmobar -x 1 ~/.config/xmobar/xmobarrc" (pure myPrettyPrinter)
xmobarOf 0 = pure $ statusBarProp "xmobar -x 0" (pure myPrettyPrinter)
xmobarOf 1 = pure $ statusBarProp "xmobar -x 1" (pure myPrettyPrinter)
xmobarOf _ = mempty

-- Note: `xmonad --restart` will make Firefox's fullscreen work duck the xmobar stop working
Expand Down
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
};

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";

nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";

home-manager = {
url = "github:nix-community/home-manager/release-24.05";
url = "github:nix-community/home-manager/release-24.11";
inputs."nixpkgs".follows = "nixpkgs";
};

Expand Down
25 changes: 8 additions & 17 deletions nix/configurations/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,16 @@ in
inputs.disko.nixosModules.default
self.diskoConfigurations.carbon
self.nixosModules.tmp-tmpfs
self.nixosModules.zram
{
home-manager.users.leana = {
imports = [
self.homeModules.fcitx5
self.homeModules.sioyek
self.homeModules.feh

self.homeModules.preset-utilities
self.homeModules.preset-scripting
self.homeModules.preset-fancy
self.homeModules.preset-nix
self.homeModules.preset-workflow
home-manager.users.leana.imports = [
self.homeModules.preset-utilities
self.homeModules.preset-scripting
self.homeModules.preset-fancy
self.homeModules.preset-nix
self.homeModules.preset-workflow

self.homeModules.neovim-moreLangServers
];
programs.git.signing.signByDefault = true;
programs.cmus.enable = true;
};
self.homeModules.neovim-moreLangServers
];
}
];
};
Expand Down
13 changes: 13 additions & 0 deletions nix/homeModules/common/auto-gc.nix
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";
};
}
104 changes: 47 additions & 57 deletions nix/homeModules/common/cmus/default.nix
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
'');

}
12 changes: 6 additions & 6 deletions nix/homeModules/common/direnv.nix
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;
};
};

}
21 changes: 21 additions & 0 deletions nix/homeModules/common/fcitx5/default.nix
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.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{

programs.feh = {
enable = true;
keybindings = {
prev_img = [
"Left"
Expand Down
Loading

0 comments on commit f6a89cb

Please sign in to comment.