mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2025-01-08 19:23:43 +01:00
nix changes
This commit is contained in:
parent
3e159a31d1
commit
b56d389390
4 changed files with 19 additions and 50 deletions
11
flake.nix
11
flake.nix
|
@ -14,7 +14,6 @@
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
common = pkgs.callPackage ./lib/common-nix { };
|
common = pkgs.callPackage ./lib/common-nix { };
|
||||||
flakePkg = ref: (builtins.getFlake ref).packages.${system}.default;
|
|
||||||
|
|
||||||
root-mod = {
|
root-mod = {
|
||||||
options.packages = nixpkgs.lib.mkOption { };
|
options.packages = nixpkgs.lib.mkOption { };
|
||||||
|
@ -26,16 +25,6 @@
|
||||||
inherit (pkgs) lib stdenv stdenvNoCC;
|
inherit (pkgs) lib stdenv stdenvNoCC;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Local user nix env
|
|
||||||
config.packages.mzte-nix = pkgs.symlinkJoin {
|
|
||||||
name = "mzte-nix";
|
|
||||||
paths = [
|
|
||||||
pkgs.nix-output-monitor
|
|
||||||
pkgs.nix-du
|
|
||||||
(flakePkg "github:nix-community/zon2nix")
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# devshell for the dotfiles
|
# devshell for the dotfiles
|
||||||
config.dev-shells.default = nixpkgs.legacyPackages.${system}.mkShell {
|
config.dev-shells.default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||||
buildInputs = with pkgs;
|
buildInputs = with pkgs;
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./cgnix
|
./cgnix
|
||||||
./mcdev.nix
|
./mcdev.nix
|
||||||
./userstyles.nix
|
./mzte-nix.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
18
nix/mzte-nix.nix
Normal file
18
nix/mzte-nix.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ lib, pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
flakePkg = ref: (builtins.getFlake ref).packages.${pkgs.system}.default;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.mzte-nix-packages = lib.mkOption { };
|
||||||
|
|
||||||
|
config.mzte-nix-packages = [
|
||||||
|
pkgs.nix-output-monitor
|
||||||
|
pkgs.nix-du
|
||||||
|
(flakePkg "github:nix-community/zon2nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
config.packages.mzte-nix = pkgs.symlinkJoin {
|
||||||
|
name = "mzte-nix";
|
||||||
|
paths = config.mzte-nix-packages;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,38 +0,0 @@
|
||||||
# Module that provides an output for a stylus import file with catppuccin themes.
|
|
||||||
{ pkgs, stdenvNoCC, ... }:
|
|
||||||
let
|
|
||||||
flavor = "mocha";
|
|
||||||
accent-color = "red";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
packages.userstyles = stdenvNoCC.mkDerivation {
|
|
||||||
name = "userstyles.json";
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/catppuccin/userstyles/releases/download/all-userstyles-export/import.json";
|
|
||||||
hash = "sha256-eYU9Y95au9mI3muS4+1QJt31W7s2zVmurdKbQ1dU+pk=";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
# TODO: use better language
|
|
||||||
realBuilder = "${pkgs.deno}/bin/deno";
|
|
||||||
args = [
|
|
||||||
"run"
|
|
||||||
"-A"
|
|
||||||
(pkgs.writeText "build.js" ''
|
|
||||||
const json = await import(Deno.env.get("src"), { with: { type: "json" } });
|
|
||||||
const processed = json.default.map(theme => {
|
|
||||||
if (theme.usercssData?.vars?.accentColor?.default)
|
|
||||||
theme.usercssData.vars.accentColor.default = "${accent-color}";
|
|
||||||
|
|
||||||
if (theme.usercssData?.vars?.darkFlavor?.default)
|
|
||||||
theme.usercssData.vars.darkFlavor.default = "${flavor}";
|
|
||||||
|
|
||||||
return theme;
|
|
||||||
});
|
|
||||||
|
|
||||||
Deno.writeTextFileSync(Deno.env.get("out"), JSON.stringify(processed));
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue