diff --git a/configuration.nix b/configuration.nix index bb454a5..a5f744b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -109,6 +109,7 @@ in { # Remember to close this bracket at the end of the document mypaint-brushes # but it's got some mypaint-brushes1 # nice damn brushes unstable.pureref # create inspiration/reference boards + unstable.gimp # the coolest bestest art program to never exist # Gaming lutris # game/emulator manager @@ -182,9 +183,15 @@ in { # Remember to close this bracket at the end of the document fzf # fuzzy finder! super cool and useful ripgrep # modern grep languagetool # proofreader for English. check if works without the service + graphviz # graphs + # doom everywhere + xorg.xwininfo + xdotool # development environment - nix-direnv # nix implementation of direnv + nix-direnv # creates ephimeral environments + direnv # manages development environment + # editorconfig-checker # rules for contributing exercism # learn to code # SH @@ -193,6 +200,9 @@ in { # Remember to close this bracket at the end of the document shellcheck # linting shfmt # a shell parser and formatter nodePackages.bash-language-server # LSP support + file # required by my tasks script? + gnome.zenity # dependency of my scripts + xclip # manipulate clipboard from scripts # NIX nixfmt # linting @@ -209,8 +219,7 @@ in { # Remember to close this bracket at the end of the document # JS # jq # linting - # Node-js - # nodePackages.pnpm + nodejs # not as bad as I thought gnome.gnome-tweaks # tweaks for the gnome desktop environment @@ -255,6 +264,7 @@ in { # Remember to close this bracket at the end of the document pylint # bug and style checker for python pytest # framework for writing tests speedtest-cli # check internet speed from the comand line + editorconfig # follow rules of contributin ]) ++ (with pkgs.fishPlugins; [ sponge # keep history clean from typos @@ -311,6 +321,7 @@ in { # Remember to close this bracket at the end of the document set lw $list_root/watch.txt set li $list_root/instant.txt set lc $list_root/comic.txt + set command_timeout = 30 set GPG_TTY (tty) @@ -340,66 +351,71 @@ in { # Remember to close this bracket at the end of the document }; }; - programs.bat = { - enable = true; - config = { - # map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ]; - pager = "less -FR"; - theme = "base16"; + programs = { + bat = { + enable = true; + config = { + # map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ]; + pager = "less -FR"; + theme = "base16"; + }; + }; + git = { + enable = true; + userName = "Danilo Reyes"; + userEmail = "CaptainJawZ@outlook.com"; + }; + gpg = { + enable = true; + homedir = "${config.xdg.dataHome}/gnupg"; + }; + htop = { + enable = true; + package = pkgs.htop-vim; }; }; - programs.git = { + xdg = { enable = true; - userName = "Danilo Reyes"; - userEmail = "CaptainJawZ@outlook.com"; + userDirs = { + enable = true; + # createDirectories = true; + desktop = "${config.home.homeDirectory}"; + documents = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Music"; + pictures = "${config.home.homeDirectory}/Pictures"; + # publicShare = "${config.home.homeDirectory}/.local/hd/Public"; + templates = "${config.home.homeDirectory}/.local/share/Templates"; + videos = "${config.home.homeDirectory}/Videos"; + }; + configFile = { + "wgetrc".source = ./dotfiles/wget/wgetrc; + "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; + "htop/htoprc".source = ./dotfiles/htop/htoprc; + }; }; - programs.gpg = { - enable = true; - homedir = "${config.xdg.dataHome}/gnupg"; + services = { + emacs = { + enable = true; + defaultEditor = true; + package = pkgs.emacs; + }; }; - programs.htop = { - enable = true; - package = pkgs.htop-vim; - }; - xdg.configFile."htop/htoprc".source = ./dotfiles/htop/htoprc; - - xdg = { enable = true; }; - xdg.userDirs = { - enable = true; - # createDirectories = true; - desktop = "${config.home.homeDirectory}"; - documents = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Music"; - pictures = "${config.home.homeDirectory}/Pictures"; - # publicShare = "${config.home.homeDirectory}/.local/hd/Public"; - templates = "${config.home.homeDirectory}/.local/share/Templates"; - videos = "${config.home.homeDirectory}/Videos"; - }; - - xdg.configFile = { - "wgetrc".source = ./dotfiles/wget/wgetrc; - "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; - }; - - # services.mpd-discord-rpc.enable = true; - # services.mpdris2 = { - # enable = true; - # multimediaKeys = true; - # mpd.host = "localhost"; - # }; - }; - environment.systemPackages = with pkgs; [ wget docker-compose ]; + environment.systemPackages = with pkgs; [ + wget + neovim + docker-compose # easy way to migrate my docker anywhere! + ]; - environment.sessionVariables = rec { + environment.variables = rec { # PATH XDG_CACHE_HOME = "\${HOME}/.cache"; XDG_CONFIG_HOME = "\${HOME}/.config"; @@ -431,8 +447,7 @@ in { # Remember to close this bracket at the end of the document CUDA_CACHE_PATH = "\${XDG_CACHE_HOME}/nv"; # GBM_BACKEND = "nvidia-drm"; # "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; - # FISH - fisher_path = "\${XDG_CONFIG_HOME}/fish/fisher"; + # Themes # GTK_THEME = "Adwaita:light"; # QT_QPA_PLATFORMTHEME = "adwaita-dark"; @@ -444,7 +459,7 @@ in { # Remember to close this bracket at the end of the document "\${XDG_CONFIG_HOME}/emacs/bin" "\${XDG_DATA_HOME}/npm/bin" "\${PNPM_HOME}" - # "\${SCRIPTS}" + "\${SCRIPTS}" ]; }; @@ -454,6 +469,35 @@ in { # Remember to close this bracket at the end of the document enableNvidia = true; }; + snapraid = { + enable = true; + touchBeforeSync = true; + sync.interval = "02:00"; + scrub = { + plan = 10; + olderThan = 10; + interval = "4:00"; + }; + parityFiles = [ "/mnt/parity/snapraid.parity" ]; + extraConfig = '' + autosave 50 + ''; + exclude = [ + "/tmp/" + "/lost+found/" + "/multimedia/downloads/" + "/scrapping/nextcloud/" + ]; + dataDisks = { + d1 = "/mnt/disk1/"; + d2 = "/mnt/disk2/"; + }; + contentFiles = [ + "/var/snapraid.content" + "/mnt/disk1/snapraid.content" + "/mnt/disk2/snapraid.content" + ]; + }; programs = { mtr.enable = true; gnupg.agent = { @@ -470,11 +514,6 @@ in { # Remember to close this bracket at the end of the document services = { printing.enable = true; - emacs = { - enable = true; - defaultEditor = true; - package = pkgs.emacs; - }; fstrim.enable = true; btrfs.autoScrub = { enable = true; @@ -487,6 +526,29 @@ in { # Remember to close this bracket at the end of the document udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; }; + systemd.services = { + "docker-compose" = { + enable = true; + restartIfChanged = true; + description = "Start docker-compose servers"; + after = [ "docker.service" "docker.socket" ]; + requires = [ "docker.service" "docker.socket" ]; + wantedBy = [ "multi-user.target" ]; + environment = { + FILE = "/home/jawz/Development/Docker/docker-compose.yml"; + }; + path = [ pkgs.docker-compose ]; + serviceConfig = { + Restart = "on-failure"; + # Type = "simple"; + RestartSec = 30; + ExecStart = + "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} up --remove-orphans"; + ExecStop = "${pkgs.docker-compose}docker-compose -f \${FILE} down"; + }; + }; + }; + # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ]; # Or disable the firewall altogether. diff --git a/configuration.org b/configuration.org index f896692..f12db42 100755 --- a/configuration.org +++ b/configuration.org @@ -3,63 +3,52 @@ #+PROPERTY: header-args :tangle configuration.nix #+auto_tangle: t -* TODO [2/10] -- [X] Clean up configuration file -- [X] Merge current config -- [ ] System configurations [0/7] +* TODO [0/6] +- [ ] System configurations [0/8] - [ ] fail2ban - [ ] Bluetooth multiple devices + pass-through - - [ ] Automatic updates - [ ] SSH settings + - [ ] GNUPG keys + - [ ] Automatic updates - [ ] Automatic garbage collection - [ ] Firewall ports - [ ] Topgrade (perhaps unnecessary) -- [-] SystemD services [2/5] - - [ ] docker-compose - - [ ] snapraid +- [-] SystemD services [4/5] + - [X] docker-compose + - [X] snapraid - [X] FStrim - [X] BTRFS scrub - [ ] Personal scripts [0/3] - [ ] download - [ ] Instagram - [ ] startup tasks -- [ ] Migrate dotfiles [0/3] - - [ ] .config [0/3] - - [ ] celluloid [0/2] - - [ ] Make sure plugins work - - [ ] Declare plugins? - - [ ] Firefox [0/7] - https://ffprofile.com/#finish - - [ ] Extensions - - [ ] Settings - - [ ] Gnome integration - - [ ] Profile - - [ ] Bookmarks - - [ ] Extra security/privacy config - - [ ] gallery-dl integration - - [ ] - - [ ] .var - - [ ] .local/share [0/2] - - [ ] beets - - [ ] mpd -- [-] Migrate apps [1/4] - - [X] paru - - [ ] pipx - - [ ] pip IMPORTANT for beet +- [ ] dotfiles [0/4] + - [ ] create a declarative Firefox or Librewolf install + - [ ] migrate config to home-manager + - [ ] migrate share to home-manager + - [ ] migrate dconf to home-manager +- [-] Migrate apps [3/6] + - [-] paru + - [X] pipx + - [X] pip IMPORTANT for beet + - [ ] pnpm + - [X] fish - [ ] appimages -- [ ] Figure out how to get rid of xterm -- [ ] Compile missing apps [0/3] +- [-] Compile missing apps [1/8] + - [X] furtherance upgrade + - [ ] zap init + - [ ] font-downloader + - [ ] pokemon-colorscripts + - [ ] SaveDesktop (flathub) + - [ ] gelata + - [ ] pokeshell + - [ ] menulibre +- [ ] Misc [0/3] + - [ ] Figure out how to get rid of xterm - [ ] wine-discord-ipc-bridge https://github.com/fufexan/nix-gaming - [ ] make binaries of my own scripts https://github.com/asimpson/dotfiles/blob/899b45e1586aac04d4e5541d638bbbffc66b4bba/nixos/scripts.nix -- [ ] AdwCustomizer [0/1] - https://github.com/AdwCustomizerTeam/AdwCustomizer - - [ ] Figure out pip -- [ ] (optional) adw-gtk3 theme - https://github.com/lassekongo83/adw-gtk3#readme - I think it can be locally installed, no need for theme, but in case - https://github.com/NixOS/nixpkgs/blob/nixos-22.05/pkgs/data/themes/vertex/default.nix#L32 * ABOUT @@ -300,6 +289,7 @@ mypaint # not the best art program mypaint-brushes # but it's got some mypaint-brushes1 # nice damn brushes unstable.pureref # create inspiration/reference boards +unstable.gimp # the coolest bestest art program to never exist # Gaming lutris # game/emulator manager @@ -381,9 +371,15 @@ 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 +graphviz # graphs +# doom everywhere +xorg.xwininfo +xdotool # development environment -nix-direnv # nix implementation of direnv +nix-direnv # creates ephimeral environments +direnv # manages development environment +# editorconfig-checker # rules for contributing exercism # learn to code # SH @@ -392,6 +388,9 @@ bashdb # autocomplete shellcheck # linting shfmt # a shell parser and formatter nodePackages.bash-language-server # LSP support +file # required by my tasks script? +gnome.zenity # dependency of my scripts +xclip # manipulate clipboard from scripts # NIX nixfmt # linting @@ -408,8 +407,7 @@ omnisharp-roslyn # c# linter and code formatter # JS # jq # linting -# Node-js -# nodePackages.pnpm +nodejs # not as bad as I thought #+end_src *** GNOME EXTENSIONS @@ -465,6 +463,7 @@ symbola pylint # bug and style checker for python pytest # framework for writing tests speedtest-cli # check internet speed from the comand line + editorconfig # follow rules of contributin #+end_src ** FISH PLUGINS @@ -534,6 +533,7 @@ 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 +set command_timeout = 30 set GPG_TTY (tty) @@ -576,88 +576,70 @@ sudo nixos-rebuild switch -I nixos-config=$nix_file }; #+end_src -*** BAT +*** OTHER #+begin_src nix -programs.bat = { +programs = { + bat = { enable = true; config = { # map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ]; pager = "less -FR"; theme = "base16"; }; + }; + git = { + enable = true; + userName = "Danilo Reyes"; + userEmail = "CaptainJawZ@outlook.com"; + }; + gpg = { + enable = true; + homedir = "${config.xdg.dataHome}/gnupg"; + }; + htop = { + enable = true; + package = pkgs.htop-vim; + }; }; #+end_src -*** GIT - -#+begin_src nix -programs.git = { - enable = true; - userName = "Danilo Reyes"; - userEmail = "CaptainJawZ@outlook.com"; -}; -#+end_src - -*** GNUPG - -#+begin_src nix -programs.gpg = { - enable = true; - homedir = "${config.xdg.dataHome}/gnupg"; -}; -#+end_src - -*** HTOP - -#+begin_src nix -programs.htop = { - enable = true; - package = pkgs.htop-vim; -}; -xdg.configFile."htop/htoprc".source = ./dotfiles/htop/htoprc; -#+end_src - *** XDG #+begin_src nix xdg = { enable = true; -}; -xdg.userDirs = { - enable = true; - # createDirectories = true; - desktop = "${config.home.homeDirectory}"; - documents = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Music"; - pictures = "${config.home.homeDirectory}/Pictures"; - # publicShare = "${config.home.homeDirectory}/.local/hd/Public"; - templates = "${config.home.homeDirectory}/.local/share/Templates"; - videos = "${config.home.homeDirectory}/Videos"; -}; -#+end_src - -*** OTHER - -#+begin_src nix -xdg.configFile = { - "wgetrc".source = ./dotfiles/wget/wgetrc; - "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; + userDirs = { + enable = true; + # createDirectories = true; + desktop = "${config.home.homeDirectory}"; + documents = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Music"; + pictures = "${config.home.homeDirectory}/Pictures"; + # publicShare = "${config.home.homeDirectory}/.local/hd/Public"; + templates = "${config.home.homeDirectory}/.local/share/Templates"; + videos = "${config.home.homeDirectory}/Videos"; + }; + configFile = { + "wgetrc".source = ./dotfiles/wget/wgetrc; + "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; + "htop/htoprc".source = ./dotfiles/htop/htoprc; + }; }; #+end_src ** USER-SERVICES -*** MPD EXTENSIONS #+begin_src nix -# services.mpd-discord-rpc.enable = true; -# services.mpdris2 = { -# enable = true; -# multimediaKeys = true; -# mpd.host = "localhost"; -# }; +services = { + emacs = { + enable = true; + defaultEditor = true; + package = pkgs.emacs; + }; +}; #+end_src ** CLOSING HOME-MANAGER @@ -673,14 +655,15 @@ may be challenging. #+begin_src nix environment.systemPackages = with pkgs; [ wget - docker-compose + neovim + docker-compose # easy way to migrate my docker anywhere! ]; #+end_src * ENVIRONMENT VARIABLES #+begin_src nix -environment.sessionVariables = rec { +environment.variables = rec { # PATH XDG_CACHE_HOME = "\${HOME}/.cache"; XDG_CONFIG_HOME = "\${HOME}/.config"; @@ -712,8 +695,7 @@ environment.sessionVariables = rec { CUDA_CACHE_PATH = "\${XDG_CACHE_HOME}/nv"; # GBM_BACKEND = "nvidia-drm"; # "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; - # FISH - fisher_path = "\${XDG_CONFIG_HOME}/fish/fisher"; + # Themes # GTK_THEME = "Adwaita:light"; # QT_QPA_PLATFORMTHEME = "adwaita-dark"; @@ -725,7 +707,7 @@ environment.sessionVariables = rec { "\${XDG_CONFIG_HOME}/emacs/bin" "\${XDG_DATA_HOME}/npm/bin" "\${PNPM_HOME}" - # "\${SCRIPTS}" + "\${SCRIPTS}" ]; }; #+end_src @@ -746,6 +728,37 @@ virtualisation.docker = { Some programs need SUID wrappers. #+begin_src nix +snapraid = { + enable = true; + touchBeforeSync = true; + sync.interval = "02:00"; + scrub = { + plan = 10; + olderThan = 10; + interval = "4:00"; + }; + parityFiles = [ + "/mnt/parity/snapraid.parity" + ]; + extraConfig = '' + autosave 50 + ''; + exclude = [ + "/tmp/" + "/lost+found/" + "/multimedia/downloads/" + "/scrapping/nextcloud/" + ]; + dataDisks = { + d1 = "/mnt/disk1/"; + d2 = "/mnt/disk2/"; + }; + contentFiles = [ + "/var/snapraid.content" + "/mnt/disk1/snapraid.content" + "/mnt/disk2/snapraid.content" + ]; +}; programs = { mtr.enable = true; gnupg.agent = { @@ -764,11 +777,6 @@ programs = { services = { printing.enable = true; - emacs = { - enable = true; - defaultEditor = true; - package = pkgs.emacs; - }; fstrim.enable = true; btrfs.autoScrub = { enable = true; @@ -786,6 +794,36 @@ services = { }; #+end_src +* SYSTEMD +Home-manager, is not as flushed out when it comes to creating systemd units, so +the best way to define them for now, is using nix. + +#+begin_src nix +systemd.services = { + "docker-compose" = { + enable = true; + restartIfChanged = true; + description = "Start docker-compose servers"; + after = [ "docker.service" "docker.socket" ]; + requires = [ "docker.service" "docker.socket" ]; + wantedBy = [ "multi-user.target" ]; + environment = { + FILE = "/home/jawz/Development/Docker/docker-compose.yml"; + }; + path = [ + pkgs.docker-compose + ]; + serviceConfig = { + Restart = "on-failure"; + # Type = "simple"; + RestartSec = 30; + ExecStart = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} up --remove-orphans"; + ExecStop = "${pkgs.docker-compose}docker-compose -f \${FILE} down"; + }; + }; +}; +#+end_src + * FIREWALL Open ports in the firewall. =TIP= list what app a port belongs to in a table. diff --git a/hardware-configuration.nix b/hardware-configuration.nix index cd38a30..2730ace 100755 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -4,7 +4,7 @@ { config, lib, pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot = { - plymouth = { enable = true; }; + #plymouth = { enable = true; }; loader = { efi = { canTouchEfiVariables = true; @@ -37,6 +37,7 @@ }; }; kernelModules = [ "kvm-intel" ]; + kernel.sysctl = { "vm.swappiness" = 90; }; extraModulePackages = [ ]; initrd = { availableKernelModules =