users.users.jxnshi.extraGroups = [ "networkmanager" "wheel" ];
# Environment variables.
- environment.variables.BROWSER = "qutebrowser";
- environment.variables.EDITOR = "hx";
- environment.variables.TERM = "st";
+ environment.variables.BROWSER = "qutebrowser";
+ environment.variables.EDITOR = "hx";
+ environment.variables.MUSIC_PLAYER = "st ncmpcpp";
+ environment.variables.TERM = "st";
# Allow unfree packages.
nixpkgs.config.allowUnfree = true;
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "jxnshi";
+ # Auto update.
+ system.autoUpgrade.enable = true;
+ system.autoUpgrade.dates = "weekly";
+
+ # Auto cleanup.
+ nix.gc.automatic = true;
+ nix.gc.dates = "daily";
+ nix.gc.options = "--delete-older-than 10d";
+ nix.settings.auto-optimise-store = true;
+
# Upower.
services.upower.enable = true;
+ # Fish.
+ programs.bash.interactiveShellInit = ''
+ if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] then
+ shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
+ exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
+ fi
+ '';
+
+ # MPD.
+ services.mpd.user = "jxnshi";
+
+ systemd.services.mpd.environment.XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.jxnshi.uid}";
+
# SSH.
programs.ssh.startAgent = true;
nix.settings.experimental-features = "nix-command flakes";
# System.
- system.autoUpgrade.enable = true;
system.stateVersion = "24.11";
-
- # Fish.
- programs.bash.interactiveShellInit = ''
- if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] then
- shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
- exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
- fi
- '';
}
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
- outputs = { self, nixpkgs, ... }@inputs:
- let
- system = "x86_64-linux";
- in
- {
+ outputs = { self, nixpkgs, ... }@inputs: {
nixosConfigurations.t420 = nixpkgs.lib.nixosSystem {
- specialArgs = { inherit inputs system; };
+ specialArgs = { inherit inputs "x86_64-linux"; };
modules = [ ./configuration.nix ];
};
};
helix # Text editor.
krita # Drawing software.
monero-gui # Monero wallet.
+ ncmpcpp # Music player.
qutebrowser # Web browser.
st # Terminal emulator.
git
home-manager
htop
+ mpd
pfetch-rs
picom
+ slstatus
timg
tree
upower
dwm = prev.dwm.overrideAttrs (old: {
src = pkgs.fetchgit {
url = "git://jxnshi.xyz/dwm-config.git";
- hash = "sha256-2oOAUaaB0g68E9+ITfJeOxzzf33yQn2TeOxmSakH/qQ=";
+ hash = "sha256-BJ77olfRDYvlq1GrJcDXPd7ZNiQlxZ/rxzGn3ftH42k=";
};
});
st = prev.st.overrideAttrs (old: {
programs.git.userEmail = "jxnshi@proton.me";
programs.git.userName = "jxnshi";
+ # MPD.
+ services.mpd.enable = true;
+
+ services.mpd.dbFile = "~/.config/mpd/datebase";
+
+ services.mpd.musicDirectory = ./music;
+ services.mpd.playlistDirectory = ./.config/mpd/playlists;
+
+ services.mpd.extraConfig = ''
+ log_file "~/.config/mpd/log"
+
+ auto_update "yes"
+ bind_to_address "127.0.0.1"
+ port "6600"
+ restore_paused "yes"
+ max_output_buffer_size "16384"
+
+ audio_output {
+ type "pipewire"
+ name "Pipewire Sound Server"
+ }
+
+ audio_output {
+ type "fifo"
+ name "Visualizer feed"
+ path "/tmp/mpd.fifo"
+ format "44100:16:2"
+ }
+ '';
+
+ # Ncmpcpp.
+ programs.ncmpcpp.enable = true;
+
+ ## Files.
+ programs.ncmpcpp.mpdMusicDir = ./music;
+
+ programs.ncmpcpp.settings.lyrics_directory = "~/.ncmpcpp/lyrics";
+ programs.ncmpcpp.settings.ncmpcpp_directory = "~/.ncmpcpp";
+ programs.ncmpcpp.settings.mpd_host = "localhost";
+ programs.ncmpcpp.settings.mpd_port = "6600";
+ programs.ncmpcpp.settings.mpd_connection_timeout = "5";
+ programs.ncmpcpp.settings.mpd_crossfade_time = "5";
+
+ ## Playlist.
+ programs.ncmpcpp.settings.playlist_disable_highlight_delay = "0";
+ programs.ncmpcpp.settings.playlist_display_mode = "columns";
+ programs.ncmpcpp.settings.playlist_show_remaining_time = "yes";
+ programs.ncmpcpp.settings.browser_display_mode = "columns";
+ programs.ncmpcpp.settings.allow_for_physical_item_deletion = "yes";
+
# Picom.
services.picom.enable = true;