diff options
| -rw-r--r-- | flake.lock | 156 | ||||
| -rw-r--r-- | flake.nix | 5 | ||||
| -rw-r--r-- | share/cfg/emacs.nix | 2 | ||||
| -rw-r--r-- | share/overlay.nix | 19 | ||||
| -rw-r--r-- | share/system/client-common.nix | 10 | ||||
| -rw-r--r-- | share/xpkgs/emacs/default.nix | 12 | ||||
| -rw-r--r-- | share/xpkgs/emacs/emacs.el | 127 |
7 files changed, 165 insertions, 166 deletions
@@ -49,11 +49,34 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1726076326, - "narHash": "sha256-yilQd6wvHDcNFlGJqmKCRCRO/qd8qQCIrDXiKtRewNU=", + "lastModified": 1726454673, + "narHash": "sha256-cvgXPCeiDIDrEE8VijX5uZ2GAOHldOJXuKOb95goxUo=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "ba0b7636b47b5423ec09f89bcba06aadb68a607d", + "rev": "3723f9e35635612c470db1b0aea08d9ff22b39ec", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, + "emacs-overlay_2": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "sorrepkgs", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_4" + }, + "locked": { + "lastModified": 1726161281, + "narHash": "sha256-eJOLqzu1Am7DY7OOQ/J5USvtZjbjkMlLiytdM3qlyoQ=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "f587d92456e827b660a308a0dd632d3f6378f8cb", "type": "github" }, "original": { @@ -114,6 +137,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "futils": { "inputs": { "systems": "systems_2" @@ -132,6 +173,24 @@ "url": "https://git.sorre.xyz/miranb/futils" } }, + "futils_2": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1722472559, + "narHash": "sha256-HqzEdURUwgCNDpopDC38NbChC0cOyj1L47EP+1aco8k=", + "ref": "refs/heads/main", + "rev": "aaa51589dd772073c6eb48d6b7bd51dc8be3b455", + "revCount": 4, + "type": "git", + "url": "https://git.sorre.xyz/miranb/futils" + }, + "original": { + "type": "git", + "url": "https://git.sorre.xyz/miranb/futils" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -287,11 +346,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1725930920, - "narHash": "sha256-RVhD9hnlTT2nJzPHlAqrWqCkA7T6CYrP41IoVRkciZM=", + "lastModified": 1726320982, + "narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "44a71ff39c182edaf25a7ace5c9454e7cba2c658", + "rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", "type": "github" }, "original": { @@ -333,6 +392,22 @@ "type": "github" } }, + "nixpkgs-stable_4": { + "locked": { + "lastModified": 1725930920, + "narHash": "sha256-RVhD9hnlTT2nJzPHlAqrWqCkA7T6CYrP41IoVRkciZM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "44a71ff39c182edaf25a7ace5c9454e7cba2c658", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nmd": { "flake": false, "locked": { @@ -403,6 +478,21 @@ "type": "gitlab" } }, + "nur": { + "locked": { + "lastModified": 1726473313, + "narHash": "sha256-PkgA+fU2+HQ7JWo6b3vkFkMyeeX6tLt51o7gfqXy6r8=", + "owner": "nix-community", + "repo": "nur", + "rev": "589a10a7b8c8e3b33fc67dbdfb79bd4d4d90697d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nur", + "type": "github" + } + }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": "flake-compat", @@ -436,10 +526,12 @@ "home-manager": "home-manager", "nix-on-droid": "nix-on-droid", "nixpkgs": "nixpkgs", + "nur": "nur", "rust-overlay": "rust-overlay", "snippets-ls": "snippets-ls", "sops-nix": "sops-nix", "sorre-website": "sorre-website", + "sorrepkgs": "sorrepkgs", "treefmt-nix": "treefmt-nix_2" } }, @@ -544,6 +636,28 @@ "url": "https://git.sorre.xyz/miranb/sorre-website.git" } }, + "sorrepkgs": { + "inputs": { + "emacs-overlay": "emacs-overlay_2", + "futils": "futils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726302080, + "narHash": "sha256-BRp2Rz1ZpJb+MDj5uu1bblI2xfR3um3TMMTA6f8Jj4s=", + "ref": "refs/heads/main", + "rev": "15a14c10068e815cb44e38e0f69ba661cbc01ac3", + "revCount": 4, + "type": "git", + "url": "https://git.sorre.xyz/miranb/xpkgs" + }, + "original": { + "type": "git", + "url": "https://git.sorre.xyz/miranb/xpkgs" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -574,6 +688,36 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -41,6 +41,11 @@ url = "github:nix-community/emacs-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; + nur.url = "github:nix-community/nur"; + sorrepkgs = { + url = "git+https://git.sorre.xyz/miranb/xpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # development stuff treefmt-nix = { diff --git a/share/cfg/emacs.nix b/share/cfg/emacs.nix index 5e329f8..d0d3e38 100644 --- a/share/cfg/emacs.nix +++ b/share/cfg/emacs.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { services.emacs = { - package = pkgs.sorremacs; + package = pkgs.nur.repos.sorre.sorremacs; client.enable = true; startWithUserSession = true; }; diff --git a/share/overlay.nix b/share/overlay.nix deleted file mode 100644 index 00dc6a5..0000000 --- a/share/overlay.nix +++ /dev/null @@ -1,19 +0,0 @@ -final: prev: -let - writeShellScriptBinAndSymlink = - name: text: - prev.symlinkJoin { - name = name; - paths = [ - prev."${name}" - (prev.writeShellScriptBin name text) - ]; - }; -in -{ - wget = writeShellScriptBinAndSymlink "wget" '' - wget --hsts-file="$XDG_DATA_HOME/wget-hsts" - ''; - - sorremacs = prev.callPackage ./xpkgs/emacs { }; -} diff --git a/share/system/client-common.nix b/share/system/client-common.nix index 2a49d42..c598d94 100644 --- a/share/system/client-common.nix +++ b/share/system/client-common.nix @@ -13,7 +13,15 @@ overlays = [ inputs.rust-overlay.overlays.default inputs.emacs-overlay.overlays.default - (import ../overlay.nix) + (final: prev: { + nur = import inputs.nur { + nurpkgs = prev; + pkgs = prev; + repoOverrides = { + sorre = import inputs.sorrepkgs { pkgs = prev; }; + }; + }; + }) ]; config = { allowUnfree = true; diff --git a/share/xpkgs/emacs/default.nix b/share/xpkgs/emacs/default.nix deleted file mode 100644 index eea70f5..0000000 --- a/share/xpkgs/emacs/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ emacsWithPackagesFromUsePackage, ... }: -emacsWithPackagesFromUsePackage { - config = ./emacs.el; - defaultInitFile = true; - alwaysEnsure = true; - alwaysTangle = true; - - # Optionally provide extra packages not in the configuration file. - extraEmacsPackages = epkgs: [ - epkgs.cask - ]; -} diff --git a/share/xpkgs/emacs/emacs.el b/share/xpkgs/emacs/emacs.el deleted file mode 100644 index 383a76a..0000000 --- a/share/xpkgs/emacs/emacs.el +++ /dev/null @@ -1,127 +0,0 @@ -;; -*- coding: utf-8 -*- - -;;; For performance -(setq gc-cons-threshold 100000000) -(setq read-process-output-max (* 1024 1024)) ;; 1mb - -(add-hook 'after-init-hook #'(lambda () - ;; restore after startup - (setq gc-cons-threshold 800000))) - -;;; Disable menu-bar, tool-bar, and scroll-bar. -(if (fboundp 'menu-bar-mode) - (menu-bar-mode -1)) -(if (fboundp 'tool-bar-mode) - (tool-bar-mode -1)) -(if (fboundp 'scroll-bar-mode) - (scroll-bar-mode -1)) - -;;; Fix this bug: -;;; https://www.reddit.com/r/emacs/comments/cueoug/the_failed_to_download_gnu_archive_is_a_pretty/ -(when (version< emacs-version "26.3") - (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) - -(setq-default cursor-type 'bar) ; Line-style cursor similar to other text editors -(setq inhibit-startup-screen t) ; Disable startup screen -(setq initial-scratch-message "") ; Make *scratch* buffer blank -(setq-default frame-title-format '("%b")) ; Make window title the buffer name -(setq ring-bell-function 'ignore) ; Disable bell sound -(fset 'yes-or-no-p 'y-or-n-p) ; y-or-n-p makes answering questions faster -(show-paren-mode 1) ; Show closing parens by default -(setq linum-format "%4d ") ; Line number format -(delete-selection-mode 1) ; Selected text will be overwritten when you start typing -(global-auto-revert-mode t) ; Auto-update buffer if file has changed on disk - -;; Show line numbers in programming modes -(add-hook 'prog-mode-hook - (if (or - ; If linum-mode doesn't exist... - (not (fboundp 'linum-mode)) - ; ...or Emacs has display-line-numbers-mode capability - (and (fboundp 'display-line-numbers-mode) (display-graphic-p))) - ; ...then use display-line-numbers-mode! - 'display-line-numbers-mode - ; Otherwise, use linum-mode - 'linum-mode)) - -(global-display-line-numbers-mode) - -;; Define the whitespace style. -(setq-default whitespace-style - '(face spaces tabs newline space-mark tab-mark newline-mark)) - -(setq-default whitespace-display-mappings - ;; all numbers are unicode codepoint in decimal - '( - ;; 32 is SPACE, 183 is MIDDLE DOT · - (space-mark 32 [183]) - ;; 10 is LINE FEED, 182 isPILCROW SIGN ¶ - (newline-mark 10 [182 10]) - ;; 9 is tab, 182 isPILCROW SIGN ¶ - (tab-mark 9 [9655 9]))) - -;; Set whitespace actions. -(setq-default whitespace-action - '(cleanup auto-cleanup)) - -;;; Put Emacs auto-save and backup files to /tmp/ or C:/Temp/ -(defconst emacs-tmp-dir (expand-file-name (format "emacs%d" (user-uid)) temporary-file-directory)) -(setq - backup-by-copying t ; Avoid symlinks - delete-old-versions t - kept-new-versions 6 - kept-old-versions 2 - version-control t - auto-save-list-file-prefix emacs-tmp-dir - auto-save-file-name-transforms `((".*" ,emacs-tmp-dir t)) ; Change autosave dir to tmp - backup-directory-alist `((".*" . ,emacs-tmp-dir))) - -;;; Lockfiles unfortunately cause more pain than benefit -(setq create-lockfiles nil) - -;;; Load wheatgrass as the default theme if one is not loaded already - -(if (not custom-enabled-themes) - (load-theme 'wheatgrass t)) - -(defun reload-config () - (interactive) - (load-file (expand-file-name "init.el" user-emacs-directory))) - -;; Make a single ESC quit the current action -(global-set-key (kbd "<escape>") 'keyboard-escape-quit) - -;; Autopairs -(add-hook 'prog-mode-hook - (lambda () - (electric-pair-mode 1))) - -;; Org mode config -(setq-default org-startup-indented t) - -;; Emacs lisp mode config -(add-hook 'emacs-lisp-mode-hook - (lambda () - ;; Use spaces, not tabs - (setq indent-tabs-mode nil))) - -;; Theme -(use-package doom-themes - :config - (setq doom-themes-enable-bold t - doom-themes enable-italic t) - (load-theme 'doom-one t) - - ;; Enable flashing mode-line on errors - (doom-themes-visual-bell-config) - ;; Corrects (and improves) org-mode's native fontification. - (doom-themes-org-config)) - -;; Which key mode because I'm forgetful -(use-package which-key - :config - (which-key-mode)) - -;;; --- Various major modes --- ;;; -(use-package nix-mode - :mode "\\.nix\\'") |
