diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/flake.nix b/flake.nix index d0853ec4..e61f528f 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,7 @@ nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; darwin.url = "github:lnl7/nix-darwin/master"; darwin.inputs.nixpkgs.follows = "nixpkgs"; + emacs-overlay.url = "github:nix-community/emacs-overlay"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; nh-darwin.url = "github:ToyVo/nh_darwin"; @@ -17,14 +18,12 @@ utils.url = "github:numtide/flake-utils"; agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "nixpkgs"; + deploy-rs.url = "github:serokell/deploy-rs"; personal = { url = "git+file:packages"; inputs.nixpkgs.follows = "nixpkgs"; }; - searchix = { - url = "git+https://git.alanpearce.eu/searchix"; - inputs.nixpkgs.follows = "nixpkgs-small"; - }; + searchix.url = "git+https://git.alanpearce.eu/searchix"; golink = { url = "github:tailscale/golink"; inputs.nixpkgs.follows = "nixpkgs-small"; @@ -38,6 +37,7 @@ , nixpkgs , nixpkgs-small , nixos-hardware + , emacs-overlay , home-manager , darwin , nh-darwin @@ -45,6 +45,7 @@ , secrets , agenix , personal + , deploy-rs , searchix , golink , ... @@ -66,6 +67,7 @@ inherit system; overlays = readOverlays (toString ./overlays) ++ [ agenix.overlays.default + emacs-overlay.overlays.default (self: super: { personal = personal.packages.${system}; enchant = super.enchant.override { @@ -101,6 +103,7 @@ specialArgs = { inherit inputs; }; modules = [ agenix.nixosModules.default + nixos-hardware.nixosModules.friendlyarm-nanopi-r5s ./system/nanopi.nix ]; }; @@ -158,7 +161,44 @@ (secrets + "/default.nix") ]; }; - }; + + checks = builtins.mapAttrs + (system: deployLib: + deployLib.deployChecks self.deploy) + deploy-rs.lib; + + deploy = { + remoteBuild = true; + interactiveSudo = true; + nodes.linde = { + hostname = "linde"; + profiles.system = { + path = deploy-rs.lib.${utils.lib.system.aarch64-linux}.activate.nixos + self.nixosConfigurations.linde; + }; + profiles.alan = { + user = "alan"; + path = deploy-rs.lib.${utils.lib.system.aarch64-linux}.activate.home-manager + self.homeConfigurations."alan@linde"; + }; + }; + }; + } // utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells = { + default = pkgs.mkShell { + packages = [ + deploy-rs.packages.${system}.default + agenix.packages.${system}.default + ]; + }; + }; + }); + + nixConfig = { extra-substituters = [ "https://toyvo.cachix.org" |