diff options
author | Leonardo Santiago <[email protected]> | 2024-11-12 18:52:26 -0300 |
---|---|---|
committer | Leonardo Santiago <[email protected]> | 2024-11-12 18:52:26 -0300 |
commit | c5d18a901f615cca76cfbf95f75a38e7631e5cd5 (patch) | |
tree | fae7fc8ee8a72eab1af553339dee0fc61f142292 | |
parent | c49c5e8e9086e68010c45b65196b8669f106dbf9 (diff) |
use deploy-rs
-rw-r--r-- | flake.lock | 100 | ||||
-rw-r--r-- | flake.nix | 14 | ||||
-rw-r--r-- | modules/default-user.nix | 5 |
3 files changed, 108 insertions, 11 deletions
@@ -47,6 +47,26 @@ "type": "github" } }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1727447169, + "narHash": "sha256-3KyjMPUKHkiWhwR91J1YchF6zb6gvckCAY1jOE+ne0U=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "aa07eb05537d4cd025e2310397a6adcedfe72c76", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, "emacs-overlay": { "inputs": { "flake-utils": "flake-utils", @@ -85,9 +105,25 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1726560853, @@ -105,7 +141,7 @@ }, "home-manager": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1725180166, @@ -157,16 +193,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723175592, - "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", + "lastModified": 1702272962, + "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", + "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -189,6 +225,22 @@ }, "nixpkgs_2": { "locked": { + "lastModified": 1723175592, + "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { "lastModified": 1729880355, "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", "owner": "nixos", @@ -239,12 +291,13 @@ "root": { "inputs": { "agenix": "agenix", + "deploy-rs": "deploy-rs", "emacs-overlay": "emacs-overlay", "firefox-gnome-theme": "firefox-gnome-theme", "home-manager": "home-manager", "mixrank": "mixrank", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" } }, "systems": { @@ -276,6 +329,39 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", @@ -18,9 +18,10 @@ flake = false; }; mixrank.url = "git+ssh://[email protected]/mixrank/mixrank"; + deploy-rs.url = "github:serokell/deploy-rs"; }; - outputs = { self, nixpkgs, ... } @ inputs : let + outputs = { self, nixpkgs, deploy-rs, ... } @ inputs : let inherit (builtins) readDir attrNames listToAttrs split head; modules = map (p: ./modules/${p}) (attrNames (readDir ./modules)); make-config-named = host: nixpkgs.lib.nixosSystem { @@ -33,7 +34,16 @@ get-basename = n: head (split "\\." n); hosts-names = map get-basename (attrNames (readDir ./hosts)); nixos-configs = map (h: { name= h; value = make-config-named h;}) hosts-names; - in { + in rec { nixosConfigurations = listToAttrs nixos-configs; + deploy.nodes.iori = { + hostname = "ssh.santi.net.br"; + remoteBuild = true; + interactiveSudo = true; + profiles.system = { + user = "root"; + path = deploy-rs.lib.aarch64-linux.activate.nixos nixosConfigurations.iori; + }; + }; }; } diff --git a/modules/default-user.nix b/modules/default-user.nix index a1fb6fd..fce1f23 100644 --- a/modules/default-user.nix +++ b/modules/default-user.nix @@ -15,8 +15,9 @@ in { firefox.enable = mkEnableOption "Enables firefox"; }; config = mkIf config.santi-modules.default-user.enable { - environment.systemPackages = [ - pkgs.rage + environment.systemPackages = with pkgs; [ + rage + deploy-rs ] ++ (if cfg.mu.enable then [ pkgs.parallel ] else []); users.mutableUsers = false; users.users.leonardo = { |