From 652855716380cb487c81ddc40ff610e99f3f0b31 Mon Sep 17 00:00:00 2001 From: DavHau Date: Mon, 31 Jul 2023 20:05:04 +0200 Subject: [PATCH] devShells: inherit from clan-core --- .gitignore | 1 + flake-parts/devShells/default.nix | 19 +++ flake.lock | 242 +++++++++++++++++++++++++++++- flake.nix | 11 +- 4 files changed, 262 insertions(+), 11 deletions(-) create mode 100644 flake-parts/devShells/default.nix diff --git a/.gitignore b/.gitignore index be26c9e..8200231 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /public .direnv result* +.pre-commit-config.yaml diff --git a/flake-parts/devShells/default.nix b/flake-parts/devShells/default.nix new file mode 100644 index 0000000..b01b98f --- /dev/null +++ b/flake-parts/devShells/default.nix @@ -0,0 +1,19 @@ +{ + perSystem = + { inputs' + , lib + , pkgs + , self' + , ... + }: { + devShells.default = pkgs.mkShell { + packages = [ + pkgs.bashInteractive + pkgs.zola + ]; + inputsFrom = [ + inputs'.clan-core.devShells.default + ]; + }; + }; +} diff --git a/flake.lock b/flake.lock index 1c210d6..6b936e4 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,69 @@ { "nodes": { + "clan-core": { + "inputs": { + "disko": "disko", + "flake-parts": [ + "flake-parts" + ], + "nixos-generators": "nixos-generators", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1690761637, + "narHash": "sha256-Y6vABFmBeSofpkr3GTJv+37p1LVoN9BJ1AsCLWTMOHU=", + "ref": "refs/heads/main", + "rev": "284e1ef54f52f2788309c8374945b6cdc7ec1d61", + "revCount": 162, + "type": "git", + "url": "https://git.clan.lol/clan/clan-core" + }, + "original": { + "type": "git", + "url": "https://git.clan.lol/clan/clan-core" + } + }, + "disko": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1690739034, + "narHash": "sha256-roW02IaiQ3gnEEDMCDWL5YyN+C4nBf/te6vfL7rG0jk=", + "owner": "nix-community", + "repo": "disko", + "rev": "4015740375676402a2ee6adebc3c30ea625b9a94", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "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-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -18,18 +82,95 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "clan-core", + "pre-commit-hooks-nix", + "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" + } + }, + "nixlib": { + "locked": { + "lastModified": 1689469483, + "narHash": "sha256-2SBhY7rZQ/iNCxe04Eqxlz9YK9KgbaTMBssq3/BgdWY=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "02fea408f27186f139153e1ae88f8ab2abd9c22c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1690133435, + "narHash": "sha256-YNZiefETggroaTLsLJG2M+wpF0pJPwiauKG4q48ddNU=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "b1171de4d362c022130c92d7c8adc4bf2b83d586", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1688500189, - "narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=", + "lastModified": 1689261696, + "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "78419edadf0fabbe5618643bd850b2f2198ed060", + "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -52,10 +193,101 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1688500189, + "narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "78419edadf0fabbe5618643bd850b2f2198ed060", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1690743255, + "narHash": "sha256-dsJzQsyJGWCym1+LMyj2rbYmvjYmzeOrk7ypPrSFOPo=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "fcbf4705d98398d084e6cb1c826a0b90a91d22d7", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { + "clan-core": "clan-core", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" + "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" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "clan-core", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1689620039, + "narHash": "sha256-BtNwghr05z7k5YMdq+6nbue+nEalvDepuA7qdQMAKoQ=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "719c2977f958c41fa60a928e2fbc50af14844114", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 6b1bf87..377eb75 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,10 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; + + clan-core.url = "git+https://git.clan.lol/clan/clan-core"; + clan-core.inputs.flake-parts.follows = "flake-parts"; + clan-core.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs@{ self, flake-parts, ... }: @@ -11,6 +15,7 @@ systems = lib.systems.flakeExposed; imports = [ ./flake-parts/deploy.nix + ./flake-parts/devShells ]; perSystem = { pkgs, ... }: { packages.default = pkgs.runCommand "website" { @@ -22,12 +27,6 @@ zola build cp -r public/* public/.* $out ''; - devShells.default = pkgs.mkShell { - packages = [ - pkgs.bashInteractive - pkgs.zola - ]; - }; }; }); }