diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | dev.nix | 1 | ||||
| -rw-r--r-- | flake.lock | 50 | ||||
| -rw-r--r-- | flake.nix | 14 | ||||
| -rw-r--r-- | justfile | 8 | ||||
| -rw-r--r-- | systems/atlas/default.nix | 8 | ||||
| -rw-r--r-- | systems/default.nix | 8 | ||||
| -rw-r--r-- | systems/deploy.nix | 43 |
8 files changed, 45 insertions, 89 deletions
@@ -38,7 +38,7 @@ there are some amazing tools i use to make/manage this flake that i would highly - [home-manager](https://github.com/nix-community/home-manager) - [agenix](https://github.com/ryantm/agenix) - [flake-parts](https://github.com/hercules-ci/flake-parts) -- [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) @@ -24,7 +24,6 @@ actionlint alejandra deadnix - deploy-rs fzf just nil @@ -121,34 +121,6 @@ "type": "github" } }, - "deploy": { - "inputs": { - "flake-compat": [ - "pre-commit", - "flake-compat" - ], - "nixpkgs": [ - "nixpkgs" - ], - "utils": [ - "pre-commit", - "flake-utils" - ] - }, - "locked": { - "lastModified": 1698921442, - "narHash": "sha256-7KmvhQ7FuXlT/wG4zjTssap6maVqeAMBdtel+VjClSM=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "660180bbbeae7d60dad5a92b30858306945fd427", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "deploy-rs", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -326,6 +298,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-hardware": { "locked": { "lastModified": 1699159446, @@ -486,12 +478,12 @@ "arkenfox": "arkenfox", "catppuccin": "catppuccin", "darwin": "darwin", - "deploy": "deploy", "getchoo": "getchoo", "getchvim": "getchvim", "hm": "hm", "lanzaboote": "lanzaboote", "nix-index-database": "nix-index-database", + "nixinate": "nixinate", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs", @@ -46,15 +46,6 @@ }; }; - deploy = { - url = "github:serokell/deploy-rs"; - inputs = { - nixpkgs.follows = "nixpkgs"; - utils.follows = "pre-commit/flake-utils"; - flake-compat.follows = "pre-commit/flake-compat"; - }; - }; - getchoo = { url = "github:getchoo/nix-exprs"; inputs.nixpkgs.follows = "nixpkgs"; @@ -85,6 +76,11 @@ }; }; + nixinate = { + url = "github:MatthewCroughan/nixinate"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-index-database = { url = "github:nix-community/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; @@ -32,10 +32,14 @@ check: nix flake check deploy host: - deploy -s .#{{ host }} + nix run .#{{ host }} deploy-all: - deploy -s + nix eval \ + --json ".#apps.x86_64-linux" \ + --apply builtins.attrNames \ + | , jq -c '.[]' | grep -v "dry-run" \ + | while read -r c; do nix run ".#$c"; done [linux] [macos] diff --git a/systems/atlas/default.nix b/systems/atlas/default.nix index e8c28e3..d241658 100644 --- a/systems/atlas/default.nix +++ b/systems/atlas/default.nix @@ -9,6 +9,14 @@ ./nginx.nix ]; + _module.args.nixinate = { + host = "atlas"; + sshUser = "root"; + buildOn = "remote"; + substituteOnTarget = true; + hermetic = false; + }; + age.secrets.teawiebot.file = ../../secrets/systems/atlas/teawieBot.age; boot = { diff --git a/systems/default.nix b/systems/default.nix index 5c6703e..023dc59 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -24,10 +24,6 @@ mapNixOS = mapSystems inputs.nixpkgs.lib.nixosSystem; inherit (import ./common.nix {inherit inputs self;}) darwin nixos server; in { - imports = [ - ./deploy.nix - ]; - flake = { darwinConfigurations = mapDarwin { caroline = { @@ -76,4 +72,8 @@ in { inherit (inputs) openwrt-imagebuilder; }); }; + + perSystem = {system, ...}: { + apps = (inputs.nixinate.nixinate.${system} self).nixinate; + }; } diff --git a/systems/deploy.nix b/systems/deploy.nix deleted file mode 100644 index 186ff37..0000000 --- a/systems/deploy.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - lib, - inputs, - self, - ... -}: let - targets = ["atlas"]; - - getDeploy = pkgs: - (import pkgs.path { - inherit (pkgs) system; - overlays = [ - inputs.deploy.overlay - (_: prev: { - deploy-rs = { - inherit (pkgs) deploy-rs; - inherit (prev.deploy-rs) lib; - }; - }) - ]; - }) - .deploy-rs; - - getType = pkgs: - if pkgs.stdenv.isDarwin - then "darwin" - else "nixos"; - - toDeployNode = hostname: system: { - sshUser = "root"; - inherit hostname; - profiles.system.path = (getDeploy system.pkgs).lib.activate.${getType system.pkgs} system; - }; -in { - flake.deploy = { - remoteBuild = true; - fastConnection = false; - nodes = lib.pipe (self.nixosConfigurations // self.darwinConfigurations) [ - (lib.getAttrs targets) - (lib.mapAttrs toDeployNode) - ]; - }; -} |
