volpe/flake.nix

58 lines
1.5 KiB
Nix

{
description = "Volpe Blog";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
outputs = {
self,
nixpkgs,
}: let
overlays = [
(final: prev: {
nodejs = prev.nodejs_latest;
})
];
supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs {inherit overlays system;};
});
in {
packages = forEachSupportedSystem ({pkgs}: {
default = pkgs.callPackage ./nix/package.nix {};
volpe = pkgs.callPackage ./nix/package.nix {};
});
devShells = forEachSupportedSystem ({pkgs}: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs
nodePackages.pnpm
];
};
});
nixosConfigurations.volpe = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{nixpkgs.overlays = overlays;}
./nix/configuration.nix
];
};
# Deployment helper - use with: nix run .#deploy
apps = forEachSupportedSystem ({pkgs}: {
deploy = {
type = "app";
program = toString (pkgs.writeShellScript "deploy-volpe" ''
set -e
echo "Building and deploying to cyberian@69.61.19.180..."
nixos-rebuild switch --flake .#volpe \
--target-host cyberian@69.61.19.180 \
--sudo
'');
};
});
};
}