From 5252a653bbe0f7746c683146fd0e2a6661cc0aec Mon Sep 17 00:00:00 2001 From: Tristan Druyen Date: Fri, 10 Nov 2023 02:16:34 +0100 Subject: [PATCH] WIP #5 - add git lfs - add inlay lsp hints in rust - add xmr to nixos-desk - add ssd swap partition to nixos-desk - add llama-cpp.el --- ext/doom/config.el | 26 ++++++++++++++++++++++++++ ext/doom/packages.el | 29 ++++++++++++++++------------- flake.lock | 24 ++++++++++++------------ home-mods/shell/default.nix | 15 ++++++++++++++- os-mods/xmr/default.nix | 17 +++++++++++++++++ systems/nixos-desk/default.nix | 11 +---------- systems/nixos-desk/disko.nix | 21 ++++++++++----------- 7 files changed, 96 insertions(+), 47 deletions(-) create mode 100644 os-mods/xmr/default.nix diff --git a/ext/doom/config.el b/ext/doom/config.el index f6c1319..d02abee 100644 --- a/ext/doom/config.el +++ b/ext/doom/config.el @@ -89,6 +89,32 @@ ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how ;; they are implemented. +;; rust +(setq! lsp-inlay-hint-enable t) +(setq! lsp-rust-analyzer-cargo-run-build-scripts t) +(setq! lsp-rust-analyzer-proc-macro-enable t) +(setq! lsp-rust-analyzer-server-display-inlay-hints t) +(setq! lsp-rust-analyzer-completion-auto-import-enable t) + +;; llama.cpp + +(use-package llama-cpp + :ensure t) + +(setq! llama-cpp-chat-prompt "### System Prompt +You are an intelligent programming assistant." + llama-cpp-chat-input-prefix " + +### User Message +" + llama-cpp-chat-input-suffix " + +### Assistant +") + +;;(use-package llama-cpp-code) +;; (use-package llama-cpp-chat) + ;; Nix (use-package! nixpkgs-fmt diff --git a/ext/doom/packages.el b/ext/doom/packages.el index df7cc58..519ef32 100644 --- a/ext/doom/packages.el +++ b/ext/doom/packages.el @@ -7,38 +7,41 @@ ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: -;(package! some-package) +;;(package! some-package) ;; To install a package directly from a remote git repo, you must specify a ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: ;; https://github.com/radian-software/straight.el#the-recipe-format -;(package! another-package -; :recipe (:host github :repo "username/repo")) +;;(package! another-package +;; :recipe (:host github :repo "username/repo")) ;; If the package you are trying to install does not contain a PACKAGENAME.el ;; file, or is located in a subdirectory of the repo, you'll need to specify ;; `:files' in the `:recipe': -;(package! this-package -; :recipe (:host github :repo "username/repo" -; :files ("some-file.el" "src/lisp/*.el"))) +;;(package! this-package +;; :recipe (:host github :repo "username/repo" +;; :files ("some-file.el" "src/lisp/*.el"))) ;; If you'd like to disable a package included with Doom, you can do so here ;; with the `:disable' property: -;(package! builtin-package :disable t) +;;(package! builtin-package :disable t) ;; You can override the recipe of a built in package without having to specify ;; all the properties for `:recipe'. These will inherit the rest of its recipe ;; from Doom or MELPA/ELPA/Emacsmirror: -;(package! builtin-package :recipe (:nonrecursive t)) -;(package! builtin-package-2 :recipe (:repo "myfork/package")) +;;(package! builtin-package :recipe (:nonrecursive t)) +;;(package! builtin-package-2 :recipe (:repo "myfork/package")) ;; Specify a `:branch' to install a package from a particular branch or tag. ;; This is required for some packages whose default branch isn't 'master' (which ;; our package manager can't deal with; see radian-software/straight.el#279) -;(package! builtin-package :recipe (:branch "develop")) +;;(package! builtin-package :recipe (:branch "develop")) ;; Use `:pin' to specify a particular commit to install. +;; llama.cpp +(package! llama-cpp) + ;; tabs (package! centaur-tabs) @@ -51,8 +54,8 @@ ;; Doom's packages are pinned to a specific commit and updated from release to ;; release. The `unpin!' macro allows you to unpin single packages... -;(unpin! pinned-package) +;;(unpin! pinned-package) ;; ...or multiple packages -;(unpin! pinned-package another-pinned-package) +;;(unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) -;(unpin! t) +;;(unpin! t) diff --git a/flake.lock b/flake.lock index 808a29a..a488887 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1699099781, - "narHash": "sha256-2WAs839yL6xmIPBLNVwbft46BDh0/RAjq1bAKNRqeR4=", + "lastModified": 1699734195, + "narHash": "sha256-T7Q2ke4LJx16wos828YMqKnCCK3kxey0PdqH+LxVMV8=", "owner": "nix-community", "repo": "disko", - "rev": "548962c50b8afad7b8c820c1d6e21dc8394d6e65", + "rev": "89fd5b51f0725f9775ca9999d53a0a3e5d936490", "type": "github" }, "original": { @@ -31,11 +31,11 @@ ] }, "locked": { - "lastModified": 1699436319, - "narHash": "sha256-gRYGKnYfXE1dugjGJ0Xx5P3x3BOT505gxEFxDBohSiM=", + "lastModified": 1699724244, + "narHash": "sha256-I3+cOlXU4jIoqnyYWezbNc26/56EI4YwwDQf80hdbeI=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "dc09405b5f031852d3e930b1fa91e973b5206ef8", + "rev": "c5f0c468f8e92246473c1eabe997ad1c41fb6a1a", "type": "github" }, "original": { @@ -296,11 +296,11 @@ }, "nur": { "locked": { - "lastModified": 1699450798, - "narHash": "sha256-kNunBwAmToJjX+7aMwO/W9U2ZMw6ym9H9XIJgrfvjUY=", + "lastModified": 1699730859, + "narHash": "sha256-B4NwfVftZRH9W53XJQ4BCPbAl3F/yyBJwn4qJLHAIIk=", "owner": "nix-community", "repo": "NUR", - "rev": "3cfab74a8aafa5b6229f47582cc9d9b22085a577", + "rev": "473af602cdfaf46f0a0d0b06e7678622f623f006", "type": "github" }, "original": { @@ -319,11 +319,11 @@ ] }, "locked": { - "lastModified": 1690827734, - "narHash": "sha256-zcNLTSKGZ5zcx0RQkDKH4dN2MBx+KTfrYN7HfmD0N7c=", + "lastModified": 1699638264, + "narHash": "sha256-EGT10Ig8OFUY5T0nwnNuLa4z++yjaqfSQT/5Tyo1Z60=", "owner": "pjones", "repo": "plasma-manager", - "rev": "b6241a2f7c625d0b0bee8e203d78232d0a6535e9", + "rev": "56c325e68d69b9682bcb1be99650b6c28bedb93d", "type": "github" }, "original": { diff --git a/home-mods/shell/default.nix b/home-mods/shell/default.nix index 22f6434..2b48a39 100644 --- a/home-mods/shell/default.nix +++ b/home-mods/shell/default.nix @@ -59,12 +59,26 @@ in ecr = "emacsclient -r $argv"; ecrr = "emacsclient -r $argv"; }; + plugins = [ + { + name = "sponge"; + src = pkgs.fetchFromGitHub { + owner = "meaningful-ooo"; + repo = "sponge"; + rev = "384299545104d5256648cee9d8b117aaa9a6d7be"; + sha256 = "31d71950346d349762ca8da5f68e666bb9c05fce311096c616101584af999b5c"; + }; + } + ]; }; git = { enable = true; userName = "Tristan Druyen"; userEmail = "tristan@vault81.de"; + lfs = { + enable = true; + }; aliases = { ci = "commit"; co = "checkout"; @@ -200,7 +214,6 @@ in wget wl-clipboard zstd - ]; }; } diff --git a/os-mods/xmr/default.nix b/os-mods/xmr/default.nix new file mode 100644 index 0000000..c5fca42 --- /dev/null +++ b/os-mods/xmr/default.nix @@ -0,0 +1,17 @@ +{ config +, lib +, pkgs +, system +, inputs +, ... +}: { + services.monero = { + enable = true; + dataDir = "/media/SanDisk/monero"; # TODO make config option for this and set sensible default + limits.upload = 1024; + }; + environment.systemPackages = with pkgs; [ + monero-gui + monero-cli + ]; +} diff --git a/systems/nixos-desk/default.nix b/systems/nixos-desk/default.nix index 91d8c7b..c74c04e 100644 --- a/systems/nixos-desk/default.nix +++ b/systems/nixos-desk/default.nix @@ -13,21 +13,12 @@ ../../os-mods/desktop ../../os-mods/network ../../os-mods/virt + ../../os-mods/xmr ../../users ./disko.nix ]; system.stateVersion = "23.05"; - # Monero ######### - services.monero.enable = true; - services.monero.dataDir = "/media/SanDisk/monero"; - services.monero.limits.upload = 1024; - environment.systemPackages = with pkgs; [ - monero-gui - monero-cli - ]; - ################### - boot = { kernelPackages = pkgs.linuxPackages_zen; loader = { diff --git a/systems/nixos-desk/disko.nix b/systems/nixos-desk/disko.nix index 7384dcd..01eba26 100644 --- a/systems/nixos-desk/disko.nix +++ b/systems/nixos-desk/disko.nix @@ -23,17 +23,16 @@ }; luksSwap = { size = "32G"; - # TODO Create - # content = { - # type = "luks"; - # name = "cryptswap_0"; - # extraOpenArgs = [ "--allow-discards" ]; - # passwordFile = "/tmp/secret.key"; - # additionalKeyFiles = [ ]; - # content = { - # type = "swap"; - # }; - # }; + content = { + type = "luks"; + name = "cryptswap_1"; + extraOpenArgs = [ "--allow-discards" ]; + passwordFile = "/tmp/secret.key"; + additionalKeyFiles = [ ]; + content = { + type = "swap"; + }; + }; }; }; };