summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-02-25 00:17:32 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2023-02-25 00:19:47 +0100
commit7dbe008e416b952376cf94ae416b015e595fc73c (patch)
treef2e903de0315049f7a6860607898928406c08e1e
parent9d6c195c47948042bbb23394229843d2bd8adb9a (diff)
downloadProject-Tick-7dbe008e416b952376cf94ae416b015e595fc73c.tar.gz
Project-Tick-7dbe008e416b952376cf94ae416b015e595fc73c.zip
feat(nix): init flake
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r--.envrc1
-rw-r--r--.gitignore4
-rw-r--r--flake.lock123
-rw-r--r--flake.nix35
4 files changed, 163 insertions, 0 deletions
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000000..3550a30f2d
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/.gitignore b/.gitignore
index c413caa35d..e05d6a236e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,9 @@
.idea/
+# direnv / Nix
+.direnv/
+.pre-commit-config.yaml
+
public/*/
caches/
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000000..a47855be76
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,123 @@
+{
+ "nodes": {
+ "flake-compat": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1673956053,
+ "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
+ "type": "github"
+ },
+ "original": {
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "flake-utils": {
+ "locked": {
+ "lastModified": 1676283394,
+ "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "gitignore": {
+ "inputs": {
+ "nixpkgs": [
+ "pre-commit-hooks",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1660459072,
+ "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1677229269,
+ "narHash": "sha256-awE2w6oi9rzQ8qj1lwKEDm6qIA0a239fiB+AyPjXR2w=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs-stable": {
+ "locked": {
+ "lastModified": 1673800717,
+ "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-22.11",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "pre-commit-hooks": {
+ "inputs": {
+ "flake-compat": "flake-compat",
+ "flake-utils": [
+ "flake-utils"
+ ],
+ "gitignore": "gitignore",
+ "nixpkgs": [
+ "nixpkgs"
+ ],
+ "nixpkgs-stable": "nixpkgs-stable"
+ },
+ "locked": {
+ "lastModified": 1677160285,
+ "narHash": "sha256-tBzpCjMP+P3Y3nKLYvdBkXBg3KvTMo3gvi8tLQaqXVY=",
+ "owner": "cachix",
+ "repo": "pre-commit-hooks.nix",
+ "rev": "2bd861ab81469428d9c823ef72c4bb08372dd2c4",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "repo": "pre-commit-hooks.nix",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs",
+ "pre-commit-hooks": "pre-commit-hooks"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000000..007613f7b2
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,35 @@
+{
+ description = "Prism Launcher Metadata generation scripts";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ pre-commit-hooks = {
+ url = "github:cachix/pre-commit-hooks.nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ inputs.flake-utils.follows = "flake-utils";
+ };
+ };
+
+ outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, ... }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ pythonPackages = pkgs.python311Packages;
+ in {
+ checks = {
+ pre-commit-check = pre-commit-hooks.lib.${system}.run {
+ src = ./.;
+ hooks = {
+ black.enable = true;
+ nixfmt.enable = true;
+ };
+ };
+ };
+ devShells.default = pkgs.mkShell {
+ inherit (self.checks.${system}.pre-commit-check) shellHook;
+ packages = (with pythonPackages; [ black ])
+ ++ (with pkgs; [ nixfmt ]);
+ };
+ });
+}