!BgJZHVOYkwVcEKLAyM:nixos.org

NixOS Deployments

1249 Members
NixOS Deployment tooling309 Servers

Load older messages


SenderMessageTime
29 Jun 2021
@noah:matrix.chatsubo.cafeChurch Zhaofeng Li Is there a command to build and apply? Rather then having to seperately run both operations? 21:51:57
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @noah:matrix.chatsubo.cafe
Zhaofeng Li Is there a command to build and apply? Rather then having to seperately run both operations?
apply automatically builds. apply defaults to apply switch and build is just a alias to apply build
21:57:22
@zhaofeng:zhaofeng.liZhaofeng Li So it's apply [nixos-rebuild target] 21:57:26
@noah:matrix.chatsubo.cafeChurchOh awesome, so switching from nixops should be painless then.21:58:12
@noah:matrix.chatsubo.cafeChurchGroovy21:58:14
@noah:matrix.chatsubo.cafeChurchNow I just need a util to mirror and rewrite flakes so I can serve them from my git instance.21:58:38
@noah:matrix.chatsubo.cafeChurch Zhaofeng Li Question, is colomena able to tell if there's no changes on a node and therefore do nothing? That is one complaint I have of nixops, by default it makes a generation per run even if there's no changes. 23:55:28
30 Jun 2021
@zhaofeng:zhaofeng.liZhaofeng LiIt shouldn't unless the system derivation is different, and this should be true for normal nixos-rebuild as well. I just tested by deploying to the local machine, and the second deployment didn't result in a new generation link.00:00:39
@noah:matrix.chatsubo.cafeChurchCool, thanks00:06:08
@dev.hell:matrix.orgdev.hell
In reply to @zhaofeng:zhaofeng.li
Ah, great timing. I've been working on a stateless deployment tool called Colmena, which just got Flakes support today: https://github.com/zhaofengli/colmena
That looks pretty awesome! As NixOps seems to be dying I've been looking for a good replacement that could ideally also act as a drop-in replacement with minimal modifications. Colmena looks very promising, thank you!
08:54:45
@cw:kernelpanic.cafecw (novus ordo seclorum) changed their display name from cw (28 cycles) to cw (Vi/Vim).16:27:38
@noah:matrix.chatsubo.cafeChurch Zhaofeng Li: Question, when specifying a specific nixpkgs for a node can I supply it a URL? A la https://github.com/nixos/nixpkgs/archive/master.tar.gz? 21:23:40
@zhaofeng:zhaofeng.liZhaofeng Li
In reply to @noah:matrix.chatsubo.cafe
Zhaofeng Li: Question, when specifying a specific nixpkgs for a node can I supply it a URL? A la https://github.com/nixos/nixpkgs/archive/master.tar.gz?
builtins.fetchTarball should work
21:26:08
@noah:matrix.chatsubo.cafeChurch

So like the following:

nodeNixpkgs = {                                                             
      memx = "${builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/65c9cc79f1d179713c227bf447fb0dac384cdcda.tar.gz}";
    }; 
21:28:23
@zhaofeng:zhaofeng.liZhaofeng Li

Like

builtins.fetchTarball {
  url = "https://github.com/NixOS/nixpkgs/archive/65c9cc79f1d179713c227bf447fb0dac384cdcda.tar.gz";
  sha256 = [hash here];
}
21:29:26
@noah:matrix.chatsubo.cafeChurch

Zhaofeng Li: So I've got the following hive.nix

{
  meta = {
    nixpkgs = <nixpkgs>;

    nodeNixpkgs = {
      memx = builtins.fetchTarball {
	url = "https://github.com/NixOS/nixpkgs/archive/65c9cc79f1d179713c227bf447fb0dac384cdcda.tar.gz";
	sha256 = "0whxlm098vas4ngq6hm3xa4mdd2yblxcl5x5ny216zajp08yp1wf";
      };
    };
  };

  defaults = {
    imports = [ ./common ];
  };

  teapot = {
    deployment = {
      targetHost = "192.168.1.120";
      targetUser = "noah";
      replaceUnknownProfiles = false;
      tags = [ "infra" ];
    };

    imports = [
    ./machines/teapot
    "${builtins.fetchTarball https://github.com/rycee/home-manager/tarball/release-20.09}/nixos"
    ];
  };

  memex = {
    deployment = {
      targetHost = "192.168.1.235";
      targetUser = "noah";
      replaceUnknownProfiles = false;
      tags = [ "storage" "infra" ];
    };

    imports = [
    ./machines/memex
    ];
  };
}

I've pinned the nixpkgs for the memex node that way as it relies on the linux_5_9 kernel package which is no longer in tree.

However running colmena apply gives me:

noah@TEAPOT-BARON-TYBURN:~/code/NixOS-Home-Network$ colmena apply
[INFO ] Enumerating nodes...
error: attribute 'linux_5_9' missing, at /home/noah/code/NixOS-Home-Network/machines/memex/default.nix:101:34
(use '--show-trace' to show detailed location information)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NixFailure { exit_code: 1 }', src/command/apply.rs:121:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
21:51:10
@noah:matrix.chatsubo.cafeChurchSo as far as I figure it's not picking up it's pinned nixpkgs21:53:38
@zhaofeng:zhaofeng.liZhaofeng LiLooks like a typo. `memx` -> `memex`?22:12:46
@zhaofeng:zhaofeng.liZhaofeng LiI should probably add a warning if you are trying to override Nixpkgs for a non-existent node22:13:06
@noah:matrix.chatsubo.cafeChurchSigh doy22:15:17
@noah:matrix.chatsubo.cafeChurch

Okay now I'm seeing

noah@TEAPOT-BARON-TYBURN:~/code/NixOS-Home-Network$ colmena apply
[INFO ] Enumerating nodes...
error: meta.nodeNixpkgs.memex must be one of:

- A path to Nixpkgs (e.g., <nixpkgs>)
- A Nixpkgs lambda (e.g., import <nixpkgs>)
- A Nixpkgs attribute set
22:15:26
@noah:matrix.chatsubo.cafeChurchSo I can only assume something is off with how I'm pulling my revision down...22:15:50
@noah:matrix.chatsubo.cafeChurchLet's se22:15:52
@noah:matrix.chatsubo.cafeChurch * Let's see22:15:53
@noah:matrix.chatsubo.cafeChurchOkay fixed that finally.22:32:49
@noah:matrix.chatsubo.cafeChurch Zhaofeng Li: Final question I think, have you been able to manage aarch64 machines from an x64 machine at all? 22:58:51
@noah:matrix.chatsubo.cafeChurch

I've got the following flags in my aarch64 machines config to allow for cross compiling:

nixpkgs.system = "aarch64-linux";                                             
nixpkgs.crossSystem.system = "aarch64-linux";```
23:01:51
@noah:matrix.chatsubo.cafeChurch *

I've got the following flags in my aarch64 machines config to allow for cross compiling:

nixpkgs.system = "aarch64-linux";                                             
nixpkgs.crossSystem.system = "aarch64-linux";
23:01:58
@noah:matrix.chatsubo.cafeChurchAs well as the needed quemu stuff to allow for cross compiling with binfmt.23:02:11
@zhaofeng:zhaofeng.liZhaofeng Li No, I'm not deploying across architectures myself at the moment. But I think it should work if you either specify an aarch64-linux builder, or have extra-platforms = aarch64-linux in you nix config if you have binfmt set up 23:08:39

Show newer messages


Back to Room ListRoom Version: 6