Rebuilding my NixOS config - Part 1: VM install + basic flake structure

  Рет қаралды 5,464

Sascha Koenig

Sascha Koenig

Күн бұрын

Пікірлер: 35
@leviathanmelvilli562
@leviathanmelvilli562 8 күн бұрын
YES! this is it!! idk why "installing nix from scratch with flakes and home manager" doesn't put this video at the top but a year old videos 'explaining' what these are only.. i'm currently looking for a way to entirely migrate my setup to flakes and home-manager from my traditional setup. thanks for this
@m3tam3re
@m3tam3re 7 күн бұрын
Hey 🙂 Thanks for watching. I think you have arrived at the right video series for flakes. If there are questions just drop a comment or send me a DM 🙂 The code is always linked in the description.
@kernel0verflow919
@kernel0verflow919 Ай бұрын
I think it's great that your video series is unscripted and pretty raw. I want to try out nixos or the nix package manager myself for a long time and never got to it. I'm looking forward for more content :) Danke für die Videos und schönes restliche Woche!
@m3tam3re
@m3tam3re Ай бұрын
Thank you so much 🙏 I hope this helps you to get into nix. Vielen Dank, das wünsche ich Dir auch 🙂
@20windfisch11
@20windfisch11 Ай бұрын
I have started to use NixOS about half a year ago, learned the basics from Vimjoyer here on YT, and my PC runs a setup with impermanence. However my configuration is still a mess and lacks proper secrets management. I binged all current 12 parts of your tutorial and you explain a lot that had been puzzling me up until now. I’ll rebuild my configuration in such a modular way, and just for fun try to get an identical one to work on my Pi400 and my 2012 MacBook Pro. Thanks for the good explanations.
@m3tam3re
@m3tam3re Ай бұрын
Thanks for watching my videos. I am really happy that they are helpful to you. Vimjoyer has some great videos on NixOS, I also learned a lot from his videos. I know it feels there are like a million things to learn when it comes to nix. I am using NixOS as my daily driver for 2 years know and I still feel like I barely scratched the surface 😇
@marekgenerowicz4401
@marekgenerowicz4401 2 ай бұрын
Looking forward to this. I have also recently reinstalled NisOs
@m3tam3re
@m3tam3re 2 ай бұрын
Thanks, will do my best to make it interesting 😊
@MWLaboratories
@MWLaboratories 2 ай бұрын
This comes at a perfect moment, I'm also doing multi system config and want to get hyprland up and running. I've only been able to launch it from a terminal so far.
@m3tam3re
@m3tam3re 2 ай бұрын
Thanks for watching 😀
@zenzilla94
@zenzilla94 4 күн бұрын
I followed this video and wrote my new nix config from scratch. I am extremely happy with how it turned out and would like to share some of the notes I took in the process. Hopefully this can help the next person to attempt this build. The first issue I ran into occurred when I rebuilt my system for the first time. The host directory I renamed "computer" was not being synced to the nix-store, so each rebuild I was told the directory did not exist. To solve this issue all I had to do was commit my changes to git. Then, they appeared in the nix-store directory it was being built from. To be honest, I'm not exactly sure why this solved the issue. After this I copied a list of the packages from my previous home.nix and attempted to get them installed. This worked for the most part, but there were a few packages that were not recognized. To solve this issue I had to run `nix flake update`. With my packages installed, I checked to see if they were using the unstable nixpkgs repo... they were not. This was strange to me, as I, just like Sascha in the video imported the unstable branch into my flake.nix. Turns out this is because home-manager doesn't use the pkgs version you provide in your flake.nix by default, instead it uses a private version of pkgs (learn more on home-manager docs). In order for it to use the unstable repo I provided, I needed to add this attribute set { home-manager.useGlobalPkgs = true; } to my homeConfiguration "modules" in flake.nix. The final and simplest error I received had to do with nix-repl, which was mentioned somewhere in the config. I deleted the reference to it and no longer had any errors. Don't worry about omitting this one, even with no mention, it's still available over the command line. This tool is baked in and there is no need to declare it. After solving those issues, I've had no stress from this config. The structure of the flake is very intuitive which makes adjustments quite simple. Adding another host machine took me about 30 mins. Heads up. As a beginner, writing this config did take me a while, the better part of a weekend. With that said, I have a much better understanding of how all the different components interact and their purpose. If you are struggling to make sense of the nix, I'd highly recommend reading the "Nix Language Basics" article on nix.dev. It's a bit of a slog, but it'll help you understand the language better and functional programming in general.
@m3tam3re
@m3tam3re Күн бұрын
Thank you so much for sharing your journey. Your notes will be incredibly helpful for others following the tutorial, and they also highlight some important points I should have emphasized more in the video. Git: Flakes require a git-initialized directory because they need a reproducible way to track source files. This is an important point I should have talked about, especially as the goal is that the flake is being adapted into you own config. Flake usage: That is also an important point and definitely something that belongs into the video. repl-flake experimental feature: sorry about that. I removed this for my personal flake config, but not on the git repo for the videos. This feature has been removed from nix: github.com/NixOS/nix/issues/10103 About not using global packages: I actually chose this approach on purpose instead of using useGlobalPkgs = true, as it gives you more freedom to play around with different package versions for different users and systems. It might seem a bit more complex at first, but it makes it super easy to maintain separate setups for your laptop, server, or whatever else you're running. I'm really happy to hear that you successfully created your own config and that it's working well for you! I'm planning to make a follow-up video addressing these points and sharing more general tips and useful resources for NixOS configuration. Stay tuned!
@mathiasgunther8233
@mathiasgunther8233 23 сағат бұрын
Hi, first of all, thanks a lot for this series! I really enjoy following it. I just have two points I'm wondering about that might help me figure out some issues I encountered around video 6. First: In flake.nix, you have the line 51: modules = [./home/m3tam3re/m3tam3re.nix];. Shouldn't it be modules = [./home/m3tam3re/m3-kratos.nix];? Second: What is "repl-flake" in /home/common/default.nix? For me, it gives the error: unknown experimental feature 'repl-flake'. But it is found in all your Git versions. Thanks in advance!
@m3tam3re
@m3tam3re 18 сағат бұрын
Hey 🙂 Thanks for watching my videos. I am very happy that you like watching them. Actually you have spotted two mistakes I made. You are right for line 51 of flake.nix This should be modules = [./home/m3tam3re/m3-kratos.nix] The "nix-repl" experimental feature has been removed from the nix command( github.com/NixOS/nix/issues/10103 ). I removed this for my personal flake config, but not on the git repo. I will fix both errors in the next couple of days. Thanks for pointing me to this 🙂
@erwin757
@erwin757 22 күн бұрын
This is really the best for me, as I did last few weeks a lot of reading of configs, but what I miss in this config is the combination with darwin. Could we get this in your series as well? Thanks so much (Merci beaucoup)
@m3tam3re
@m3tam3re 19 күн бұрын
Thanks, you are absolutely right. Nix darwin would be a nice addition to the videos.I do not have a Mac available at the moment, but if we are lucky I can borrow my wife's MacBook Pro in the holiday season 😊
@MWLaboratories
@MWLaboratories 2 ай бұрын
I am able to ssh into the remote machine with my sshkey but when running the nixos switch command with remotehost I get error lacks signature by a trusted key : error writing to file: broken pipe
@m3tam3re
@m3tam3re 2 ай бұрын
Did you add your user to the trusted users and rebuild the system again on the VM? Please have a look here: kzbin.info/www/bejne/hXeqqn6DiK-tjrs
@MWLaboratories
@MWLaboratories 2 ай бұрын
@@m3tam3re No, I was trying it remote rebuild-switch from my desktop to my laptop that already had a user with the same name in home manager set up. I'm trying it again with it added, thanks!
@gogucuaripi
@gogucuaripi 2 ай бұрын
Maybe a stupid question but what is your editor/configuration for said editor, the assists for it look awesome Btw awesome video
@m3tam3re
@m3tam3re 2 ай бұрын
Hey 😀 thanks for watching. I am using Zed. For nix completion I use nixd as the language server. Zed is also when it comes to AI features. At the moment you have built in Claude Sonnet for free. Please check out zed.dev/ for the editor and github.com/nix-community/nixd for the lsp
@flipinfin
@flipinfin Ай бұрын
That looks like vscode
@gogucuaripi
@gogucuaripi Ай бұрын
@@flipinfin thanks will try it out, somehow I was expecting the left bar of vscode
@flipinfin
@flipinfin Ай бұрын
@@gogucuaripi you can move its position
@flipinfin
@flipinfin Ай бұрын
​@@gogucuaripiidk the theme though I gota look it up it us dope
@flipinfin
@flipinfin Ай бұрын
Great video but why didn't use just build calameres from scratch????
@m3tam3re
@m3tam3re Ай бұрын
Thank you 🙏 Actually the Calamares installer on nixos wlll only give you an easy install with a basic install with the desktop of your choice. The goal of this video series is to build out a nixos flake config that will multiple system and user configurations.
@flipinfin
@flipinfin Ай бұрын
@@m3tam3re true but you can do the same with calameres and archiso. Personal preference. Does nixos come with the iso? Or your just building the installer by itself?
@flipinfin
@flipinfin Ай бұрын
@@m3tam3re check out arcolinux installer for future project. That's what I'm working on now. Y I asked
@m3tam3re
@m3tam3re Ай бұрын
​@@flipinfin nixos comes with the iso, but in my opinion this is just a lower barrier of entry instead of the minimal iso. What I like most about configuring my systems like this is that I have my whole system configurations declared in code at any point in time.
@PanTek-r8g
@PanTek-r8g 15 күн бұрын
This looks by far the most coherent and comprehensive series of Nixos. The screen unfortunately is not easy to see, small text, so I shall not pursue. Shame really.
@m3tam3re
@m3tam3re 15 күн бұрын
Thanks for your feedback 🙏 I will try to make the code parts bigger for future videos 😇 Still trying to find my way ...
@PanTek-r8g
@PanTek-r8g 15 күн бұрын
@@m3tam3re It's just too small for me as I am old.......if you look at someone like TechwithNana, she doesn't mess around, everything is hyper legible and visually configured....Anyhow the amount of detail you are sharing is crazy. You could stick it all in a course and people would pay money for it....
@m3tam3re
@m3tam3re 13 күн бұрын
TechwithNana is a great channel. I watched a lot of her videos and learned a lot from her over the years... The level of detail I am sharing here is the most important part for me on this series. NixOS is such a great operating system, but has a really high barrier of entry. These videos are my approach to help others get into it more easily.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 7 МЛН
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 2,7 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 45 МЛН
Python PySide6 Dark Theme Clock
1:51
ScriptingCollege
Рет қаралды 2
Is Nix Your New Terminal SUPERPOWER?
15:21
DevOps Toolbox
Рет қаралды 28 М.
You Should Use Flakes Right Away in NixOS!
26:09
LibrePhoenix
Рет қаралды 73 М.
Why I switched to NixOS?
11:22
MENDIss
Рет қаралды 318
Is Golang Still a Successful Programming Language?
14:41
Melkey
Рет қаралды 10 М.
ThePrimeagen On Running Linux
9:40
Tech Over Tea
Рет қаралды 281 М.
Getting Started with Nix Home Manager
21:55
nixhero
Рет қаралды 3,7 М.
NixOS is Mindblowing
12:02
Chris Titus Tech
Рет қаралды 723 М.
The Painful world of Linux Ricing | A Hyprland story
13:01
typecraft
Рет қаралды 62 М.
Nerding out about Nix and NixOS with Jon Seager, Canonical
57:05
Nerding Out With Viktor
Рет қаралды 7 М.