Hi All
I am new to NixOS after many years of Arch and I need a little bit of help.
Two things I want to do but am struggling to understand and to actually happen.
1) I use dwm, I want feh to set the wallpaper. I have Solved here.~/.fehbg &
set in my .Xinitrc with no effect, I have tried using .Xprofile and the dwmautostart feature with no luck. How do I get feh to set a wallpaper on login?
2) I have an extremely long playlist in mpd that I want to use but mpd/ncmpcpp use such a long playlist. Sorted, here.
I have in my mpd.conf the following, max_playlist_length "400000"
but again, NixOs isn’t using the config file. How do I add this to my configuration.nix?
Here is my configuration.nix, no doubt it is a complete mess as I am sort of learning as I go.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Pacific/Auckland";
# Select internationalisation properties.
i18n.defaultLocale = "en_NZ.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_NZ.UTF-8";
LC_IDENTIFICATION = "en_NZ.UTF-8";
LC_MEASUREMENT = "en_NZ.UTF-8";
LC_MONETARY = "en_NZ.UTF-8";
LC_NAME = "en_NZ.UTF-8";
LC_NUMERIC = "en_NZ.UTF-8";
LC_PAPER = "en_NZ.UTF-8";
LC_TELEPHONE = "en_NZ.UTF-8";
LC_TIME = "en_NZ.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.windowManager.dwm.enable = true;
services.picom.enable = true;
# Enable the KDE Plasma Desktop Environment.
#services.xserver.displayManager.sddm.enable = true;
#services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "nz";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
fileSystems."/run/media/dobbie/Music" =
{ device = "/dev/disk/by-label/MUSIC";
fsType = "auto";
options = [ "nofail" ];
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
services.udisks2.enable = true;
programs.gnome-disks.enable = true;
programs.xfconf.enable = true;
programs.thunar.plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
services.gvfs.enable = true; # Mount, trash, and other functionalities
services.tumbler.enable = true; # Thumbnail support for images
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.dobbie = {
isNormalUser = true;
description = "Matthew Dobson";
extraGroups = [ "networkmanager" "wheel" "audio" "video" "storage" "media" ];
packages = with pkgs; [
firefox
dwm
dmenu
dunst
slstatus
slock
st
stdenv
cmake
ncmpcpp
alacritty
feh
freetype
ffmpeg
gd
gnumake
gvfs
gnome.gnome-disk-utility
geany
pavucontrol
picom
polkit_gnome
unzip
xclip
xorg.libX11
xorg.libX11.dev
xorg.libxcb
xorg.libXft
xorg.libXinerama
xorg.xinit
xorg.xinput
xfce.thunar
easytag
git
harfbuzz
eza
maim
mpd
mpc-cli
ncmpcpp
oh-my-zsh
fira-code-nerdfont
zsh
zsh-autosuggestions
zsh-syntax-highlighting
papirus-icon-theme
materia-kde-theme
wireplumber
neofetch
mpdscribble
ntfs3g
font-manager
# thunderbird
];
};
nixpkgs.overlays = [
(final: prev: {
dwm = prev.dwm.overrideAttrs (old: { src = /home/dobbie/Suckless/dwm ;});
})
(final: prev: {
dmenu = prev.dmenu.overrideAttrs (old: { src = /home/dobbie/Suckless/dmenu ;});
})
(final: prev: {
slstatus = prev.slstatus.overrideAttrs (old: { src = /home/dobbie/Suckless/slstatus ;});
})
(final: prev: {
slock = prev.slock.overrideAttrs (old: { src = /home/dobbie/Suckless/slock ;});
})
];
users.defaultUserShell = pkgs.zsh;
# Enable automatic login for the user.
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "dobbie";
# Music Player Daemon
services.mpd = {
enable = true;
user = "dobbie";
musicDirectory = "/run/media/dobbie/Music/";
playlistDirectory = "/home/dobbie/.config/mpd/playlists";
extraConfig = ''
audio_output {
type "pipewire"
name "My PipeWire Output"
}
'';
startWhenNeeded =
true; # systemd feature: only start MPD service upon connection to its socket
};
systemd.services.mpd.environment = {
# https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609
XDG_RUNTIME_DIR =
"/run/user/1000"; # User-id 1000 must match above user. MPD will look inside this directory for the PipeWire socket.
};
# ZSH
programs = {
zsh = {
enable = true;
shellAliases = {
ll = "ls -l";
update = "sudo nixos-rebuild switch";
garbage = "sudo nix-collect-garbage -d";
ls = "eza -al --color=always --group-directories-first";
};
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
histSize = 10000;
histFile = "/home/dobbie/.zsh_history";
ohMyZsh = {
enable = true;
plugins = [ "git" "safe-paste" "history" "globalias" "history-substring-search" ];
theme = "robbyrussell";
customPkgs = with pkgs; [
nix-zsh-completions
];
};
};
};
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
extraConfig = ''
DefaultTimeoutStopSec=10s
'';
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
fonts = { #This is depricated new sytax will
fonts = with pkgs; [ #be enforced in the next realease
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
font-awesome
source-han-sans
source-han-sans-japanese
source-han-serif-japanese
(nerdfonts.override { fonts = [ "Meslo" ]; })
];
fontconfig = {
enable = true;
defaultFonts = {
monospace = [ "Meslo LG M Regular Nerd Font Complete Mono" ];
serif = [ "Noto Serif" "Source Han Serif" ];
sansSerif = [ "Noto Sans" "Source Han Sans" ];
};
};
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}
Apologies for the seemingly simple questions, I have searched everywhere without really finding a solution, hence my post.
Thanks