From 5af33d365d40d6b68cc102b539a424241d3211f3 Mon Sep 17 00:00:00 2001 From: lucy Date: Mon, 31 Aug 2026 12:01:06 +0200 Subject: [PATCH] start trying to theme with base16.nix --- flake.lock | 52 ++++++++++++++++++++++++++++++ flake.nix | 55 ++++++++++++++++++++------------ modules/programs/emacs/emacs.nix | 10 ++++-- 3 files changed, 94 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 322ef55..145b6fb 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -18,6 +36,22 @@ "type": "github" } }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1788039129, @@ -67,11 +101,29 @@ }, "root": { "inputs": { + "base16": "base16", "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", + "tt-schemes": "tt-schemes", "wrappers": "wrappers" } }, + "tt-schemes": { + "flake": false, + "locked": { + "lastModified": 1786274241, + "narHash": "sha256-LMHxSQJIv6QJJkO9W7sAkJujlwusFf9/Ct0SYJ6GyHQ=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "fdca32a0d14ec80ad83a78a9ccb85592ca6cb9e1", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, "wrappers": { "inputs": { "nixpkgs": "nixpkgs_2" diff --git a/flake.nix b/flake.nix index 1f7a52f..bb4bf9e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,26 +3,41 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; wrappers.url = "github:BirdeeHub/nix-wrapper-modules"; flake-parts.url = "github:hercules-ci/flake-parts"; - + base16.url = "github:SenchoPens/base16.nix"; + tt-schemes = { + url = "github:tinted-theming/schemes"; + flake = false; + }; + }; - outputs = { self, nixpkgs, wrappers, flake-parts, ... }@inputs: - flake-parts.lib.mkFlake { inherit inputs; } ({config, ...}: { - systems = [ "x86_64-linux" ]; - imports = [ - wrappers.flakeModules.wrappers - ./modules/programs/emacs/emacs.nix - ]; - flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - ./modules/hosts/nerv/configuration.nix - config.flake.wrappers.emacs.install - { wrappers.emacs.enable = true; } - ]; - }; - - }); - + outputs = + { + self, + nixpkgs, + wrappers, + flake-parts, + base16, + ... + }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } ( + { config, ... }: { + systems = [ "x86_64-linux" ]; + imports = [ + wrappers.flakeModules.wrappers + ./modules/programs/emacs/emacs.nix + ]; + flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + base16.nixosModule + { scheme = "${inputs.tt-schemes}/base16/oxocarbon-dark.yaml"; } + ./modules/hosts/nerv/configuration.nix + config.flake.wrappers.emacs.install + { wrappers.emacs.enable = true; } + ]; + }; + + } + ); } - diff --git a/modules/programs/emacs/emacs.nix b/modules/programs/emacs/emacs.nix index 52c0b08..577991c 100644 --- a/modules/programs/emacs/emacs.nix +++ b/modules/programs/emacs/emacs.nix @@ -1,6 +1,9 @@ -{ inputs, ... }: { - flake.wrappers.emacs = { pkgs, wlib, lib, ... }: { - imports = [ wlib.wrapperModules.emacs ]; +{ inputs, lib, config, ... }: { + flake.wrappers.emacs = { pkgs, wlib, lib, config, ... }: { + imports = [ + wlib.wrapperModules.emacs + inputs.base16.nixosModule + ]; emacsPackages = epkgs: with epkgs.melpaPackages; [ corfu @@ -20,6 +23,7 @@ configFile = '' ;;; -*- lexical-binding: t; -*- (setq make-backup-files nil) + (load-theme "${base16.lib.scheme-slug}" t (use-package corfu :init