diff --git a/default.nix b/default.nix deleted file mode 100644 index 5d4d35c..0000000 --- a/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -with import {}; -mkShell { - packages = [ - bashInteractive - zola - ]; -} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1c210d6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1688466019, + "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1688500189, + "narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "78419edadf0fabbe5618643bd850b2f2198ed060", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1688049487, + "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cd2639c --- /dev/null +++ b/flake.nix @@ -0,0 +1,30 @@ +{ + description = "Website of the clan project"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs@{ self, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: { + systems = lib.systems.flakeExposed; + perSystem = { pkgs, ... }: { + packages.default = pkgs.runCommand "website" { + buildInputs = [ pkgs.zola ]; + } '' + mkdir -p $out + cp -r ${self} . + chmod -R u+w . + zola build + cp -r public $out + ''; + devShells.default = pkgs.mkShell { + packages = [ + pkgs.bashInteractive + pkgs.zola + ]; + }; + }; + }); +}