diff --git a/Makefile b/Makefile index e24fcd5..a2a3ed3 100644 --- a/Makefile +++ b/Makefile @@ -6,3 +6,6 @@ preview: build publish: build rsync -av --delete public/ /var/lib/uninsane/zola/ + +install: build + rsync -av --delete public/ $(PREFIX)/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..efa6888 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1657296039, + "narHash": "sha256-Ghh39+aS+pw5sTP/ZO8VIKE6sBhMadDaQZtf+3yu4Vc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "71d7a4c037dc4f3e98d5c4a81b941933cf5bf675", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-22.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0c06c2a --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + description = "https://uninsane.org blog"; + inputs = { + nixpkgs.url = "nixpkgs/nixos-22.05"; + flake-utils.url = github:numtide/flake-utils; + }; + + outputs = { self, nixpkgs, flake-utils }: + with flake-utils.lib; eachSystem allSystems (system: + let + pkgs = import nixpkgs { inherit system; }; + in + rec { + packages.uninsane-dot-org = with pkgs; stdenv.mkDerivation { + name = "uninsane-dot-org"; + src = self; + buildInputs = [ rsync zola ]; + nativeBuildInputs = [ gnumake ]; + installFlags = [ "PREFIX=$(out)" ]; + }; + defaultPackage = packages.uninsane-dot-org; + + devShells.default = with pkgs; mkShell { + buildInputs = with packages.uninsane-dot-org; (buildInputs ++ nativeBuildInputs); + }; + }); +}