From 4bcb766dec68cd7ce4234d89ccec700b7a5f377a Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sun, 28 Apr 2024 11:24:47 -0600 Subject: [PATCH] modules updates --- base.nix | 9 +++++-- home-manager/default.nix | 24 +++++++------------ hosts/workstation/configuration.nix | 25 ++++++++++++-------- hosts/workstation/hardware-configuration.nix | 5 ++++ modules/apps/gaming.nix | 8 +++++-- modules/apps/multimedia.nix | 4 +++- modules/apps/office.nix | 11 ++++++--- modules/dev.nix | 7 +++--- modules/emacs.nix | 24 +++++++++++++++++++ modules/shell.nix | 12 ++++++++++ modules/shell/exercism.nix | 11 +++++++++ 11 files changed, 102 insertions(+), 38 deletions(-) create mode 100644 modules/emacs.nix create mode 100644 modules/shell.nix create mode 100644 modules/shell/exercism.nix diff --git a/base.nix b/base.nix index 2f3f9fe..a0bcbd6 100644 --- a/base.nix +++ b/base.nix @@ -1,6 +1,11 @@ { config, lib, pkgs, options, ... }: { - imports = - [ ./modules/apps.nix ./modules/dev.nix ./modules/services.nix ./jawz.nix ]; + imports = [ + ./modules/apps.nix + ./modules/dev.nix + ./modules/shell.nix + ./modules/services.nix + ./jawz.nix + ]; system = { copySystemConfiguration = true; stateVersion = "23.11"; diff --git a/home-manager/default.nix b/home-manager/default.nix index 07813e0..c4ecdaf 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -10,11 +10,10 @@ in { useGlobalPkgs = true; users.jawz = { config, pkgs, ... }: { home.stateVersion = version; - programs.bash = { enable = true; historyFile = "\${XDG_STATE_HOME}/bash/history"; - historyControl = [ "erasedups" "ignorespace" ]; + historyControl = [ "erasedups" "ignorespace" "ignoredups" ]; shellAliases = { hh = "hstr"; ls = "eza --icons --group-directories-first"; @@ -63,8 +62,8 @@ in { nixos-reload () { NIXOSDIR=/home/jawz/Development/NixOS - nix-store --add-fixed sha256 \ - $NIXOSDIR/PureRef-1.11.1_x64.Appimage + # nix-store --add-fixed sha256 \ + # $NIXOSDIR/PureRef-1.11.1_x64.Appimage fd --full-path $NIXOSDIR -e nix -x nixfmt \; sudo unbuffer nixos-rebuild switch -I \ nixos-config="$NIXOSDIR/hosts/$HOSTNAME/configuration.nix" \ @@ -96,9 +95,12 @@ in { }; }; programs = { - emacs.enable = true; helix = { enable = true; }; hstr.enable = true; + zoxide = { + enable = true; + enableBashIntegration = true; + }; direnv = { enable = true; enableBashIntegration = true; @@ -129,17 +131,7 @@ in { package = pkgs.htop-vim; }; }; - services = { - lorri.enable = true; - emacs = { - enable = true; - defaultEditor = true; - package = with pkgs; - ((emacsPackagesFor emacs-gtk).emacsWithPackages - (epkgs: [ epkgs.vterm ])); - startWithUserSession = "graphical"; - }; - }; + services = { lorri.enable = true; }; }; }; } diff --git a/hosts/workstation/configuration.nix b/hosts/workstation/configuration.nix index 519dca2..68e2fdb 100644 --- a/hosts/workstation/configuration.nix +++ b/hosts/workstation/configuration.nix @@ -14,6 +14,7 @@ in { # ../../services/systemd-user/tasks.nix ]; my = { + emacs.enable = true; apps = { art.enable = true; dictionaries.enable = true; @@ -29,6 +30,7 @@ in { python.enable = true; gameDev.enable = true; }; + shell = { exercism.enable = true; }; services = { network.enable = true; nvidia.enable = true; @@ -98,6 +100,7 @@ in { packages = (with pkgs; [ obs-studio # screen recorder & streamer pitivi # video editor + gocryptfs # encrypted filesystem! shhh!!! # celeste # sync tool for any cloud provider # czkawka # duplicate finder @@ -107,21 +110,21 @@ in { pika-backup # backups gnome-obfuscate # censor private information - unstable.yt-dlp # downloads videos from most video websites - gallery-dl # similar to yt-dlp but for most image gallery websites - (ripgrep.override { withPCRE2 = true; }) # modern grep du-dust # rusty du similar to gdu eza # like ls but with colors fd # modern find, faster searches - ffmpeg_5-full # not ffmpreg, the coolest video conversion tool! + ffmpeg # not ffmpreg, the coolest video conversion tool! fzf # fuzzy finder! super cool and useful + gallery-dl # similar to yt-dlp but for most image gallery websites gdu # disk-space utility checker, somewhat useful - gocryptfs # encrypted filesystem! shhh!!! imagemagick # photoshop what?? rmlint # probably my favourite app, amazing dupe finder that integrates well with BTRFS - torrenttools # create torrent files from the terminal! + tldr # man for retards trash-cli # oop! did not meant to delete that + yt-dlp # downloads videos from most video websites + + torrenttools # create torrent files from the terminal! vcsi # video thumbnails for torrents, can I replace it with ^? (writeScriptBin "tasks" (builtins.readFile ../../scripts/tasks.sh)) @@ -145,11 +148,7 @@ in { xdotool xclip - tldr # man for retards - exercism # learn to code - # SH - bats # testing system, required by Exercism bashdb # autocomplete shellcheck # linting shfmt # a shell parser and formatter @@ -214,6 +213,12 @@ in { package = pkgs.gnomeExtensions.gsconnect; }; + # programs.nh = { + # enable = true; + # clean.enable = true; + # clean.extraArgs = "--keep-since 4d --keep 3"; + # }; + services.resilio = { deviceName = "chichis"; enable = true; diff --git a/hosts/workstation/hardware-configuration.nix b/hosts/workstation/hardware-configuration.nix index fa90a25..c8c510e 100644 --- a/hosts/workstation/hardware-configuration.nix +++ b/hosts/workstation/hardware-configuration.nix @@ -58,6 +58,11 @@ }; fileSystems = let + nfsMount = nfsDisk: { + device = "server:/${nfsDisk}"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ]; + }; btrfsMount = subvol: { device = "/dev/mapper/nvme"; fsType = "btrfs"; diff --git a/modules/apps/gaming.nix b/modules/apps/gaming.nix index e0facd7..3e0093e 100644 --- a/modules/apps/gaming.nix +++ b/modules/apps/gaming.nix @@ -1,6 +1,10 @@ { config, lib, pkgs, ... }: - -{ +let + unstable = import + (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { + config = config.nixpkgs.config; + }; +in { options.my.apps.gaming.enable = lib.mkEnableOption "enable"; config = lib.mkIf config.my.apps.gaming.enable { programs.steam = { diff --git a/modules/apps/multimedia.nix b/modules/apps/multimedia.nix index 20f3aed..ef7d97f 100644 --- a/modules/apps/multimedia.nix +++ b/modules/apps/multimedia.nix @@ -10,7 +10,9 @@ celluloid # video player curtail # image compressor easyeffects # equalizer - handbrake # video converter, may be unnecessary + # (handbrake.override { + # useGtk = true; + # }) # video converter, may be unnecessary identity # compare images or videos mousai # poor man shazam shortwave # listen to world radio diff --git a/modules/apps/office.nix b/modules/apps/office.nix index e3c3aa1..19efe90 100644 --- a/modules/apps/office.nix +++ b/modules/apps/office.nix @@ -1,6 +1,10 @@ -{ config, lib, pkgs, unstable, ... }: - -{ +{ config, lib, pkgs, ... }: +let + unstable = import + (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { + config = config.nixpkgs.config; + }; +in { options.my.apps.office.enable = lib.mkEnableOption "enable"; config = lib.mkIf config.my.apps.office.enable { users.users.jawz.packages = with pkgs; ([ @@ -8,6 +12,7 @@ calibre # ugly af eBook library manager newsflash # feed reader, syncs with nextcloud furtherance # I packaged this one tehee track time utility + unstable.planify # let's pretend I will organize my tasks # foliate # gtk eBook reader # wike # gtk wikipedia wow! # denaro # manage your finances diff --git a/modules/dev.nix b/modules/dev.nix index 7aac528..e8a7365 100644 --- a/modules/dev.nix +++ b/modules/dev.nix @@ -1,7 +1,6 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ ./dev/haskell.nix ./dev/nix.nix ./dev/python.nix ]; +{ config, lib, pkgs, ... }: { + imports = [ ./dev/haskell.nix ./dev/nix.nix ./dev/python.nix ./emacs.nix ]; + my.emacs.enable = lib.mkDefault false; my.dev = { haskell.enable = lib.mkDefault false; nix.enable = lib.mkDefault false; diff --git a/modules/emacs.nix b/modules/emacs.nix new file mode 100644 index 0000000..8d3bd69 --- /dev/null +++ b/modules/emacs.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, unstable, ... }: { + options.my.emacs.enable = lib.mkEnableOption "enable"; + config = lib.mkIf config.my.emacs.enable { + users.users.jawz.packages = with pkgs; ([ + fd # modern find, faster searches + (ripgrep.override { withPCRE2 = true; }) # modern grep + ]); + services.emacs = { + enable = true; + package = with pkgs; + ((emacsPackagesFor emacs-gtk).emacsWithPackages + (epkgs: with epkgs; ([ vterm ]))); + defaultEditor = true; + }; + home-manager.users.jawz.programs.bash.initExtra = '' + emacs-sqlite-fix () { + nix-shell -p cmake sqlite --command "doom sync && + sc restart emacs && + emacsclient -e '(org-roam-db-sync)'" && + doom sync + } + ''; + }; +} diff --git a/modules/shell.nix b/modules/shell.nix new file mode 100644 index 0000000..01201f5 --- /dev/null +++ b/modules/shell.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ ./shell/exercism.nix ./dev/python.nix ./dev/haskell.nix ]; + my = { + shell = { exercism.enable = lib.mkDefault false; }; + dev = { + haskell.enable = lib.mkDefault false; + python.enable = lib.mkDefault false; + }; + }; +} diff --git a/modules/shell/exercism.nix b/modules/shell/exercism.nix new file mode 100644 index 0000000..4c9b0d3 --- /dev/null +++ b/modules/shell/exercism.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, unstable, ... }: + +{ + options.my.shell.exercism.enable = lib.mkEnableOption "enable"; + config = lib.mkIf config.my.shell.exercism.enable { + users.users.jawz.packages = with pkgs; ([ + exercism # learn to code + bats # testing system, required by Exercism + ]); + }; +}