!UKDpaKNNsBpOPfLWfX:zhaofeng.li

Colmena

316 Members
A simple, stateless NixOS deployment tool - https://github.com/zhaofengli/colmena107 Servers

Load older messages


SenderMessageTime
20 Nov 2022
@zhaofeng:zhaofeng.liZhaofeng Li So you were pinning to master for nixpkgs? 06:23:27
@cw:kernelpanic.cafeChinchilla Optional nixos-unstable 06:24:28
@cw:kernelpanic.cafeChinchilla OptionalMigrating 10k+ line config to flakes has been brutal to me. Nixos is already black magic enough on it's own06:29:47
@cw:kernelpanic.cafeChinchilla Optionalkinda got my laptop working, but I didn't want to pin shared systems to unstable06:30:31
@cw:kernelpanic.cafeChinchilla Optional Thanks again Zhaofeng Li , I'm building AND you fixed my hm issue 06:51:21
@omlet:matrix.org@omlet:matrix.org left the room.09:30:10
21 Nov 2022
@whentze:matrix.orgWanja Hentze
In reply to @cw:kernelpanic.cafe
Migrating 10k+ line config to flakes has been brutal to me. Nixos is already black magic enough on it's own
reading this makes me a bit glad I use only vanilla NixOS with no home-manager or flakes for now ๐Ÿ˜…
11:44:43
@buckley310:matrix.orgBuckleyreading this makes me a bit glad I switched to flakes early ๐Ÿคฃ14:42:43
22 Nov 2022
@rttti:matrix.org@rttti:matrix.org joined the room.23:23:51
24 Nov 2022
@ask-yourself:matrix.org@ask-yourself:matrix.org joined the room.17:51:26
@ask-yourself:matrix.org@ask-yourself:matrix.org

Hey there, I was redirected here after asking in Matrix Disocrd #general.

So I've got all my machines set up with Colmena. I can build the config for any machine locally on said machine with colmena apply-local, however I'm having trouble pushing a build from my main machine to my laptop. I've set up an ssh key, so I can ssh into my laptop with ssh isaac@localip with no password. But when I run sudo colmena apply --to laptop from my main PC, I get this:

โฏ sudo colmena apply --on laptop
[sudo] password for isaac:
[INFO ] Using flake: git+file:///home/isaac/.dotfiles
[INFO ] Enumerating nodes...
[INFO ] Selected 1 out of 2 hosts.
       โŒ 4s Failed: Child process exited with error code: 1
laptop โœ… 4s Evaluated laptop
laptop โœ… 0s Built "/nix/store/klgnlk5l0cbx6yzn6xcfn6w4hbbmhp51-nixos-system-laptop-23.05pre-git"
laptop โŒ 0s Push failed: Child process exited with error code: 1
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to push system closure to laptop - Last 5 lines of logs:
[ERROR]  created)
[ERROR]    state) Running
[ERROR]   stderr) ssh: Could not resolve hostname laptop: Name or service not known
[ERROR]   stderr) error: cannot connect to 'isaac@laptop'
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1

Could anyone clarify how to fix this? My one buddy somehow got it working with SOPS but IDK really what to do.

17:56:02
@ask-yourself:matrix.org@ask-yourself:matrix.org *

Hey there, I was redirected here after asking in Matrix Discord #general.

So I've got all my machines set up with Colmena. I can build the config for any machine locally on said machine with colmena apply-local, however I'm having trouble pushing a build from my main machine to my laptop. I've set up an ssh key, so I can ssh into my laptop with ssh isaac@localip with no password. But when I run sudo colmena apply --to laptop from my main PC, I get this:

โฏ sudo colmena apply --on laptop
[sudo] password for isaac:
[INFO ] Using flake: git+file:///home/isaac/.dotfiles
[INFO ] Enumerating nodes...
[INFO ] Selected 1 out of 2 hosts.
       โŒ 4s Failed: Child process exited with error code: 1
laptop โœ… 4s Evaluated laptop
laptop โœ… 0s Built "/nix/store/klgnlk5l0cbx6yzn6xcfn6w4hbbmhp51-nixos-system-laptop-23.05pre-git"
laptop โŒ 0s Push failed: Child process exited with error code: 1
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to push system closure to laptop - Last 5 lines of logs:
[ERROR]  created)
[ERROR]    state) Running
[ERROR]   stderr) ssh: Could not resolve hostname laptop: Name or service not known
[ERROR]   stderr) error: cannot connect to 'isaac@laptop'
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1

Could anyone clarify how to fix this? My one buddy somehow got it working with SOPS but IDK really what to do.

17:56:20
@ask-yourself:matrix.org@ask-yourself:matrix.orgFor reference, these are my dotfiles; and the system I'm trying to build is in ./nixos/laptop: https://gitlab.com/IsaacBrown92/dotfiles17:56:54
@linus:schreibt.jetzt@linus:schreibt.jetzt Ask Yourself๐Ÿ‰: you need to specify deployment.targetHost as an address under which it can reach the laptop 17:57:32
@linus:schreibt.jetzt@linus:schreibt.jetztso one possibility would be the local IP address17:57:46
@ask-yourself:matrix.org@ask-yourself:matrix.org

So that I have tried:


      laptop = {
        deployment = {
          allowLocalDeployment = true;
          tags = ["laptop"];
          targetUser = "isaac";
          targetHost = "10.0.0.22";
        };

        imports = [
          ./nixos/laptop
          home-manager.nixosModules.home-manager
          {
            home-manager = {
              extraSpecialArgs = {
                inherit user;
              };
              useGlobalPkgs = true;
              users.${user} = {
                imports = [(import ./nixos/laptop/home-manager.nix)];
              };
              useUserPackages = true;
            };
          }
        ];
      };

But I get this:

โฏ sudo colmena apply --on laptop
warning: Git tree '/home/isaac/.dotfiles' is dirty
[INFO ] Using flake: git+file:///home/isaac/.dotfiles
[INFO ] Enumerating nodes...
warning: Git tree '/home/isaac/.dotfiles' is dirty
warning: Git tree '/home/isaac/.dotfiles' is dirty
warning: Git tree '/home/isaac/.dotfiles' is dirty
[INFO ] Selected 1 out of 2 hosts.
       โŒ 5s Failed: Child process exited with error code: 1
laptop โœ… 4s Evaluated laptop
laptop โœ… 0s Built "/nix/store/klgnlk5l0cbx6yzn6xcfn6w4hbbmhp51-nixos-system-laptop-23.05pre-git"
laptop โŒ 0s Push failed: Child process exited with error code: 1
[ERROR] Failed to push system closure to laptop - Last 5 lines of logs:
[ERROR]  created)
[ERROR]    state) Running
[ERROR]   stderr) isaac@10.0.0.22: Permission denied (publickey,password,keyboard-interactive).
[ERROR]   stderr) error: cannot connect to 'isaac@10.0.0.22'
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
18:00:31
@ask-yourself:matrix.org@ask-yourself:matrix.org It looks the the error you get when ssh is messed up, but ssh 10.0.0.22 works perfectly w/o password. 18:01:27
@NobbZ:matrix.org@NobbZ:matrix.org joined the room.18:19:22
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @ask-yourself:matrix.org

So that I have tried:


      laptop = {
        deployment = {
          allowLocalDeployment = true;
          tags = ["laptop"];
          targetUser = "isaac";
          targetHost = "10.0.0.22";
        };

        imports = [
          ./nixos/laptop
          home-manager.nixosModules.home-manager
          {
            home-manager = {
              extraSpecialArgs = {
                inherit user;
              };
              useGlobalPkgs = true;
              users.${user} = {
                imports = [(import ./nixos/laptop/home-manager.nix)];
              };
              useUserPackages = true;
            };
          }
        ];
      };

But I get this:

โฏ sudo colmena apply --on laptop
warning: Git tree '/home/isaac/.dotfiles' is dirty
[INFO ] Using flake: git+file:///home/isaac/.dotfiles
[INFO ] Enumerating nodes...
warning: Git tree '/home/isaac/.dotfiles' is dirty
warning: Git tree '/home/isaac/.dotfiles' is dirty
warning: Git tree '/home/isaac/.dotfiles' is dirty
[INFO ] Selected 1 out of 2 hosts.
       โŒ 5s Failed: Child process exited with error code: 1
laptop โœ… 4s Evaluated laptop
laptop โœ… 0s Built "/nix/store/klgnlk5l0cbx6yzn6xcfn6w4hbbmhp51-nixos-system-laptop-23.05pre-git"
laptop โŒ 0s Push failed: Child process exited with error code: 1
[ERROR] Failed to push system closure to laptop - Last 5 lines of logs:
[ERROR]  created)
[ERROR]    state) Running
[ERROR]   stderr) isaac@10.0.0.22: Permission denied (publickey,password,keyboard-interactive).
[ERROR]   stderr) error: cannot connect to 'isaac@10.0.0.22'
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
Don't use sudo when deploying remotely.
20:37:34
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @ask-yourself:matrix.org

So that I have tried:


      laptop = {
        deployment = {
          allowLocalDeployment = true;
          tags = ["laptop"];
          targetUser = "isaac";
          targetHost = "10.0.0.22";
        };

        imports = [
          ./nixos/laptop
          home-manager.nixosModules.home-manager
          {
            home-manager = {
              extraSpecialArgs = {
                inherit user;
              };
              useGlobalPkgs = true;
              users.${user} = {
                imports = [(import ./nixos/laptop/home-manager.nix)];
              };
              useUserPackages = true;
            };
          }
        ];
      };

But I get this:

โฏ sudo colmena apply --on laptop
warning: Git tree '/home/isaac/.dotfiles' is dirty
[INFO ] Using flake: git+file:///home/isaac/.dotfiles
[INFO ] Enumerating nodes...
warning: Git tree '/home/isaac/.dotfiles' is dirty
warning: Git tree '/home/isaac/.dotfiles' is dirty
warning: Git tree '/home/isaac/.dotfiles' is dirty
[INFO ] Selected 1 out of 2 hosts.
       โŒ 5s Failed: Child process exited with error code: 1
laptop โœ… 4s Evaluated laptop
laptop โœ… 0s Built "/nix/store/klgnlk5l0cbx6yzn6xcfn6w4hbbmhp51-nixos-system-laptop-23.05pre-git"
laptop โŒ 0s Push failed: Child process exited with error code: 1
[ERROR] Failed to push system closure to laptop - Last 5 lines of logs:
[ERROR]  created)
[ERROR]    state) Running
[ERROR]   stderr) isaac@10.0.0.22: Permission denied (publickey,password,keyboard-interactive).
[ERROR]   stderr) error: cannot connect to 'isaac@10.0.0.22'
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
* Don't use sudo when deploying remotely. In this case, I guess root doesn't have the keys to connect to 10.0.0.22
20:37:51
@ask-yourself:matrix.org@ask-yourself:matrix.orgHmm. Ok, thanks that fixed the first error. But I must admit I'm equally confused by this new one:20:46:07
@ask-yourself:matrix.org@ask-yourself:matrix.org
โžœ colmena apply --on laptop
[INFO ] Using flake: git+file:///home/isaac/.dotfiles
[INFO ] Enumerating nodes...
[INFO ] Selected 1 out of 4 hosts.
       โŒ 6s Failed: Child process exited with error code: 1
laptop โœ… 5s Evaluated laptop
laptop โœ… 0s Built "/nix/store/9zsi0h4lbmnj9hggbg8vzxr1mhy1wqw3-nixos-system-laptop-23.05pre-git"
laptop โŒ 1s Push failed: Child process exited with error code: 1
[ERROR] Failed to complete requested operation - Last 1 lines of logs:
[ERROR]  failure) Child process exited with error code: 1
[ERROR] Failed to push system closure to laptop - Last 9 lines of logs:
[ERROR]  created)
[ERROR]    state) Running
[ERROR]   stderr) copying 10 paths...
[ERROR]   stderr) copying path '/nix/store/3ddp6lnxxi98gb43rgqx6531n94ygcpl-home-manager-path' to 'ssh://isaac@10.0.0.22'...
[ERROR]   stderr) error: cannot add path '/nix/store/3ddp6lnxxi98gb43rgqx6531n94ygcpl-home-manager-path' because it lacks a valid signature
[ERROR]   stderr) copying path '/nix/store/jdc1w4iw3dd1n5rz257awxld13hs45f5-starship-config' to 'ssh://isaac@10.0.0.22'...
[ERROR]   stderr) error (ignored): error: writing to file: Broken pipe
[ERROR]   stderr) error: unexpected end-of-file
[ERROR]  failure) Child process exited with error code: 1
[ERROR] -----
[ERROR] Operation failed with error: Child process exited with error code: 1
20:46:15
@ask-yourself:matrix.org@ask-yourself:matrix.orgNot sure why it's unhappy with HM.20:46:22
@zhaofeng:zhaofeng.liZhaofeng Li You have to be a trusted user to copy arbitrary paths into a remote store. Either add isaac into nix.settings.trusted-users (warning: they are root-equivalent) or use root 20:48:08
@ask-yourself:matrix.org@ask-yourself:matrix.orgOhhhhhhhh.20:48:28
@ask-yourself:matrix.org@ask-yourself:matrix.orgOk lemme try that.20:48:30
@ask-yourself:matrix.org@ask-yourself:matrix.orgIs there a reason why it would be complaining about a password when I have an SSH key setup?20:53:40
@ask-yourself:matrix.org@ask-yourself:matrix.org I can ssh in with ssh isaac@10.0.0.2 without needing a password. 20:54:00
@zhaofeng:zhaofeng.liZhaofeng Li It still needs root when running the activation script, so during activation it will try to use sudo to become root. 20:55:05
@ask-yourself:matrix.org@ask-yourself:matrix.org How can I give it the ability to use sudo? 20:57:23

Show newer messages


Back to Room ListRoom Version: 6