diff --git a/.envrc b/.envrc index a8d08c3..30da14f 100644 --- a/.envrc +++ b/.envrc @@ -1,8 +1,5 @@ -use flake .nix +export DIRENV_WARN_TIMEOUT=20s -if on_git_branch; then - echo - git status --short --branch - echo - git fetch -fi +eval "$(devenv direnvrc)" + +use devenv diff --git a/.gitignore b/.gitignore index 3357b94..785767a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,10 @@ # Ignore build outputs from performing a nix-build or `nix build` command result result-* + +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv diff --git a/.nix/flake.lock b/.nix/flake.lock deleted file mode 100644 index 937ca6f..0000000 --- a/.nix/flake.lock +++ /dev/null @@ -1,25 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1736012469, - "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", - "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", - "revCount": 733374, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.733374%2Brev-8f3e1f807051e32d8c95cd12b9b421623850a34d/01943a5d-98a8-75c0-9963-3a93900583fd/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/.nix/flake.nix b/.nix/flake.nix deleted file mode 100644 index 0cbe327..0000000 --- a/.nix/flake.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - description = "A flake editing flake"; - - inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; - - outputs = { nixpkgs, ... }: - let - supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; - forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { - pkgs = import nixpkgs { inherit system; }; - }); - in - { - devShells = forEachSupportedSystem ({ pkgs }: { - default = pkgs.mkShell.override - { - # Override stdenv in order to change compiler: - # stdenv = pkgs.clangStdenv; - } - { - packages = with pkgs; [ - pre-commit - commitizen - ]; - - shellHook = '' - pre-commit install --allow-missing-config --hook-type pre-commit --hook-type commit-msg - ''; - }; - }); - }; -} diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..a9f9ec6 --- /dev/null +++ b/devenv.lock @@ -0,0 +1,103 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1741068816, + "owner": "cachix", + "repo": "devenv", + "rev": "9f6da63c162ad86b6fb84edcbd8c447fdc411c3d", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1740915799, + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "42b1ba089d2034d910566bf6b40830af6b8ec732", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733477122, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": [ + "git-hooks" + ] + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 0000000..1a6c6f8 --- /dev/null +++ b/devenv.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + packages = with pkgs; [ + git + ]; + + git-hooks.hooks = { + commitizen.enable = true; + }; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..116a2ad --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,15 @@ +# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling + +# If you're using non-OSS software, you can set allowUnfree to true. +# allowUnfree: true + +# If you're willing to use a package that's vulnerable +# permittedInsecurePackages: +# - "openssl-1.1.1w" + +# If you have more than one devenv you can merge them +#imports: +# - ./backend