summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-09-15 21:57:04 -0400
committerseth <[email protected]>2023-09-15 21:57:04 -0400
commitde807d65a6f2dd5ce81507bff456449a912b131d (patch)
tree61fa5a41ee5c102ba1a91127034358a513979ea9
parentfd9eaa40a0508d009fe4f08d501d8ae6f64c4a96 (diff)
hosts: deploy-rs -> nixinate
deploy-rs still has issues with tailscale :(
-rw-r--r--README.md2
-rw-r--r--flake.lock48
-rw-r--r--flake.nix38
-rw-r--r--hosts/atlas/default.nix8
-rw-r--r--hosts/default.nix4
-rw-r--r--justfile5
-rw-r--r--parts/default.nix1
-rw-r--r--parts/deploy.nix19
-rw-r--r--parts/dev.nix1
-rw-r--r--parts/lib/utils/default.nix1
-rw-r--r--parts/lib/utils/deploy.nix29
11 files changed, 53 insertions, 103 deletions
diff --git a/README.md b/README.md
index 85dcf83..e12cac9 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ there are some amazing tools i use to make/manage this flake that i would highly
- [garnix](https://garnix.io)
- [home-manager](https://github.com/nix-community/home-manager)
-- [deploy-rs](https://github.com/serokell/deploy-rs)
+- [nixinate](https://github.com/MatthewCroughan/nixinate)
- [lanzaboote](https://github.com/nix-community/lanzaboote)
- [nixos-wsl](https://github.com/nix-community/nixos-wsl)
- [nix-openwrt-imagebuilder](https://github.com/astro/nix-openwrt-imagebuilder)
diff --git a/flake.lock b/flake.lock
index 1543f60..c8a20c9 100644
--- a/flake.lock
+++ b/flake.lock
@@ -104,32 +104,6 @@
"type": "github"
}
},
- "deploy": {
- "inputs": {
- "flake-compat": [
- "flake-compat"
- ],
- "nixpkgs": [
- "nixpkgs"
- ],
- "utils": [
- "flake-utils"
- ]
- },
- "locked": {
- "lastModified": 1694513707,
- "narHash": "sha256-wE5kHco3+FQjc+MwTPwLVqYz4hM7uno2CgXDXUFMCpc=",
- "owner": "serokell",
- "repo": "deploy-rs",
- "rev": "31c32fb2959103a796e07bbe47e0a5e287c343a8",
- "type": "github"
- },
- "original": {
- "owner": "serokell",
- "repo": "deploy-rs",
- "type": "github"
- }
- },
"flake-compat": {
"flake": false,
"locked": {
@@ -312,6 +286,26 @@
"type": "github"
}
},
+ "nixinate": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1688141737,
+ "narHash": "sha256-qHrNMYWukOKmKVf6wXOGKj1xxUnOGjvTRbt/PLLXuBE=",
+ "owner": "MatthewCroughan",
+ "repo": "nixinate",
+ "rev": "7902ae845e6cc5bd450e510cdf5e009a6e4a44d9",
+ "type": "github"
+ },
+ "original": {
+ "owner": "MatthewCroughan",
+ "repo": "nixinate",
+ "type": "github"
+ }
+ },
"nixos-wsl": {
"inputs": {
"flake-compat": [
@@ -491,7 +485,6 @@
"arkenfox": "arkenfox",
"crane": "crane",
"darwin": "darwin",
- "deploy": "deploy",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"getchoo": "getchoo",
@@ -499,6 +492,7 @@
"hm": "hm",
"lanzaboote": "lanzaboote",
"nix-index-database": "nix-index-database",
+ "nixinate": "nixinate",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
diff --git a/flake.nix b/flake.nix
index c39a0af..a365ee1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -14,6 +14,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
+ parts = {
+ url = "github:hercules-ci/flake-parts";
+ inputs.nixpkgs-lib.follows = "nixpkgs";
+ };
+
arkenfox = {
url = "github:dwarfmaster/arkenfox-nixos";
inputs = {
@@ -24,20 +29,6 @@
};
};
- deploy = {
- url = "github:serokell/deploy-rs";
- inputs = {
- nixpkgs.follows = "nixpkgs";
- utils.follows = "flake-utils";
- flake-compat.follows = "flake-compat";
- };
- };
-
- parts = {
- url = "github:hercules-ci/flake-parts";
- inputs.nixpkgs-lib.follows = "nixpkgs";
- };
-
getchoo = {
url = "github:getchoo/nix-exprs";
inputs = {
@@ -73,6 +64,11 @@
};
};
+ nixinate = {
+ url = "github:MatthewCroughan/nixinate";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
@@ -119,6 +115,13 @@
# -- these are just to avoid having multiple versions in flake.lock
# ------------------------------
+ flake-compat = {
+ url = "github:edolstra/flake-compat";
+ flake = false;
+ };
+
+ flake-utils.url = "github:numtide/flake-utils";
+
agenix = {
url = "github:ryantm/agenix";
inputs = {
@@ -128,13 +131,6 @@
};
};
- flake-compat = {
- url = "github:edolstra/flake-compat";
- flake = false;
- };
-
- flake-utils.url = "github:numtide/flake-utils";
-
crane = {
url = "github:ipetkov/crane";
inputs = {
diff --git a/hosts/atlas/default.nix b/hosts/atlas/default.nix
index ad6e7e8..89ea2c9 100644
--- a/hosts/atlas/default.nix
+++ b/hosts/atlas/default.nix
@@ -9,6 +9,14 @@
./nginx.nix
];
+ _module.args.nixinate = {
+ host = "atlas";
+ sshUser = "root";
+ buildOn = "remote";
+ substituteOnTarget = true;
+ hermetic = true;
+ };
+
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
diff --git a/hosts/default.nix b/hosts/default.nix
index 46f075f..d0daad4 100644
--- a/hosts/default.nix
+++ b/hosts/default.nix
@@ -43,4 +43,8 @@
inherit (inputs) openwrt-imagebuilder;
});
};
+
+ perSystem = {system, ...}: {
+ apps = (inputs.nixinate.nixinate.${system} self).nixinate;
+ };
}
diff --git a/justfile b/justfile
index 8674597..9af8f59 100644
--- a/justfile
+++ b/justfile
@@ -24,10 +24,9 @@ check:
nix flake check
deploy HOST:
- deploy .#{{ HOST }}
+ nix run .#{{ HOST }}
-deploy-all:
- deploy
+deploy-all: (deploy "atlas")
[linux]
dry-run:
diff --git a/parts/default.nix b/parts/default.nix
index 3626f4a..fd41d6b 100644
--- a/parts/default.nix
+++ b/parts/default.nix
@@ -1,6 +1,5 @@
_: {
imports = [
- ./deploy.nix
./dev.nix
./lib
./overlays
diff --git a/parts/deploy.nix b/parts/deploy.nix
deleted file mode 100644
index 4c84379..0000000
--- a/parts/deploy.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- self,
- lib,
- ...
-}: let
- inherit (builtins) elem;
- inherit (lib) filterAttrs;
- inherit (self) darwinConfigurations nixosConfigurations;
-
- targets = ["atlas"];
-
- targets' = filterAttrs (n: _: elem n targets) (nixosConfigurations // darwinConfigurations);
-in {
- flake.deploy = {
- remoteBuild = true;
- fastConnection = true;
- nodes = self.lib.utils.deploy.mkDeployNodes targets';
- };
-}
diff --git a/parts/dev.nix b/parts/dev.nix
index 7ce0fcf..f10ea88 100644
--- a/parts/dev.nix
+++ b/parts/dev.nix
@@ -30,7 +30,6 @@ in {
actionlint
alejandra
deadnix
- deploy-rs
just
statix
stylua
diff --git a/parts/lib/utils/default.nix b/parts/lib/utils/default.nix
index cbb6eb9..ad91841 100644
--- a/parts/lib/utils/default.nix
+++ b/parts/lib/utils/default.nix
@@ -1,4 +1,3 @@
args: {
- deploy = import ./deploy.nix args;
nginx = import ./nginx.nix args;
}
diff --git a/parts/lib/utils/deploy.nix b/parts/lib/utils/deploy.nix
deleted file mode 100644
index 261af32..0000000
--- a/parts/lib/utils/deploy.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{inputs, ...}: let
- inherit (builtins) mapAttrs;
- inherit (inputs) deploy;
-in {
- mkDeployNodes = mapAttrs (_: system: let
- inherit (system) pkgs;
- deployPkgs = import pkgs.path {
- inherit (pkgs) system;
- overlays = [
- deploy.overlay
- (_: prev: {
- deploy-rs = {
- inherit (pkgs) deploy-rs;
- inherit (prev.deploy-rs) lib;
- };
- })
- ];
- };
-
- type =
- if pkgs.stdenv.isLinux
- then "nixos"
- else "darwin";
- in {
- sshUser = "root";
- hostname = system.config.networking.hostName;
- profiles.system.path = deployPkgs.deploy-rs.lib.activate.${type} system;
- });
-}