diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..eb845f3 --- /dev/null +++ b/default.nix @@ -0,0 +1,21 @@ +{ + lib, + buildGoModule, +}: +buildGoModule { + pname = "isabelroses.com"; + version = "0.0.1"; + + src = ./.; + + vendorHash = "sha256-Q6ZAptN0HX1sauHVQG3MjOmL4+cXtQp2RGiKfOTXYWI="; + + ldflags = ["-s" "-w"]; + + meta = with lib; { + description = "My personal website"; + homepage = "https://github.com/isabelroses/website"; + license = with licenses; [gpl3]; + maintainers = with maintainers; [isabelroses]; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ec7c462 --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1704152458, + "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", + "path": "/nix/store/63ff0vky0rggr0dn996cl7r6i459l61d-source", + "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", + "type": "path" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704538339, + "narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "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..dccb374 --- /dev/null +++ b/flake.nix @@ -0,0 +1,32 @@ +{ + description = "isabelroses.com"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"]; + + perSystem = { + pkgs, + system, + ... + }: { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + }; + + devShells.default = pkgs.mkShell { + name = "isabelroses.com"; + packages = with pkgs; [ + go + gopls + air + yarn + ]; + }; + + packages.default = pkgs.callPackage ./nix/serve.nix {}; + }; + }; +}