From a238dac0ea4734568cf3d9538687d9c99947ce7d Mon Sep 17 00:00:00 2001 From: lucy Date: Mon, 31 Aug 2026 13:41:54 +0200 Subject: [PATCH] add hm --- flake.nix | 15 ++- modules/home.nix | 13 +++ modules/hosts/nerv/#theme.nix# | 23 +++++ modules/hosts/nerv/.#theme.nix | 1 + modules/hosts/nerv/theme.nix | 7 ++ modules/programs/emacs/emacs.nix | 163 +++++++++++++++++-------------- modules/theme.nix | 9 +- result | 1 + 8 files changed, 150 insertions(+), 82 deletions(-) create mode 100644 modules/home.nix create mode 100644 modules/hosts/nerv/#theme.nix# create mode 120000 modules/hosts/nerv/.#theme.nix create mode 100644 modules/hosts/nerv/theme.nix create mode 120000 result diff --git a/flake.nix b/flake.nix index 132cc12..0fc823a 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ url = "github:tinted-theming/schemes"; flake = false; }; - + home-manager.url = "github:nix-community/home-manager"; }; outputs = { @@ -17,15 +17,16 @@ wrappers, flake-parts, base16, + home-manager, ... }@inputs: flake-parts.lib.mkFlake { inherit inputs; } ( - { config, ... }: { + { config, pkgs, ... }: { systems = [ "x86_64-linux" ]; imports = [ wrappers.flakeModules.wrappers - ./modules/programs/emacs/emacs.nix ./modules/theme.nix + ./modules/programs/emacs/emacs.nix ]; flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; @@ -35,10 +36,14 @@ ./modules/hosts/nerv/configuration.nix config.flake.wrappers.emacs.install { wrappers.emacs.enable = true; } + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPkgs = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users.lucy = ./modules/home.nix + } ]; }; - } ); - } diff --git a/modules/home.nix b/modules/home.nix new file mode 100644 index 0000000..8f0d0b3 --- /dev/null +++ b/modules/home.nix @@ -0,0 +1,13 @@ +{ inputs, pkgs, config, ...}: +let + schemeName = (pkgs.callPackage inputs.base16.lib {}).mkSchemeAttrs config.theme.name; +in +{ + home-manager.users.lucy = { + home-stateVersion = "26.05"; + gtk = { + enable = true; + }; + + }; +} diff --git a/modules/hosts/nerv/#theme.nix# b/modules/hosts/nerv/#theme.nix# new file mode 100644 index 0000000..129ecf5 --- /dev/null +++ b/modules/hosts/nerv/#theme.nix# @@ -0,0 +1,23 @@ +{ + inputs, + config, + lib, + ... +}: +let + schemeName = config.theme.name; +in +{ + config, + lib, + pkgs, + ... +}: + +let + scheme = (pkgs.callPackage inputs.base16.lib { }).mkSchemeAttrs schemeName; +in +{ + + +} diff --git a/modules/hosts/nerv/.#theme.nix b/modules/hosts/nerv/.#theme.nix new file mode 120000 index 0000000..42dbbad --- /dev/null +++ b/modules/hosts/nerv/.#theme.nix @@ -0,0 +1 @@ +lucy@nerv.31959:1788169501 \ No newline at end of file diff --git a/modules/hosts/nerv/theme.nix b/modules/hosts/nerv/theme.nix new file mode 100644 index 0000000..33117a8 --- /dev/null +++ b/modules/hosts/nerv/theme.nix @@ -0,0 +1,7 @@ +{ inputs, config, lib, ... }: let + schemeName = config.theme.name; +in + {config, lib, pkgs, ...}: + + let scheme = (pkgs.callPackage inputs.base16.lib {}).mkSchemeAttrs schemeName; in + {} diff --git a/modules/programs/emacs/emacs.nix b/modules/programs/emacs/emacs.nix index fe12316..81d8c6b 100644 --- a/modules/programs/emacs/emacs.nix +++ b/modules/programs/emacs/emacs.nix @@ -1,85 +1,100 @@ -{ inputs, lib, config, ... }: { - flake.wrappers.emacs = { pkgs, wlib, config, ... }: - +{ + inputs, + lib, + config, + ... +}: +let + schemeName = config.theme.name; +in +{ + flake.wrappers.emacs = { - imports = [ - wlib.wrapperModules.emacs - ]; - emacsPackages = - epkgs: with epkgs.melpaPackages; [ - corfu - cape - qml-mode - lua-mode - elcord - nix-mode - base16-theme + pkgs, + wlib, + ... + }: + let + scheme = (pkgs.callPackage inputs.base16.lib { }).mkSchemeAttrs schemeName; + in + { + imports = [ + wlib.wrapperModules.emacs ]; + emacsPackages = + epkgs: with epkgs.melpaPackages; [ + corfu + cape + qml-mode + lua-mode + elcord + nix-mode + base16-theme + ]; - runtimePkgs = with pkgs; [ - nixd - nixfmt - qt6.qtdeclarative - ]; - constructFiles.early-init.content = lib.mkBefore ";;; -*- lexical-binding: t; -*-"; - configFile = '' - ;;; -*- lexical-binding: t; -*- - (setq make-backup-files nil) - (load-theme "base16-${config.theme.scheme}" t) - (use-package - corfu - :init - (setq - corfu-auto t - corfu-auto-prefix 1 - corfu-auto-delay 0.2) - (global-corfu-mode)) + runtimePkgs = with pkgs; [ + nixd + nixfmt + qt6.qtdeclarative + ]; + constructFiles.early-init.content = lib.mkBefore ";;; -*- lexical-binding: t; -*-"; + configFile = '' + ;;; -*- lexical-binding: t; -*- + (setq make-backup-files nil) + (load-theme 'base16-${scheme.scheme-slug} t) + (use-package + corfu + :init + (setq + corfu-auto t + corfu-auto-delay 0.2) + (global-corfu-mode)) - (setq tab-always-indent 'complete) - (use-package - cape - :bind ("C-c p" . cape-prefix-map) ;; Alternative key: M-, M-p, M-+ - :init (add-hook 'completion-at-point-functions #'cape-file)) - (setq corfu-auto-prefix 2) - (use-package qml-mode :ensure t) - (use-package lua-mode :ensure t) - (use-package elcord :ensure t :init (elcord-mode)) + (setq tab-always-indent 'complete) + (use-package + cape + :bind ("C-c p" . cape-prefix-map) ;; Alternative key: M-, M-p, M-+ + :init (add-hook 'completion-at-point-functions #'cape-file)) + (setq corfu-auto-prefix 2) + (use-package qml-mode) + (use-package lua-mode) + (use-package elcord :init (elcord-mode)) - (add-to-list - 'display-buffer-alist - '("\\*compilation\\*" (display-buffer-reuse-window - display-buffer-below-selected) - (window-height . 0.3))) + (add-to-list + 'display-buffer-alist + '("\\*compilation\\*" (display-buffer-reuse-window + display-buffer-below-selected) + (window-height . 0.3))) - ;; remove useless shit and set default opts - (setq ring-bell-function 'ignore) - (menu-bar-mode -1) - (tool-bar-mode -1) - (setq display-line-numbers-type 'relative) - (global-display-line-numbers-mode +1) - (global-tab-line-mode 1) - (scroll-bar-mode -1) - (setq inhibit-splash-screen 1) - (setq custom-file "~/.emacs.d/custom.el") - (load custom-file 'noerror) + ;; remove useless shit and set default opts + (setq ring-bell-function 'ignore) + (menu-bar-mode -1) + (tool-bar-mode -1) + (setq display-line-numbers-type 'relative) + (global-display-line-numbers-mode +1) + (global-tab-line-mode 1) + (scroll-bar-mode -1) + (setq inhibit-splash-screen 1) + (setq custom-file "~/.emacs.d/custom.el") + (load custom-file 'noerror) - ;; lsp shit - (add-hook 'nix-mode-hook #'eglot-ensure) - (add-hook 'c-mode-hook #'eglot-ensure) - (add-hook 'qml-mode-hook #'eglot-ensure) - (with-eval-after-load 'eglot - (add-to-list 'eglot-server-programs '(nix-mode . ("nixd"))) - (add-to-list 'eglot-server-programs '(qml-mode . ("qmlls")))) + ;; lsp shit + (add-hook 'nix-mode-hook #'eglot-ensure) + (add-hook 'c-mode-hook #'eglot-ensure) + (add-hook 'qml-mode-hook #'eglot-ensure) + (with-eval-after-load 'eglot + (add-to-list 'eglot-server-programs '(nix-mode . ("nixd"))) + (add-to-list 'eglot-server-programs '(qml-mode . ("qmlls")))) - ;; keybindings - (keymap-global-set "C-c f" 'eglot-format) - (keymap-global-set "C-c t" 'term) - (keymap-global-set "C-c c" 'compile) - (keymap-global-set "C-c k b" 'kill-current-buffer) - (keymap-global-set "C-c k w" 'kill-buffer-and-window) - (windmove-default-keybindings) - ''; - }; + ;; keybindings + (keymap-global-set "C-c f" 'eglot-format) + (keymap-global-set "C-c t" 'term) + (keymap-global-set "C-c c" 'compile) + (keymap-global-set "C-c k b" 'kill-current-buffer) + (keymap-global-set "C-c k w" 'kill-buffer-and-window) + (windmove-default-keybindings) + ''; + }; } diff --git a/modules/theme.nix b/modules/theme.nix index 4a2a233..eaf7dca 100644 --- a/modules/theme.nix +++ b/modules/theme.nix @@ -1,9 +1,12 @@ -{ inputs, lib }: { - options.scheme = lib.mkOption { +{ inputs, lib, pkgs, config, ... }: { + options.theme.name = lib.mkOption { type = lib.types.str; default = "${inputs.tt-schemes}/base16/oxocarbon-dark.yaml"; example = "${inputs.tt-schemes}/base16/catppuccin-mocha.yaml"; description = "set the used theme"; }; - config.scheme = "${inputs.tt-schemes}/base16/oxocarbon-dark.yaml"; + options.theme.mkSchemeAttr = lib.mkOption { + type = lib.types.attrSet; + }; + config.theme.name = "${inputs.tt-schemes}/base16/oxocarbon-dark.yaml"; } diff --git a/result b/result new file mode 120000 index 0000000..6c0844f --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/3jh5fidnaf2jwps902nycb421bmiwnqb-emacs-with-packages-31.1 \ No newline at end of file