diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..9bf4e958 --- /dev/null +++ b/flake.lock @@ -0,0 +1,95 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "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" + } + }, + "nix-deno": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1713992202, + "narHash": "sha256-+sxjCORBeqOX4lgVGeoCiMRidLh8qpi21+NiOfiPr4k=", + "owner": "nekowinston", + "repo": "nix-deno", + "rev": "bb43316eb233e0cea0719a68b92cc797e4829169", + "type": "github" + }, + "original": { + "owner": "nekowinston", + "repo": "nix-deno", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1702312524, + "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a9bf124c46ef298113270b1f84a164865987a91c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1713984123, + "narHash": "sha256-mpwxnahk1VqWD1nelbRr6QI+3ZOmYu+t/glpwg+AxgI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bbe2490a512b66964b48f6b431897dbed8164894", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nix-deno": "nix-deno", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..cac2f7fd --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Catppuccin userstyles"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + nix-deno.url = "github:nekowinston/nix-deno"; + }; + + outputs = { + nixpkgs, + flake-utils, + ... + } @ inputs: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs { + inherit system; + overlays = [inputs.nix-deno.overlays.default]; + }; + in { + packages.default = pkgs.callPackage ./nix/default.nix {}; + + devShells.default = pkgs.callPackage ./nix/shell.nix {}; + }); +} diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 00000000..b95904ee --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,26 @@ +{ + lib, + denoPlatform, +}: +denoPlatform.mkDenoDerivation { + name = "userstyles"; + version = "unstable"; + + src = ../.; + + buildPhase = '' + mkdir -p $out + deno task ci:generate-import + ''; + + installPhase = '' + cp -r dist/* $out + ''; + + meta = { + description = "A collection of userstyles for various websites."; + homepage = "https://github.com/catppuccin/userstyles"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [isabelroses]; + }; +} diff --git a/nix/shell.nix b/nix/shell.nix new file mode 100644 index 00000000..f34f3b01 --- /dev/null +++ b/nix/shell.nix @@ -0,0 +1,16 @@ +{ + deno, + callPackage, + nodePackages, + ... +}: let + mainPkg = callPackage ./default.nix {}; +in + mainPkg.overrideAttrs (oa: { + buildInputs = + [ + deno + nodePackages.prettier + ] + ++ (oa.nativeBuildInputs or []); + })