EmergentMind
EmergentMind
  • 8
  • 18 487
NixOS Automated Remote Bootstrapping with Secrets - Part 2 A Brief Overview of the Tools Used
Part 2 in my series on automating the installion of NixOS, generation of keys for sops secrets, and building of nix-config on a remote host.
Subsequent parts will be released as soon as they are available.
OUTLINE
0:00 Introduction
0:45 nixos-anywhere
2:15 Custom NixOS ISO image
2:57 disko - declarative disk partitioning
4:08 just - recap and reference to dedicated video
OTHER VIDEOS IN THIS SERIES
Part 1: ua-cam.com/video/4snnV3hdz7g/v-deo.html
SUPPORT
If you find what I do helpful, please consider supporting my work on Ko-fi.
ko-fi.com/unmovedcentre
I intentionally keep my content ad free. See below for a list of supporters.
ADDITIONAL MATERIAL
- My nix-config on GitHub: github.com/EmergentMind/nix-config
- A related article on my website Unmoved Centre:
unmovedcentre.com/technology/2024/06/07/remote-install-nixos-config.html
RELATED VIDEOS
- Nix-Config workflow recipes using just: ua-cam.com/video/wQCV0QgIbuk/v-deo.html
- Structural anatomy of my nix-config: ua-cam.com/video/YHm7e3f87iY/v-deo.html
- Sops and secrets management in NixOS: ua-cam.com/video/6EMNHDOY-wo/v-deo.html
EXTERNAL REFERENCES
- nixos-anywhere: github.com/nix-community/nixos-anywhere/
- Official NixOS images: nixos.org/download/
- Building a bootable ISO image: nix.dev/tutorials/nixos/building-bootable-iso-image
- disko: github.com/nix-community/disko
- just: github.com/casey/just
CONNECT
- Subscribe to this UA-cam channel
- My website: www.unmovedcentre.com
- X / Twitter: emergent_mind
- GitHub: github.com/EmergentMind
- GitLab: gitlab.com/emergentmindf
THANK YOU TO MY GENEROUS SUPPORTERS!
- ForresGeek
Переглядів: 271

Відео

NixOS Automated Remote Bootstrapping with Secrets - Part 1
Переглядів 68414 днів тому
Part 1 in my series on automating the installion of NixOS, generation of keys for sops secrets, and building of nix-config on a remote host. This series will be at least 4 parts long. Part 2 will be available within the week and subsequent parts will be released as soon as they are available. OUTLINE 0:00 Introduction 0:24 Objective and things to note 2:10 Automation demo 5:13 Overview of what ...
Anatomy of a NixOS Config - Part 2/2
Переглядів 54414 днів тому
*Apologies for the loss of previously submitted comments on this video. While editing the subtitles, I deleted what I thought was an old version of the subtitles and realized only afterwards that I had deleted the entire video. The UX for subtitle editing in UA-cam is awful* Part 2 of 2 in a description of the structure of my multi-user, multi-system NixOS configuration. This video gradually bu...
Nix-Config Workflow Recipes Using Just
Переглядів 2,2 тис.Місяць тому
A quck video explaing how I use the 'just' utility to streamline working with my nix-config. Check out the links below for related content and the repos mentioned in this video. OUTLINE 0:00 Introduction 0:31 Installation in nix-config 0:42 Example justfile 0:58 My nix-config justfile 1:20 Listing recipes with a default recipe 1:33 Flake rebuild related recipes (rebuild, rebuild-full, rebuild-p...
NixOS Secrets Management - Part 3/3
Переглядів 1 тис.2 місяці тому
Part 3 of 3 in my series on secrets management in NixOS using sops-nix as a part of a nix-config. This video covers storing secrets in a private repository, separate from the rest of nix-config and then inputing them into the flake. OUTLINE 00:00 intro 00:19 objective 1:16 private repository 1:52 .ssh/config 2:58 flake.nix edits 3:30 sops.nix edits 4:07 first nixos rebuild with the private repo...
NixOS Secrets Management - Part 2/3
Переглядів 2 тис.2 місяці тому
Part 2 of 3 in my series on secrets management in NixOS using sops-nix as a part of a nix-config. The series covers information about sops, generating keys, storing secrets, programmatic access, and storing secrets in private repository separate from your main, nix-config repo. OUTLINE 00:10 sops.nix 2:08 extracting msmtp credentials 3:11 extracting a user password 4:40 home-level ssh private k...
NixOS Secrets Management - Part 1/3
Переглядів 5 тис.2 місяці тому
Part 1 of 3 in my series on secrets management in NixOS using sops-nix as a part of a nix-config. The series covers information about sops, generating keys, storing secrets, programmatic access, and storing secrets in private repository separate from your main, nix-config repo. OUTLINE 0:00 Introduction 0:32 Thank you 0:43 Sops overview 2:45 Enabling sops-nix 3:16 Access keys 4:15 Generating ke...
Anatomy of a NixOS Config - Part 1/2
Переглядів 7 тис.3 місяці тому
Part 1 of 2 in a description of the structure of my multi-user, multi-system NixOS configuration. This video gradually builds out a visual diagram of the structure while explaining the purpose of each part and how they all fit together. OUTLINE 0:00 Introduction 1:10 Central staging area 2:15 Inputs 4:09 Outputs overview 4:26 Custom modules 5:09 Pathing clarification 5:25 Overlays 6:22 Custom p...

КОМЕНТАРІ

  • @Medan1993
    @Medan1993 День тому

    For 6:09 I had some issues with using nix-shell command in that format, so instead I went with "nix shell nixpkgs#age -c age-keygen -y ~/.config/sops/age/keys.txt" However the other one was working so no issues there.

  • @thepinkunicorn6
    @thepinkunicorn6 День тому

    Small correction, at 6:15 after the -p flag it needs to just be "age", not "age-keygen" :)

  • @anasouardini
    @anasouardini 2 дні тому

    Audio really low.

    • @Emergent_Mind
      @Emergent_Mind 2 дні тому

      Thanks for the feedback and for watching. Audio levels were improved on subsequent videos.

  • @con-f-use
    @con-f-use 5 днів тому

    Why a windy bash-script and not nixos-anywhere?

    • @Emergent_Mind
      @Emergent_Mind 4 дні тому

      Nixos-anywhere is one of the tools used here for getting a minimal version of the flake installed. It falls short for installing the full version of the flake because that one inputs secrets from a separate private repo. I talk a little bit about this in Part 2 and will go over it more thoroughly in forthcoming videos. Thanks for watching and commenting.

  • @eduardabramovich1216
    @eduardabramovich1216 6 днів тому

    It looks like this playlist is not ordered, or yes? Should i follow the tutorials in the order they were added?

    • @Emergent_Mind
      @Emergent_Mind 5 днів тому

      Thanks for pointing this out. One of my videos was accidentally deleted and I didn't realize the playlist was affected. The playlist should be in the correct order now. Thanks for watching.

    • @eduardabramovich1216
      @eduardabramovich1216 5 днів тому

      @@Emergent_Mind Thanks!

  • @filedotjar
    @filedotjar 8 днів тому

    Just so you know, the link to part one is broken. It points to the video on studio.youtube.com, not the actual video.

    • @Emergent_Mind
      @Emergent_Mind 5 днів тому

      Thank you for pointing this out, it has be fixed now. Thanks for watching!

  • @aaklevtsov
    @aaklevtsov 10 днів тому

    just is good but go-task is better, imho.

    • @Emergent_Mind
      @Emergent_Mind 9 днів тому

      Any particular reason why? I hadn't heard of it until now but will have a look. Thanks for watching and commenting!

    • @aaklevtsov
      @aaklevtsov 9 днів тому

      @@Emergent_Mind go templates, include other task files (including remotes), parallel execution for the deps.

  • @mars_0008
    @mars_0008 11 днів тому

    Hey, i am trying to do a similar thing but with a slightly different approach. My approach is simpler but i wonder if it is too simple and i am misunderstanding something. Essentially i have a Yubikey with my gpg private keys. i would like sops-nix to use these keys to provision the secrets. That's it. There is no dependency on the machine specific ssh key and therefore no need to edit the .sops.yaml file and sops update the secrets file. I simply just need to have the same hardcoded gpg key in sops.yaml which works with the YubiKey. I feel like this is a efficient and tidy solution to the bootstrapping of trust issue. Do you think this will work? Would be great to hear your feedback. Keep up the great content too, looking forward to the next video in the series.

    • @Emergent_Mind
      @Emergent_Mind 9 днів тому

      Yeah, that should work. If you were planning to use my script as a starting point, removing the key generation lines would be quite trivial. Per-host keys is just a personal requirement/preference so eliminating the complexity should simplify the process for you. Also, remember that if you're hosting your secrets in a private repo you'll have to ensure the target host can access the repo itself during build. Sort of unrelated and also not a requirement but just mentioning as it can be easy to forget the little steps. Let me know how you make out. Thanks for watching and commenting!

    • @mars_0008
      @mars_0008 9 днів тому

      ​@@Emergent_Mind thanks, i have made some posts on reddit too but don't think i am allowed to link on YT. On reddit, someone has mentioned (and has been liked by others) "The pgp key is used by you (the user) to encrypt and decrypt the secrets when you need to modify them or add new ones. The machine on the other hand needs to decrypt the secrets when it switches to a new configuration, or when booting." So now i am unsure because it contradicts your point above :| it would be really good to see basic "hello world" examples showing the different ways the yubikey can be used with sops-nix. All the configs i have come across so far seem quite complex and opinionated. Also would be great if there was a way to contact you on some other medium to discuss (couldn't find any contact details on your profile/website). Thanks!

    • @Emergent_Mind
      @Emergent_Mind 5 днів тому

      I would have to dig into this a little more to be sure but as long as you're able to store your pgp keys on a given host and configure it to use those keys then it should work. It's non-typical I suppose, which is likely where the reddit comment is coming from but again, I'd have to do some looking and experimentation to confirm. Regarding contact info, I pushed an update to my website yesterday and you can now find an email link in the footer. Contact me there and I'll see try to block a little bit of time to help. I do plan on revisiting some of the secrets management content in the future to cover more of the basics and provide some more detailed examples. I'm not sure when that will be at this point.

  • @akibahmed229
    @akibahmed229 12 днів тому

    Eagerly waiting ....

  • @akibahmed229
    @akibahmed229 12 днів тому

    Sounds like fun

  • @adrianscarlett
    @adrianscarlett 15 днів тому

    Some really interesting info here. I'm in the process of learning nix right now. I was hoping the nixos installer would just let you give it a github url containing a config. Would full automation be possible using the yubikey plus public keys hosted on github?

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      One of the tools used in this process is nixos-anywhere, which will allow you to provide a github url to a config. I'll be going over it and how it's used in upcoming videos but in the mean time you can check it out here: github.com/nix-community/nixos-anywhere However, if you're using secrets in similar manner to how I do, when the config builds on the target, it needs private keys to successfully access the private repo where the encrypted secrets are stored and also to decrypt the secrets. The private keys have to exist on the target so there's a chicken and egg scenario. Yubikey and public keys will still require the private key to exist on the target. I think you can get around it by using the shortened process steps I mention in the video but haven't tested it to confirm. If you go that route let me know how you make out Thanks for watching!

  • @thebutlah
    @thebutlah 15 днів тому

    Won't storing the secrets in the nix store be a problem? Are the secrets in the store encrypted or unencrypted?

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      Great question. The secrets are always in an encrypted state while in nix store. When sops extracts the secrets (during the activation phase of nixos) they are owned by root:root adn stored in /run/secrets.d which is owned by root:keys and only exists during run time. There is pretty good information about this on the sops-nix repo if you're interested in learning more: github.com/Mic92/sops-nix Thanks for watchign!

  • @Raftzard
    @Raftzard 15 днів тому

    NIce! Once I have the time, I am ought to try this out on my spare hd. Would it be difficult to build this on my machine? I would think, of the top of my head to: change hardware-confi.nix, keyboard, check for amd config (I'm all amd here). Would that be enough? Thank you!

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      You would have to change a few things related to secrets management that were added after this video was recorded. This was a repost due to an accidental deletion of the original. The config now takes an input from a private repository and references several values throughout. If you watch my series on NixOS Secrets Management and read through the accompanying article on my website you should be able to get it set up. Aside from that, you're correct a few small changes like you noted should be sufficient. I would recommend however, making the changes to your own config over time in increments so that you get a good understanding of how it all connects. That's how I like to learn though so maybe not your preference. :) Thanks for watching!

    • @Raftzard
      @Raftzard 15 днів тому

      @@Emergent_Mind oh man, sorry to hear about the video. About the secrets management, tough, would it be simpler to just turn it off for my case? Or is it mandatory in the config?

    • @Emergent_Mind
      @Emergent_Mind 14 днів тому

      You could disable it but I haven't set it up as a toggleble option yet so you would have to manually comment out or remove the relevant parts

  • @zaiquiriw
    @zaiquiriw 15 днів тому

    Unfortunately I just spent the last 2 days trying to do this myself, only to get really frustrated with dealing with the ssh passkeys. I'm glad someone else solved my woes for me. Thank you very much.

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      I'm glad this will help you, it took quite a bit of effort to figure out and there is still room for improvement. Thanks for watching and commenting!

  • @MrPezetko
    @MrPezetko 16 днів тому

    You can specify pre/post dependencies on the command itself like this: rebuild: rebuild-pre && rebuild-post Will run "rebuild-pre", "rebuild" and "rebuild-post" in this order.

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      Thanks for this! So much to learn :)

  • @MarkRuvald
    @MarkRuvald 16 днів тому

    I think the context and problem has to be clarified a bit. E.g. I am interested in automated deployment of NixOS on bare-metal machines for regression test of small embedded systems. I wouldn't want to repeat this process for many machines. Too many prompts and the tether back to the init machine. Why not have it completely headless, let it generate keys ephemerally and publish its pub key?

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      You're correct about the context being specific and there is certainly room for refining the process. I'll make some improvements for the upcoming videos. Thank you for the suggestions, I appreciate it!

  • @gzoechi
    @gzoechi 16 днів тому

    That's a great video (again). The only thing missing is the setup for network boot from the minimal image 😉 I don't copy the config to the target. It's not clear to me what the benefit is. I execute every nixos-rebuild from my main work machine and then just use `--target-host` to apply it to a specific host. Also it seems easier to create the host SSH key before deploying, instead of adding the key created on the target host to the config (I'm not sure if I have thought it through completely though).

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      I so rarely use network boot that it didn't cross my mind but I probably should make better use of it tbh. Using '--target-host' would be ideal but requires NixOS on the source machine, which unfortunately isn't convenient for me at the moment. Perhaps adding the option for executing it one way or the other would be a good prompt to add. Re: host SSH key. I think there was a specific reason why we generate it on the target instead but I can't remember. Thanks for the comment and suggestions!

    • @lordkekz4
      @lordkekz4 15 днів тому

      @@Emergent_Mind If you generate the private host key on the source machine, you have to get it to the target machine safely. If someone records the ssh traffic of the installation and eventually decrypts it, the ssh key would be compromised. I'm setting up Laptop/Desktop systems with disko-install and there it's fine to generate host keys on the source machine because they only get written to the new boot drive, not sent over any network.

    • @Emergent_Mind
      @Emergent_Mind 15 днів тому

      That's a valid point. In my case all of the targets are on a local network so the risk of exposure is lower.

    • @gzoechi
      @gzoechi 15 днів тому

      @@lordkekz4 How is it unsafe to scp them to the target host (with password login the first time)?

    • @gzoechi
      @gzoechi 15 днів тому

      @@Emergent_Mind I do every ops stuff from a dedicated NixOS VM

  • @danieljakob1307
    @danieljakob1307 16 днів тому

    Brilliant first entry to this series. How many parts can we expect and when?

    • @Emergent_Mind
      @Emergent_Mind 16 днів тому

      Thank for the compliment. I intend to have part two published sometime this week and expect that there will be at least four parts at the typical ~10 minute mark.

  • @lordkekz4
    @lordkekz4 16 днів тому

    Nice, I'm always looking for some inspiration as to how others manage their configs! I'm using a sort of "profiles" system (has nothing to do with the various "profiles" terms that you might know from NixOS), where I group modules which commonly appear together (e.g. common, terminal, graphical, KDE, Hyprland, headless) and describe hosts and home configs by importing one or multiple of these profiles. I have three kinds of profiles: hardwareProfiles (for disk partitions and such), nixosProfiles and homeProfiles. But right now I'm noticing that my setup makes it ugly to share configuration (such as Stylix) between nixosProfiles and homeProfiles.

    • @Emergent_Mind
      @Emergent_Mind 16 днів тому

      Thanks for commenting and watching. I ran across some configs similar to what you describe when I started out. It's fascinating how there are so many effective ways to go about it.

  • @gzoechi
    @gzoechi 17 днів тому

    Great video and exactly the right time for me🚀 Can the user SSH key deployed this way be used by the HomeManager sops module to decrypt user secrets? I made a few attempts before I found this video and it didn't look like it's possible (that the SSH key needs to be deployed in advance), but there were a few new things in this video I have yet to try.

    • @Emergent_Mind
      @Emergent_Mind 16 днів тому

      Hi thanks for the compliment! I'm glad it was good timing for you. If I'm understanding your question correctly, the user key would indeed have to be deployed in advance because the user won't have read permissions to the ssh service private key. However, you can get around by storing the user key in your secrets and extracting it to the users home prior to the homemanager sops module firing. We actually incorporated this into the config recently. See line 35 in github.com/EmergentMind/nix-config/blob/dev/hosts/common/core/sops.nix Note also, that I've also moved to having a distinct age key for the user on each host as opposed to a single dev key. Hope that helps, let me know how you make out :)

    • @gzoechi
      @gzoechi 16 днів тому

      @@Emergent_Mind Thanks a lot. That's what I didn't know, if home-manager fires after the other Nix config when used as a module. I'll check how you did it in your config.

  • @HerrSnooze
    @HerrSnooze 22 дні тому

    How do make those beautiful diagrams in the beginning of the video?

    • @Emergent_Mind
      @Emergent_Mind 22 дні тому

      I use a program called draw.io to make the diagrams. It takes a little while but I find it enjoyable.

  • @Dyrgrip
    @Dyrgrip 23 дні тому

    Awesome content! Thank you for sharing your secrets! :)

  • @luisliz
    @luisliz 25 днів тому

    Holly shit can’t believe the insane quality of nix UA-camrs that is starting out. Tyyyyyy!!!

  • @anonymouscommentator
    @anonymouscommentator Місяць тому

    i dont quite get how this is any different to calling a shell script

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      In some ways they are not much different and there is certainly overlap in basic utility. However, just (and make for that matter) are declaritve in nature whereas bash scripts are imperative. Granted, my examples and use case at the moment don't really demonstrate that. Thanks for watching and commenting!

    • @anonymouscommentator
      @anonymouscommentator Місяць тому

      @@Emergent_Mind thanks for the clarification!

  • @jahanson
    @jahanson Місяць тому

    Do you only need to stage and not commit? I thought you had to commit.

    • @khwpp5943
      @khwpp5943 Місяць тому

      stage only; git add'ing suffices.

  • @Peter1215
    @Peter1215 Місяць тому

    Just is really cool, I'm using it it almost every project (mostly infra/k8s focused). One thing I found very useful is combining just recipes with direnv variables if you have sensitive data somewhere. I also found that inlining the scripts is more readable than referencing them via separate files, the just file is bigger, but everything is more accessible. On the nix side, I tried to dive into it a few times but was always put off by the quirky syntax and just overall complexity, but maybe with justfile I might give it another try.

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Combining with direnv is a cool idea! Nix is a bit daunting given it's differences from the 'norm'. The declarative aspect is what ultimately sold me on diving into it. Let me know how it goes if you do give it another try :) Thanks for watching!

  • @bew
    @bew Місяць тому

    I'd suggest using `git add -N *` instead of bare `git add *`, to only add the files to be known to git, WITHOUT adding them to the staging area. For the justfile itself, I personally use `{{ just_executable() }}` instead of `just` in receipes, so I can easily bootstrap things without having `just` in $PATH using `nix run nixpkgs#just rebuild-stuff`

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Excellent suggestion, I'll look into adding this to my file. Thanks for watching!

  • @ttrss
    @ttrss Місяць тому

    for your use case is this not literally just make? I don't see the difference

    • @khwpp5943
      @khwpp5943 Місяць тому

      it's Make, but simpler. just is designed as a command runner rather than a build system which in consequence avoids many complexities from Make.

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      My current use case isn't much different but, as @khwpp5943 mentioned, expanding the recipes in the future will keep things simple. Thanks for watching!

  • @khwpp5943
    @khwpp5943 Місяць тому

    Some recipes may be shortened by using specific syntax. You might want to take a look at the examples/ dir at the project's GH page. This is a great tool I've been using lately, simpler than Makefile as well. Have you taken a look at the "NH" nix helper?

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Thanks for the suggestion, I'll look into that. I have looked briefly at NH but haven't tried it out yet. It's on the list to explore though :)

    • @brentonbills5946
      @brentonbills5946 Місяць тому

      Looking forward to the new series. Just looks like Make?

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Glad to hear. It's been an interesting set of problems to solve. Just syntax was inspired by Make, but the tool itself is much simpler. Thanks for watching!

  • @vernonhinkelschmidt
    @vernonhinkelschmidt Місяць тому

    I am coming here to say this: This is 100% the best series on this topic! These videos along with your accompanying website were an insane blessing to have. Outside of this tutorial there are exactly 0 articles, or guides on how to set up sops-nix with a git private key. Everyone has tutorials over how to setup Wireguard, Passwords, but no one has put in what seemingly to many is such a small detail. When I adapted your code from the home manager section to actually place the key at the correct location, and did a rebuild it worked flawlessly. Cannot thank you enough for this series!

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Thank you for the kind compliment. I'm glad it was helpful!

  • @christopherchalcraft1134
    @christopherchalcraft1134 Місяць тому

    amazing video. great quality and so clearly explained for a for a fomplef topic. i watch a lot of tech content and nix specifically and this is close to the top.

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Thanks for watching and for the compliment.

  • @james-cucumber
    @james-cucumber Місяць тому

    Friendly reminder to always have a human manually check AI subtitling. Not wanting to do that is perfectly reasonable, but generating subtitles and not checking them means they’re currently roughly on par with what UA-cam autogenerates, and in future will be worse than what UA-cam autogenerates.

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Thanks for pointing this out! I have started to edit the captions for existing videos and will include it as a step when posting future videos.

  • @hikingpete
    @hikingpete Місяць тому

    At t=663 you have a `cat -p ...`. What's up with that? Do you have a non-standard `cat`? It's a `bat` alias, isn't it. I would encourage you to use the proper names, or the standard utilities.

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Thanks for the suggestion!I will keep this in mind for future videos.

  • @karelkremel
    @karelkremel Місяць тому

    i have a suggestion for part 4 ;) using gpg keys stored on yubikey to encrypt secrets with sops

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Thanks for the suggestion! Adding yubikey to the mix with sops is something I'm planning to tackle eventually, so I will make a video about it fo sure. Thanks for watching.

  • @mechan1sm_
    @mechan1sm_ Місяць тому

    It's probably one of the most useful videos about nixos configs

  • @HyuLilium
    @HyuLilium 2 місяці тому

    Are you using a private Gitlab repo for the secrets instead of something like a self hosted Gitea/Gitlab instance to avoid having your private domain name committed to your public Github repo?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      It's just a convenience thing; I can't be bothered to host my own private instance for the time being.

    • @HyuLilium
      @HyuLilium Місяць тому

      @@Emergent_Mind I see. In my case I ran into the issue that I want to store secrets in my self hosted instance but not associate my private domain name with my github profile, so I still cannot publish my nixos configs on my github😅. Thanks for all the hard work in publishing these videos and blog posts. I tried it out and it worked perfectly.

    • @Emergent_Mind
      @Emergent_Mind Місяць тому

      Glad to hear it worked out.

  • @HyuLilium
    @HyuLilium 2 місяці тому

    Did you disable authenticating as the root user completely? Or why is the password for root not set using secrets?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Yeah, I don't bother with a root user on any of the hosts that I've moved over to NixOS.

  • @HyuLilium
    @HyuLilium 2 місяці тому

    I noticed you are sharing the same user with the same password across multiple hosts. Is there any reason you are not worried about that? It it possible to make it so for each host it sets a different password for the same `ta` user?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Hi again. Yes, currently I'm working deploying to a limited number of machines that have restricted network access so I'm not overly concerned with using the same password at the moment. This will change eventually for most physical machines and VMs will be restricted to remote access with keys. It is definitely possible to set up different passwords for each host. You would need host specific entries in your secrets.yaml file of course and you would also need to have some logic in your your hosts/common/users/<user> module, to assign the correct password for the host.

  • @user-yh7gc7lt1r
    @user-yh7gc7lt1r 2 місяці тому

    I like the option of using ssh-host-key for different hosts, but what about reinstalling the system? I mean, yes, we have a backup dev key and we won’t lose the ability to decrypt secrets.yaml, but with a new installation, the host key will change, which means we need to copy the dev key to the host, then do sops updatekeys and add the new public age key of the host to . sops.yaml. Did I miss anything? Perhaps you know a better way?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      What you described is correct. Alternatively, you could backup the 'known' host ssh key prior to reinstall and then overwrite the autogenerated one with it, which would keep the .sops.yaml and age key data unchanged. Hard to say if one is more convenient than the other though. I am working on some remote install automation at the moment, which includes handling secrets management with a private repo, and automatically generates keys and updates .sops.yaml accordingly. It's still a work in progress because of other aspects of the process but it's close to being done. I'll be making some videos to describe it all when it's finished. Thanks for watching!

  • @CristianHeredia0
    @CristianHeredia0 2 місяці тому

    Nice, what did you use to generate the diagrams?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Thanks for watching. The diagrams are all done in draw.io for the time being.

  • @HyuLilium
    @HyuLilium 2 місяці тому

    Have you tried to restore the backed up age private key contents? I've tried and I got checksum error when trying to decrypt with it.

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Hi there, I have but it not since I was testing it out early on. There are many potential issues that could occur there so I'm not sure how to help. Maybe post your issue with some additional context on discourse.nixos.org/ I'll keep an eye out for it but I do happen to be headed on vacation for a couple of weeks so hopefully someone else can point you in the right direction. Let me know how it goes and thanks for watching!

  • @aimpizza6823
    @aimpizza6823 2 місяці тому

    Just from watching the first part I am amazed of the quality of your teaching. Really appreciate it as the topic is a bit niche :]

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Thank you for the kind compliment! More to come.

  • @DreamsAPI
    @DreamsAPI 2 місяці тому

    Thank you for making these videos, please continue to make more, in future videos would be really cool to reference offficial Nix* docs and linking your builds to the docs so that way we can learn how to read the docs and build at the same time 😀

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Thanks for watching and for the comment! That's a good suggestion. You may also know that there is finally an official wiki at wiki.nixos.org/ so I will likely reference that as well. I have a few ideas for showing the reference process in the videos to help out as well.

  • @HELLYEAHJOHN
    @HELLYEAHJOHN 2 місяці тому

    Currently trying to move from Windows to NixOS and your videos are helping me a TON. I do use Linux for work but I still don't know much, and for distros as unique as NixOS high quality informative videos like this are lifesavers. Thank you so much!

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Thanks for the kind compliment. I'm glad to help. More content is on the way in coming weeks.

  • @agh0x01
    @agh0x01 2 місяці тому

    Am interested to hear you elaborate on why PGP is no good.

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Hahaha, I suspected someone would call me out on that at some point. :) My disdain for PGP is specifically from consistently bad experiences using it over a couple decades. Every time I need it for more than a minimal touch, 'out-of-the-box' scenario I run into endless problems and often lose significant amounts of time trying to troubleshoot (often to no avail). I will admit that this is most likely my own failings more than an intrinsic problem with the technoloyg but I do find it needlessly convoluted. So really, I just avoid it whenever I can. Has your experience with it been positive? Thanks for watching and for the comment!

    • @agh0x01
      @agh0x01 2 місяці тому

      @@Emergent_Mind yeah, I was just genuinely interested to know if it had failings as means of protecting sensitive information, as I use GPG occasionally. It sounds like your concerns were more about usability rather than the security side, although granted, a security product that is difficult or especially confusing to use can result in the security one believes to have not actually being.

  • @peterpacket42
    @peterpacket42 2 місяці тому

    Very interesting series. When not pulling from the private repository after a host has been removed. That host would still have accces to all the secrets. Is there a way to force this or would the keys need to be rotated to make sure the removed host does not have access antmore? Or any other options how to hande such scenario?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Thanks for watching! That's an astute question and something I have noted for when I revise the secrets management series at some point in the future. You're correct about key rotation being the solution. Any time a key is removed you should run `sops rotate -i foo.yaml` where foo.yaml is your secrets file. I am planning on adding that command to some of my automation scripts so that it gets run on a regular basis. Another thing to consider is that, even if you rotate keys, the host will likely be able to boot into previous nixos generations that would still be using the old keys and secrets file. So in any scenario where that presents a security risk, the previous generations on that host should be purged. There may be another option for handling this but if so, I'm not aware of it.

  • @S4ntia60
    @S4ntia60 2 місяці тому

    Delve? is this AI?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      It seems like you have provided an unrelated statement. I'm not sure what you are asking. To clarify, could you please provide more context or rephrase your question? I'm here to help, and I'll do my best to provide a useful, helpful, and actionable answer once I understand your question. ;P no, I am not AI

  • @nixeverything
    @nixeverything 2 місяці тому

    I think you should just go for sharing how to do the dual key thing, even if not many may need it. I can tell you no one else will teach it I am also now curious, never even considered it as a possibility tbh

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Thanks for the suggestion and your other comment! There are already a few things I would like to improve about how I presented this series. There are a lot of other topics I'm planning to cover in the near future but I've added the multi-key topic as something to go through, when this series eventually gets a revision. It's good to know what people are interested in hearing about!

  • @nixeverything
    @nixeverything 2 місяці тому

    Been using Nixos for about 3 months and still have so much to learn. This quality of a resource, if continued will certainly be tremendously helpful to all.

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Thanks for watching and for the kind compliment! There is more content coming.

  • @DrymarchonShaun
    @DrymarchonShaun 2 місяці тому

    Not entirely on topic, but I noticed that you have 4 or 5 private ssh keys in your config, and it piqued my curiosity, now I'm wondering why you have so many? (Looking to use your videos to revamp my config, and add support for multiple devices. I'm trying to decide how I want to set up my ssh keys for each device, right now I'm just using the same keypair on my laptop and desktop but know that isn't the best.)

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      Most of the keys in my config are related to a bunch of physical yubikeys. If you're not familiar with them, it's a little usb device that you can do a bunch of different passphrase related functions with. One of the functions is physically touching the device when ssh requires a passphrase for the associated private key. It allows you do use passphrases with keys without having to type them or copy/paste from a secure db. I have several different yubikeys for different machines work, home, remote, etc so I don't have to be unplugging/plugging a single usb device across multiple machines. Takes a little bit to set up but it's one of those things that once it's done you don't know how you lived without it hahah. I'm planning to do a video on yubikeys at some point, inlcuding how to handle multiple, possible yubikeys on a given machine using nixos. Not sure when I'll get to that though. Thanks for watching!

    • @DrymarchonShaun
      @DrymarchonShaun 2 місяці тому

      @@Emergent_Mind Oh, so like each yubikey has a password for a different ssh key and having all the private keys on all the devices 1. is fairly secure because while the keys are used on multiple devices, to use them physically requires one of the yubikeys, and 2. it means that no matter what yubikey you have at any given moment you can access any of your devices?

    • @Emergent_Mind
      @Emergent_Mind 2 місяці тому

      That's correct. It's quite convenient despite a couple of extra steps for management and what not.