Move to multi-file nix config
This commit is contained in:
parent
40ae8fa74b
commit
f10c0a019b
8 changed files with 303 additions and 122 deletions
|
|
@ -1,21 +1,36 @@
|
|||
# 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`).
|
||||
# This configuration is considered to be core to my system. Each group of features considered not core
|
||||
# will be found in one of the ./profile
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
# Change this to your user's name
|
||||
HOME = "/home/vince";
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./personal.nix
|
||||
|
||||
./profiles/emacs.nix
|
||||
./profiles/lf.nix
|
||||
./profiles/nvim.nix
|
||||
./profiles/virtualbox.nix
|
||||
./profiles/wayland_desktop.nix
|
||||
./profiles/xdesktop.nix
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
};
|
||||
|
||||
environment.sessionVariables = {
|
||||
ZDOTDIR = "$HOME/.config/zsh";
|
||||
|
|
@ -40,53 +55,6 @@
|
|||
# Set your time zone.
|
||||
time.timeZone = "America/New_York";
|
||||
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
inputMethod = {
|
||||
# Have to install fcitx5 through here so that the binary is patched to be able to see the addons.
|
||||
# If also installed through system packages, the binary without addonds will take precedence.
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-configtool
|
||||
fcitx5-rime
|
||||
fcitx5-chinese-addons
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
fonts.fonts = with pkgs; [
|
||||
source-han-sans
|
||||
source-han-serif
|
||||
(nerdfonts.override { fonts = [ "FiraCode" ]; })
|
||||
];
|
||||
|
||||
|
||||
# X Server
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
autorun = false;
|
||||
|
||||
autoRepeatDelay = 300;
|
||||
autoRepeatInterval = 50;
|
||||
|
||||
# Configure keymap in X11
|
||||
layout = "us";
|
||||
xkbOptions = "eurosign:e,caps:escape";
|
||||
|
||||
# Touchpad stuff
|
||||
libinput = {
|
||||
enable = true;
|
||||
touchpad.naturalScrolling = true;
|
||||
};
|
||||
|
||||
displayManager = {
|
||||
lightdm.enable = false;
|
||||
startx.enable = true;
|
||||
};
|
||||
|
||||
windowManager.dwm.enable = true;
|
||||
};
|
||||
|
||||
# Bluetooth daemon
|
||||
services.blueman.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
|
|
@ -111,24 +79,20 @@
|
|||
path = [ pkgs.coreutils ]; # For chgrp
|
||||
};
|
||||
|
||||
# Monitor switching service. Allow users to restart the service without password
|
||||
# services.autorandr.enable = true;
|
||||
security.sudo.extraConfig = ''
|
||||
%wheel ALL=(ALL:ALL) NOPASSWD: ${pkgs.systemd}/bin/systemctl restart autorandr
|
||||
'';
|
||||
|
||||
# Misc services
|
||||
services.syncthing.enable = true;
|
||||
services.udisks2.enable = true; # USB Mounting
|
||||
# services.printing.enable = true; # CUPS
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
nix-ld.enable = true; # Run unpatched binaries
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
|
|
@ -145,89 +109,44 @@
|
|||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
# General programs that I like and use
|
||||
arandr # Visually move relative positions of monitors
|
||||
autorandr # Save and load xrandr profiles
|
||||
blueman # Bluetooth manager
|
||||
bluetuith # TUI bluetooth manager
|
||||
bear # Generate Clang compilation database
|
||||
devour # Opens new program on top of terminal
|
||||
dunst # Notification daemon
|
||||
dwmblocks # Suckless statusbar for DWM
|
||||
dwm # Suckless tiling window manager
|
||||
emacs # Lisp machine VM / ELisp interpreter / way of life
|
||||
feh # Image viewer I use for background setting
|
||||
firefox # My browser of choice
|
||||
distrobox # Easily spin up VMs of other distos
|
||||
entr # Hooks for file changes
|
||||
git # Imagine not having this
|
||||
htop # Process monitor
|
||||
htop-vim # Process monitor, with vim bindings
|
||||
imagemagick # Image conversion/processing tool
|
||||
jq # Commandline JSON processor
|
||||
killall # Easy way to kill a process
|
||||
libnotify # Send messages to notification daemon
|
||||
libreoffice # MSOffice btfo
|
||||
maim # Screenshot utility
|
||||
neofetch # Aesthetic sysinfo
|
||||
pass-nodmenu # CLI password store (without dmenu dependency)
|
||||
picom # X Compositor
|
||||
pinentry-curses # Terminal-based pinentry program
|
||||
pinentry-rofi # Rofi frontend for pinentry program
|
||||
python311 # Python
|
||||
rofi # Menu prompt program
|
||||
rofi-pass # Rofi frontend for password store
|
||||
st # Suckless terminal
|
||||
sxhkd # Hotkey daemon
|
||||
syncthing # Syncing files between machines
|
||||
texlive.combined.scheme-full # LaTeX to create documents
|
||||
tldr # Brief info about a command
|
||||
tmux # Terminal multiplexor
|
||||
typst # Cool, minimal LaTeX alternative
|
||||
udisks # Good way of dealing with USBs and similar media
|
||||
ungoogled-chromium # If I need a special chrome feature
|
||||
xsecurelock # Session locker
|
||||
zsh # Shell
|
||||
|
||||
# Shell
|
||||
starship # Universal shell prompt
|
||||
zsh
|
||||
zsh-autocomplete
|
||||
zsh-autosuggestions
|
||||
zsh-nix-shell # Use zsh for nix build shell
|
||||
zsh-syntax-highlighting # Shell syntax highlighting
|
||||
|
||||
# GTK Themes
|
||||
lxappearance-gtk2 # Theme switcher
|
||||
gruvbox-dark-gtk
|
||||
|
||||
# Neovim and neovim accessories
|
||||
neovim # Editor
|
||||
###
|
||||
nodejs # Used by Mason to pull deps
|
||||
ripgrep # Used by telescope
|
||||
gcc
|
||||
unzip
|
||||
|
||||
# lf and lf accessories
|
||||
# There might be some repeats is here from elsewhere in this file, but I simply want to
|
||||
# enumerate everything my config of lf depends on. No, I'm not using home-manager (for now)
|
||||
lf # File explorer
|
||||
###
|
||||
atool # Provides aunpack, to open archives. Also can list archive contents.
|
||||
bat # A prettified 'cat'
|
||||
broot # A slicker fzf
|
||||
ffmpegthumbnailer # Get thumbnails of videos
|
||||
file # Get information about a specific file
|
||||
fzf # Fuzzy finder. Might fully replace with broot
|
||||
mediainfo # Get info about media
|
||||
mpv # Audio and video player
|
||||
nsxiv # Image viewer
|
||||
odt2txt # Convert open documents to text
|
||||
perl536Packages.FileMimeInfo # Provides mimeopen, to ask what program to open files in
|
||||
poppler_utils # Provides pdftoppm, to turn pdfs into images
|
||||
ueberzugpp # Terminal image overlayer
|
||||
unrar-wrapper # Extract .rar files
|
||||
xclip # Copy file name to clip
|
||||
zathura # PDF viewer
|
||||
|
||||
# X accessories
|
||||
xorg.xauth
|
||||
xclip
|
||||
|
||||
# Silly programs
|
||||
asciiquarium # Good to throw on an extra monitor
|
||||
asciiquarium
|
||||
bsdgames # Fun collection of command-line games
|
||||
neo-cowsay # The cow says moo
|
||||
sl # Choo choo
|
||||
|
||||
# Some nix specific stuff
|
||||
nix-index
|
||||
home-manager
|
||||
nix-output-monitor # Track dependency graph during builds
|
||||
nix-prefetch-git # Like nix-prefetch-url, but for git
|
||||
nvd # See diffs between builds
|
||||
|
||||
# Pop into an environment abiding by the Filesystem Hierarchy Standard to run
|
||||
# applications which do not play nicely with NixOS.
|
||||
|
|
@ -273,6 +192,18 @@
|
|||
)
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
asciiquarium = super.asciiquarium.overrideAttrs (oa: {
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/nothub/asciiquarium";
|
||||
rev = "204090ff4c97b2e00cd67f26b1a37ca7accd4f95";
|
||||
hash = "sha256-0Y0bcsa6GfP/A+gZe6o94WNWfQNHVEtMZfMuvWVBu0c=";
|
||||
};
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
# 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
|
||||
|
|
|
|||
21
.config/nixos/profiles/emacs.nix
Normal file
21
.config/nixos/profiles/emacs.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
services.emacs.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
emacs29-gtk3
|
||||
|
||||
# Misc
|
||||
ispell # Spellchecker
|
||||
fd # Find entries in filesystem. Helps doom emacs run faster.
|
||||
|
||||
# For vterm
|
||||
cmake
|
||||
libtool
|
||||
|
||||
## LSPs
|
||||
nodePackages.pyright
|
||||
];
|
||||
}
|
||||
|
||||
26
.config/nixos/profiles/lf.nix
Normal file
26
.config/nixos/profiles/lf.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
lf
|
||||
|
||||
atool # Provides aunpack, to open archives. Also can list archive contents.
|
||||
bat # A prettified 'cat'
|
||||
broot # A slicker fzf
|
||||
chafa # Display images in the terminal (supports sixel)
|
||||
ffmpegthumbnailer # Get thumbnails of videos
|
||||
file # Get information about a specific file
|
||||
fzf # Fuzzy finder. Might fully replace with broot
|
||||
imagemagick # Image conversion/processing tool
|
||||
mediainfo # Get info about media
|
||||
mpv # Audio and video player
|
||||
nsxiv # Image viewer
|
||||
odt2txt # Convert open documents to text
|
||||
perl536Packages.FileMimeInfo # Provides mimeopen, to ask what program to open files in
|
||||
poppler_utils # Provides pdftoppm, to turn pdfs into images
|
||||
unrar-wrapper # Extract .rar files
|
||||
xclip # Copy file name to clip
|
||||
zathura # PDF viewer
|
||||
];
|
||||
}
|
||||
|
||||
9
.config/nixos/profiles/minimal.nix
Normal file
9
.config/nixos/profiles/minimal.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config {
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
17
.config/nixos/profiles/nvim.nix
Normal file
17
.config/nixos/profiles/nvim.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
|
||||
# LSPs
|
||||
clang-tools
|
||||
lua-language-server
|
||||
|
||||
# Misc
|
||||
ripgrep # Used by telescope
|
||||
gcc
|
||||
unzip
|
||||
];
|
||||
}
|
||||
|
||||
14
.config/nixos/profiles/virtualbox.nix
Normal file
14
.config/nixos/profiles/virtualbox.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.storageDriver = "btrfs";
|
||||
|
||||
# Implicitly downloads virtualbox
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
users.extraGroups.vboxusers.members = [ "user-with-access-to-virtualbox" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
}
|
||||
|
||||
74
.config/nixos/profiles/wayland_desktop.nix
Normal file
74
.config/nixos/profiles/wayland_desktop.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Or else swaylock will not accept correct password
|
||||
security.pam.services.swaylock = {};
|
||||
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
inputMethod = {
|
||||
# Have to install fcitx5 through here so that the binary is patched to be able to see the addons.
|
||||
# If also installed through system packages, the binary without addonds will take precedence.
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-configtool
|
||||
fcitx5-rime
|
||||
fcitx5-chinese-addons
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
source-han-sans
|
||||
source-han-serif
|
||||
(nerdfonts.override { fonts = [ "FiraCode" ]; })
|
||||
];
|
||||
|
||||
programs = {
|
||||
hyprland = {
|
||||
enable = true;
|
||||
enableNvidiaPatches = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
blueman # Bluetooth manager
|
||||
dunst # Notification daemon
|
||||
eww-wayland
|
||||
firefox # My browser of choice
|
||||
foot # Wayland native terminal
|
||||
hyprland-autoname-workspaces
|
||||
hyprpaper
|
||||
kanshi # Autorandr substitute
|
||||
libnotify # Send messages to notification daemon
|
||||
libreoffice # MSOffice btfo
|
||||
pinentry-rofi # Rofi frontend for pinentry program
|
||||
pyprland # Plugin manager for Hyprland
|
||||
rofi # Menu prompt program
|
||||
rofi-pass # Rofi frontend for password store
|
||||
swaylock # Wayland session locker
|
||||
swww # Sets background images
|
||||
texlive.combined.scheme-full # LaTeX to create documents
|
||||
typst # Cool, minimal LaTeX alternative
|
||||
ungoogled-chromium # If I need a special chrome feature
|
||||
waybar # Status bar
|
||||
wdisplays # Arnadr substitute
|
||||
wlr-randr # Xrandr substitute
|
||||
|
||||
# GTK Themes
|
||||
lxappearance-gtk2 # Theme switcher
|
||||
gruvbox-dark-gtk
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
wlroots-hyprland-nvidia = super.wlroots-hyprland-nvidia.overrideAttrs (oa: {
|
||||
patches = (oa.patches or [ ]) ++ [
|
||||
/home/vince/misc/DisplayLink_v2.patch
|
||||
];
|
||||
});
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
89
.config/nixos/profiles/xdesktop.nix
Normal file
89
.config/nixos/profiles/xdesktop.nix
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
security.sudo.extraConfig = ''
|
||||
%wheel ALL=(ALL:ALL) NOPASSWD: ${pkgs.systemd}/bin/systemctl restart autorandr
|
||||
'';
|
||||
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
inputMethod = {
|
||||
# Have to install fcitx5 through here so that the binary is patched to be able to see the addons.
|
||||
# If also installed through system packages, the binary without addonds will take precedence.
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-configtool
|
||||
fcitx5-rime
|
||||
fcitx5-chinese-addons
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
source-han-sans
|
||||
source-han-serif
|
||||
(nerdfonts.override { fonts = [ "FiraCode" ]; })
|
||||
];
|
||||
|
||||
# X Server
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
autorun = false;
|
||||
|
||||
autoRepeatDelay = 300;
|
||||
autoRepeatInterval = 50;
|
||||
|
||||
# Configure keymap in X11
|
||||
layout = "us";
|
||||
xkbOptions = "eurosign:e,caps:escape";
|
||||
|
||||
# Touchpad stuff
|
||||
libinput = {
|
||||
enable = true;
|
||||
touchpad.naturalScrolling = true;
|
||||
};
|
||||
|
||||
displayManager = {
|
||||
lightdm.enable = false;
|
||||
startx.enable = true;
|
||||
};
|
||||
|
||||
windowManager.dwm.enable = true;
|
||||
};
|
||||
|
||||
# Monitor switching service. Allow users to restart the service without password
|
||||
services.autorandr.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
arandr # Visually move relative positions of monitors
|
||||
autorandr # Save and load xrandr profiles
|
||||
blueman # Bluetooth manager
|
||||
dunst # Notification daemon
|
||||
dwmblocks # Suckless statusbar for DWM
|
||||
dwm # Suckless tiling window manager
|
||||
feh # Image viewer I use for background setting
|
||||
firefox # My browser of choice
|
||||
libnotify # Send messages to notification daemon
|
||||
libreoffice # MSOffice btfo
|
||||
maim # Screenshot utility
|
||||
picom # X Compositor
|
||||
pinentry-rofi # Rofi frontend for pinentry program
|
||||
rofi # Menu prompt program
|
||||
rofi-pass # Rofi frontend for password store
|
||||
st # Suckless terminal
|
||||
sxhkd # Hotkey daemon
|
||||
texlive.combined.scheme-full # LaTeX to create documents
|
||||
typst # Cool, minimal LaTeX alternative
|
||||
ungoogled-chromium # If I need a special chrome feature
|
||||
xsecurelock # Session locker
|
||||
|
||||
# GTK Themes
|
||||
lxappearance-gtk2 # Theme switcher
|
||||
gruvbox-dark-gtk
|
||||
|
||||
# X tools
|
||||
xorg.xauth
|
||||
xclip
|
||||
];
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue