1
0
Fork 0
blog/flake.nix
Saji 1cd021d0a7
All checks were successful
Build Blog / Build (push) Successful in 5m32s
lint
2025-05-02 22:38:37 -05:00

76 lines
1.9 KiB
Nix

{
description = "Bloggy time!";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
deploy-rs.url = "github:serokell/deploy-rs";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
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);
in
{
apps = forAllSystems (pkgs: {
"deploy" = {
type = "app";
program =
let
ci = (
pkgs.writeShellApplication {
name = "ci.sh";
text = ''
nix build
'';
}
);
in
"${ci}/ci.sh";
};
});
packages = forAllSystems (pkgs: {
default = pkgs.callPackage ./package.nix { };
});
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
'';
};
};
formatter = forAllSystems (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
checks = forAllSystems (pkgs: {
formatting = treefmtEval.${pkgs.system}.config.build.check self;
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs
vips
pkg-config
];
};
});
};
}