Skip to content

Commit

Permalink
Merge branch 'deploy-rs'
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutter committed Jan 10, 2024
2 parents 2a5131b + fe91fd0 commit c835e3f
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 18 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# mhnet NixOS configurations

Usage: `./deploy.sh HOST`
Usage: `deploy`


## Backlog

- [ ] Manage secret data with `agenix`
- [ ] https://xeiaso.net/blog/paranoid-nixos-2021-07-18/
- [ ] https://xeiaso.net/blog/paranoid-nixos-aws-2021-08-11/

Expand Down
12 changes: 0 additions & 12 deletions deploy.sh

This file was deleted.

72 changes: 72 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 30 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
description = "Deployment for my server(s)";

outputs = { self, nixpkgs }:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, deploy-rs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell."${system}" = pkgs.mkShell {
packages = with pkgs; [ nixos-rebuild ];
# Ensure necessary tooling is available
devShells."${system}".default = pkgs.mkShell {
packages = [ pkgs.deploy-rs ];
};

# NixOS configurations
nixosConfigurations.rhea = nixpkgs.lib.nixosSystem {
inherit system;
system = "x86_64-linux ";
modules = [ ./configuration.nix ];
};

# Deployment specifications
deploy.nodes.rhea = {
hostname = "rhea";
sshUser = "root";
remoteBuild = true;

profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.rhea;
};
};

# FIXME: reenable; will pull a gig of dependencies ...
# checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
}

0 comments on commit c835e3f

Please sign in to comment.