baremetal install, cleaned up code

This commit is contained in:
2023-04-30 15:23:40 -06:00
parent 194ebe7d01
commit 92a2b959d7
9 changed files with 729 additions and 1337 deletions

View File

@@ -3,24 +3,22 @@
#+PROPERTY: header-args :tangle configuration.nix
#+auto_tangle: t
* TODO
- [ ] Clean up configuration file
- [ ] Check music [0/5]
- [ ] Last.fm
- [ ] Libre.fm (optional)
- [ ] Beet plugins work
- [ ] Beet web server works
- [ ] Move music around
- [ ] System configurations [0/6]
* TODO [2/10]
- [X] Clean up configuration file
- [X] Merge current config
- [ ] System configurations [0/7]
- [ ] fail2ban
- [ ] Bluetooth multiple devices + pass-through
- [ ] Automatic updates
- [ ] SSH settings
- [ ] Automatic garbage collection
- [ ] Firewall ports
- [ ] Topgrade (perhaps unnecessary)
- [ ] SystemD services [0/3]
- [ ] FStrim
- [ ] BTRFS scrub
- [-] SystemD services [2/5]
- [ ] docker-compose
- [ ] snapraid
- [X] FStrim
- [X] BTRFS scrub
- [ ] Personal scripts [0/3]
- [ ] download
- [ ] Instagram
@@ -44,18 +42,13 @@
- [ ] .local/share [0/2]
- [ ] beets
- [ ] mpd
- [ ] Migrate apps [0/4]
- [ ] paru
- [-] Migrate apps [1/4]
- [X] paru
- [ ] pipx
- [ ] pip IMPORTANT for beet
- [ ] appimages
- [ ] Figure out how to get rid of xterm
- [ ] Compile missing apps [0/4]
- [ ] Identity
https://gitlab.gnome.org/YaLTeR/identity
Only challenge may be gstreamer, but probably not an issue. May be the easier one to package.
- [ ] Bats
https://github.com/bats-core/bats-core
- [ ] Compile missing apps [0/3]
- [ ] wine-discord-ipc-bridge
https://github.com/fufexan/nix-gaming
- [ ] make binaries of my own scripts
@@ -89,13 +82,6 @@ imports = [
];
#+end_src
* BOOT
I am comfortable with the defaults which NixOS recommends for UEFI systems.
#+begin_src nix
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
#+end_src
* SYSTEM CONFIGURATION
** NETWORKING
@@ -127,7 +113,12 @@ way it is an unnecessary setting as my keyboards are the default en_US, only
locale set to Canadian out because I prefer how it displays the date.
#+begin_src nix
i18n.defaultLocale = "en_CA.UTF-8";
i18n = {
defaultLocale = "en_CA.UTF-8";
extraLocaleSettings = {
LC_MONETARY = "es_MX.UTF-8";
};
};
console = {
font = "Lat2-Terminus16";
keyMap = "us";
@@ -135,33 +126,27 @@ console = {
};
#+end_src
* DISPLAY MANAGER
* GNOME
At the time of writing this file, I require of X11, as the NVIDIA support for
Wayland isn't perfect yet. At the time being, the ability to switch through GDM
from Wayland to XORG, it's pretty handy, but in the future these settings will
require an update.
#+begin_src nix
services.xserver.enable = true;
#+end_src
As previously mentioned, the settings for useXkbConfig prompt issues.
#+begin_src nix
services.xserver.layout = "us";
# services.xserver.xkbOptions = {
# "eurosign:e";
# "caps:escape" # map caps to escape.
# };
#+end_src
* GNOME
Sets up GNOME as the default desktop environment, while excluding some
undesirable packages from installing.
#+begin_src nix
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services = {
xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
layout = "us";
libinput.enable = true; # Wacom required?
};
};
environment.gnome.excludePackages = (with pkgs; [
gnome-photos
gnome-tour
@@ -181,14 +166,7 @@ environment.gnome.excludePackages = (with pkgs; [
]);
#+end_src
* HARDWARE
** BLUETOOTH
#+begin_src nix
hardware.bluetooth.enable = true;
#+end_src
** SOUND
* SOUND
In order to avoid issues with PipeWire, the wiki recommends to disable /sound.enable/
This is a basic PipeWire configuration, in the future stuff like Bluetooth or
latency will require expanding these settings.
@@ -209,7 +187,7 @@ services.pipewire = {
Recently, I've gotten frustrated with OpenDoas, as such I've decided to
temporarily enable Sudo, but in the future, I plan to revert that decision.
** SUDO
Disabled password for commodity, but this is obviously not recommended.
#+begin_src nix
security.sudo = {
enable = true;
@@ -241,7 +219,7 @@ Being part of the "wheel" group, means that the user has root privileges.
#+begin_src nix
users.users.jawz = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
extraGroups = [ "wheel" "networkmanager" "docker" ];
initialPassword = "password";
shell = pkgs.fish;
packages = with pkgs; [ ];
@@ -267,14 +245,6 @@ setting.
fonts.fontconfig.enable = true;
#+end_src
** WACOM
This setting could be a requirement for my tablet to properly work. Even
though, my tablet is Huion, the Linux Wacom drivers cover most of the settings.
#+begin_src nix
# services.xserver.libinput.enable = true;
#+end_src
* HOME-MANAGER
** HOME-MANAGER SETTINGS
These make it so packages install to '/etc' rather than the user home directory,
@@ -292,41 +262,69 @@ necessary.
#+begin_src nix
home-manager.users.jawz = { config, pkgs, ... }:{
imports = [ ./dotfiles/dconf.nix ];
# imports = [ ./dotfiles/dconf.nix ];
home.stateVersion = "22.11";
home.packages = with pkgs; [
#+end_src
*** GUI PACKAGES
#+begin_src nix
blanket # background noise
# Art
blender # cgi animation and sculpting
godot # game development
krita # art to your heart desire!
drawpile # arty party with friends!!
mypaint # not the best art program
mypaint-brushes # but it's got some
mypaint-brushes1 # nice damn brushes
# Gaming
lutris # game/emulator manager
grapejuice # roblox manager
minecraft # minecraft official launcher
parsec-bin # remote gaming with friends
# Productivity
libreoffice-fresh # office, but based
calibre # ugly af eBook library manager
foliate # gtk eBook reader
gnome.simple-scan # document scanner
gnome-feeds # feed reader, maybe will replace with nextcloud
tagger # tag music files
# Misc
sequeler # friendly SQL client
blanket # background noise
czkawka # duplicate finder
# pika-backup # backups
tilix # terminal
gnome-obfuscate # censor private information
metadata-cleaner # remove any metadata and geolocation from files
# gnome-recipes # migrate these to mealie and delete
# Multimedia
celluloid # video player
cozy # audiobooks player
czkawka # duplicate finder
discord # chat
dropbox # cloud sync
# foliate # ebook reader
# gnome-podcasts # podcast player
# gnome-recipes # migrate these to mealie and delete
godot # game development
google-chrome # web browser
gnome-podcasts # podcast player
handbrake # video converter, may be unnecessary
# krita # art to your heart desire!
# libreoffice-fresh # office, but based
# lutris # game/emulator manager
megasync # cloud sync
mpdevil # ugly icon, but pretty mpd client nwn
# pika-backup # backups
curtail # image compressor
pitivi # video editor
tilix # terminal
#+end_src
# identity # compare images or videos
mousai # poor man shazam
# bottles # wine prefix manager
obs-studio # screen recorder & streamer
shortwave # listen to world radio
*** MISC PACKAGES
#+begin_src nix
ffmpegthumbnailer # create video thumbnails for nautilus, in absence of totem
mpdas # scrobble mpd songs to last.fm
# Web
discord # chat
google-chrome # web browser with spyware included
firefox # web browser that allows to disable spyware
librewolf # no spyware web browser
tor-browser-bundle-bin # dark web, so dark!
# hugo # website engine
nicotine-plus # remember Ares?
warp # never used, but supposedly cool for sharing files
#+end_src
*** COMMAND-LINE PACKAGES
@@ -337,26 +335,46 @@ gocryptfs # encrypted filesystem! shhh!!!
exa # like ls but with colors
trash-cli # oop! didn't meant to delete that
ffmpeg_5 # coolest video converter!
yt-dlp # downloads videos from most video websites
neofetch # use once for brag, never again
rmlint # probably my favourite app, amazing dupe finder that integrates well with BTRFS
tldr # man for retards
ffmpegthumbnailer # create video thumbnails for nautilus, in absence of totem
mediainfo # technical info about videos, needed by some of my scripts
tree-sitter # code parsing, required by Doom emacs
xdg-ninja # help declutter $HOME
torrenttools # create torrent files from the terminal!
#+end_src
*** DEVELOPMENT PACKAGES
**** DOOM EMACS
#+begin_src nix
# required by doom emacs, but still are rather useful.
fd # modern find, faster searches
fzf # fuzzy finder! super cool and useful
ripgrep # modern grep
languagetool # proofreader for English. check if works without the service
# development environment
nix-direnv # nix implementation of direnv
exercism # learn to code
# SH
bats # testing system, required by Exercism
bashdb # autocomplete
shellcheck # linting
shfmt # a shell parser and formatter
nodePackages.bash-language-server # LSP support
# NIX
nixfmt # linting
# PYTHON.
python # base language
python3 # base language
python310Packages.pipx
# C# & Rust
omnisharp-roslyn
# HASKELL
# cabal-install # haskell interface
@@ -367,17 +385,13 @@ python # base language
# nodePackages.pnpm
#+end_src
**** EXERCISM
#+begin_src nix
#+end_src
*** GNOME EXTENSIONS
#+begin_src nix
gnome.gnome-tweaks
gnomeExtensions.appindicator
gnomeExtensions.gsconnect
gnome.gnome-tweaks
#+end_src
*** HUNSPELL
@@ -394,10 +408,14 @@ hunspellDicts.en_CA
Also, this finishes the packages array, put new modules above.
#+begin_src nix
# Themes
adwaita-qt
# Fonts
(nerdfonts.override {
fonts = [ "Agave" "CascadiaCode" "SourceCodePro" "Ubuntu" ];
fonts = [ "Agave" "CascadiaCode" "SourceCodePro" "Ubuntu" "FiraCode" "Iosevka" ];
})
# (papirus-icon-theme.override {
# color = "grey";
# })
@@ -417,7 +435,7 @@ programs.fish = {
edit = "emacsclient -t";
comic = "download -u jawz -i (cat $lc | fzf --multi --exact -i)";
gallery = "download -u jawz -i (cat $lw | fzf --multi --exact -i)";
open_gallery = "open (find ${config.xdg.userDirs.download}/To\ Organize/gdl-organizing/ -type d | fzf)";
open_gallery = "open (find /mnt/disk2/scrapping/JawZ/gallery-dl -type d | fzf)";
unique_extensions = "find . -type f | string match -r '([^.\/]+)\$' | sort -u";
cp = "cp -i";
mv = "mv -i";
@@ -431,6 +449,7 @@ programs.fish = {
};
shellAbbrs = {
dl = "download -u jawz -i";
ex = "ls";
e = "edit";
c = "cat";
f = "fzf --multi --exact -i";
@@ -440,12 +459,11 @@ programs.fish = {
interactiveShellInit = ''
#+end_src
#+begin_src fish
set fish_greeting "pika pika chu!!!! also remember fisher!"
# Lists
set -l list_root ${config.home.homeDirectory}/Dropboxxx/jawz
set -l list_root ${config.home.homeDirectory}/.config/jawz/lists/jawz
set lw $list_root/watch.txt
set li $list_root/instant.txt
set lc $list_root/comic.txt
@@ -468,17 +486,16 @@ end
#+begin_src nix
functions = {
nix_magic = ''
nixos-magic = ''
#+end_src
#+begin_src fish
nixfmt ~/MEGAsync/nixos/configuration.nix
sudo rsync -r ~/MEGAsync/nixos/ /etc/nixos/
sudo nixos-rebuild switch
set -l nix_file "$HOME/Development/NixOS/configuration.nix"
echo $nix_file
nixfmt $nix_file
sudo nixos-rebuild switch -I nixos-config=$nix_file
#+end_src
#+begin_src nix
'';
};
@@ -497,101 +514,6 @@ programs.bat = {
};
#+end_src
*** BEETS
#+begin_src nix
programs.beets = {
enable = true;
settings = {
directory = "${config.xdg.userDirs.music}";
library = "${config.xdg.dataHome}/beets/musiclibrary.db";
plugins = "embedart fetchart lyrics discogs spotify deezer edit lastgenre mbsync replaygain scrub mpdupdate duplicates info fish ftintitle fuzzy";
ignore_hidden = true;
threaded = true;
duplicate = {
album = false;
delete = false;
};
ftintitle = {
auto = true;
drop = true;
format = "feat. {0}";
};
fetchart = {
maxwidth = 1000;
quality = 70;
enforce_ratio = true;
lastfm_key = "aeae592346534482202bd94bc14a80c4";
fanarttv_key = "f12b0931d2f971a5b5215c3f451bafb7";
sources = "*";
cover_format = "JPEG";
};
embedart = {
auto = true;
maxwidth = 1000;
quality = 70;
remove_art_file = false;
ifempty = true;
};
lyrics = {
auto = true;
sources = "*";
};
replaygain = {
auto = true;
overwrite = true;
peak = "true";
backend = "ffmpeg";
};
lastgenre = {
auto = true;
canonical = true;
force = true;
source = "album";
count = 1;
title_case = true;
};
mpd = {
host = "localhost";
port = 6600;
};
ui = {
color = true;
};
"import" = {
move = true;
write = true;
genres = true;
log = "${config.xdg.dataHome}/beets/beetslog.txt";
};
replace = {
"[\\\\/]" = ""; # \ /
"^\\." = ""; # dotfiles
"[\\x00-\\x1f]" = ""; # NULL to US
"\\x00" = ""; # NULL
"[<>:\"\\?\\*\\|]" = ""; # <>:"?*|
"\\.$" = ""; # dot at the end
"\\s+$" = ""; # ends with whitespace
"^\\s+" = ""; # starts with whitespace
"^-" = ""; # starts with -
};
paths = {
default = "$albumartist/$album/$track $title";
singleton = "Singletons/$artist - $title";
comp = "$album/$track $title";
"albumtype:soundtrack" = "Soundtracks/$album/$track $title";
};
convert = {
auto = true;
embed = true;
delete_originals = true;
extension = "opus";
# command = "ffmpeg -i $source -y -vn -acodec libopus -ab 256k $dest";
};
};
};
#+end_src
*** GIT
#+begin_src nix
@@ -635,7 +557,7 @@ xdg.userDirs = {
download = "${config.home.homeDirectory}/Downloads";
music = "${config.home.homeDirectory}/Music";
pictures = "${config.home.homeDirectory}/Pictures";
publicShare = "${config.home.homeDirectory}/.local/hd/Public";
# publicShare = "${config.home.homeDirectory}/.local/hd/Public";
templates = "${config.home.homeDirectory}/.local/share/Templates";
videos = "${config.home.homeDirectory}/Videos";
};
@@ -649,68 +571,19 @@ xdg.configFile = {
"configstore/update-notifier-npm-check.json".source = ./dotfiles/npm/update-notifier-npm-check.json;
"npm/npmrc".source = ./dotfiles/npm/npmrc;
"gallery-dl/config.json".source = ./dotfiles/gallery-dl/config.json;
# "gopass/config.yml".source = ./dotfiles/gopass/config.yml;
"mpdasrc".source = ./dotfiles/mpdas/mpdasrc;
};
#+end_src
** USER-SERVICES
*** MPD
#+begin_src nix
services.mpd = {
enable = true;
musicDirectory = "${config.xdg.userDirs.music}";
network.listenAddress = "any";
# network.startWhenNeeded = true;
extraConfig = ''
#+end_src
#+begin_src conf
restore_paused "yes"
auto_update "yes"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
# zeroconf_enabled "yes"
# zeroconf_name "Music Player @ %h"
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
}
audio_output {
type "pipewire"
name "PipeWire Sound Server"
}
audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
replaygain "auto"
replaygain_limit "yes"
volume_normalization "yes"
#+end_src
#+begin_src nix
'';
};
#+end_src
*** MPD EXTENSIONS
#+begin_src nix
services.mpd-discord-rpc.enable = true;
services.mpdris2 = {
enable = true;
multimediaKeys = true;
mpd.host = "localhost";
};
# services.mpd-discord-rpc.enable = true;
# services.mpdris2 = {
# enable = true;
# multimediaKeys = true;
# mpd.host = "localhost";
# };
#+end_src
** CLOSING HOME-MANAGER
@@ -726,7 +599,7 @@ may be challenging.
#+begin_src nix
environment.systemPackages = with pkgs; [
wget
git
docker-compose
];
#+end_src
@@ -739,7 +612,10 @@ environment.sessionVariables = rec {
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
SCRIPTS = "/home/jawz/Development/Scripts";
XDG_STATE_HOME = "\${HOME}/.local/state";
SCRIPTS = "\${HOME}/Development/Scripts";
# DEV PATH
CABAL_CONFIG = "\${XDG_CONFIG_HOME}/cabal/config";
CABAL_DIR = "\${XDG_CACHE_HOME}/cabal";
@@ -757,7 +633,7 @@ environment.sessionVariables = rec {
ELECTRUMDIR = "\${XDG_DATA_HOME}/electrum";
VISUAL = "emacsclient -ca emacs";
WGETRC = "\${XDG_CONFIG_HOME}/wgetrc";
"_JAVA_OPTIONS" = "-Djava.util.prefs.userRoot=/home/jawz/.config/java";
"_JAVA_OPTIONS" = "-Djava.util.prefs.userRoot=\${XDG_CONFIG_HOME}/java";
# NVIDIA
CUDA_CACHE_PATH = "\${XDG_CACHE_HOME}/nv";
# GBM_BACKEND = "nvidia-drm";
@@ -769,89 +645,73 @@ environment.sessionVariables = rec {
# QT_QPA_PLATFORMTHEME = "adwaita-dark";
# QT_STYLE_OVERRIDE = "adwaita";
# CALIBRE_USE_SYSTEM_THEME = "1";
PATH = [
"\${XDG_BIN_HOME}"
"\${XDG_CONFIG_HOME}/emacs/bin"
# "\${XDG_DATA_HOME}/npm/bin"
# "\${XDG_DATA_HOME}/pnpm"
"\${SCRIPTS}"
# "\${PNPM_HOME}"
# "\${SCRIPTS}"
];
};
#+end_src
* WRAPPERS
* DOCKER
Virtualization settings for Docker. NixOS offers an option to declaratively run
docker-compose images using [[https://nixos.wiki/wiki/Docker][Arion]]. Could be an interesting thing to try out.
#+begin_src nix
virtualisation.docker = {
enable = true;
storageDriver = "btrfs";
enableNvidia = true;
};
#+end_src
* PROGRAMS & SERVICES
Some programs need SUID wrappers.
** NETWORK DIAGNOSTICS TOOL
I don't know what it does, but it's recommended.
#+begin_src nix
programs.mtr.enable = true;
#+end_src
** GNUPG
#+begin_src nix
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
programs = {
mtr.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
geary = {
enable = true;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
};
#+end_src
* SYSTEM-SERVICES
** CADDY
#+begin_src nix
# services.caddy = {
# enable = true;
# email = "CaptainJawZ@outlook.com";
# configFile = ./dotfiles/Caddyfile;
# # config = ''
# # torrent.danilo-reyes.com {
# # reverse_proxy localhost:9091
# # }
# # '';
# };
#+end_src
** EMACS
#+begin_src nix
services.emacs = {
enable = true;
defaultEditor = true;
package = pkgs.emacs28NativeComp;
services = {
printing.enable = true;
emacs = {
enable = true;
defaultEditor = true;
package = pkgs.emacs;
};
fstrim.enable = true;
btrfs.autoScrub = {
enable = true;
fileSystems = [
"/"
"/mnt/disk1"
"/mnt/disk2"
];
};
openssh = {
enable = true;
ports = [ 25152 ];
};
udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
};
#+end_src
** HARD-DRIVE MAINTENANCE
#+begin_src nix
services.fstrim.enable = true;
services.btrfs.autoScrub = {
enable = true;
fileSystems = [
"/"
# "/torrents"
# "/home/jawz/.local/hd" # Maybe change mount point?
];
};
#+end_src
** OPENSSH
#+begin_src nix
services.openssh = {
enable = true;
ports = [ 25152 ];
};
#+end_src
** UDEV
#+begin_src nix
services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
#+end_src
* FIREWALL
Open ports in the firewall.
=TIP= list what app a port belongs to in a table.
@@ -881,7 +741,7 @@ of the first install of this system.
Before changing this value read the documentation for this option.
#+begin_src nix
system.stateVersion = "22.05";
system.stateVersion = "22.11";
#+end_src
** CLOSING :D