1
0
Fork 0
blog/flake.nix

63 lines
1.5 KiB
Nix
Raw Normal View History

2024-07-07 17:00:34 +00:00
{
description = "Bloggy time!";
inputs = {
2025-04-17 17:58:50 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
deploy-rs.url = "github:serokell/deploy-rs";
2025-05-03 03:37:11 +00:00
treefmt-nix.url = "github:numtide/treefmt-nix";
2024-07-07 17:00:34 +00:00
};
2025-05-03 03:37:11 +00:00
outputs = { self, nixpkgs, deploy-rs, systems, treefmt-nix }: let
# systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
forAllSystems = fn:
nixpkgs.lib.genAttrs (import systems) (system: fn nixpkgs.legacyPackages.${system});
treefmtEval = forAllSystems (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
2024-07-07 17:00:34 +00:00
in {
2025-04-20 14:57:57 +00:00
apps = forAllSystems (pkgs: {
"deploy" = {
type = "app";
program = let
ci = (pkgs.writeShellApplication {
name = "ci.sh";
text = ''
nix build
'';
});
in "${ci}/ci.sh";
2024-07-07 18:27:07 +00:00
};
2024-07-07 17:00:34 +00:00
});
2025-04-20 14:57:57 +00:00
packages = forAllSystems (pkgs: {
default = pkgs.callPackage ./package.nix {};
});
2025-04-17 17:58:50 +00:00
deploy.nodes.myblog = {
hostname = "saji.dev";
profiles.mysite = {
sshUser = "static-site";
user = "static-site";
path = deploy-rs.lib.x86_64-linux.activate.custom self.packages.x86_64-linux.default ''
rm -rf /var/lib/static-site/public
ln -sn $PROFILE/public /var/lib/static-site/public
'';
};
};
2024-07-07 17:00:34 +00:00
2025-05-03 03:37:11 +00:00
formatter = forAllSystems (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
checks = forAllSystems (pkgs: {
formatting = treefmtEval.${pkgs.system}.config.build.check self;
});
2024-07-07 17:00:34 +00:00
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs
2024-07-07 18:27:07 +00:00
vips
pkg-config
2024-07-07 17:00:34 +00:00
];
};
});
};
}