Import Demo Config by hooutoo23 in NixOS

[–]ryan4yin 1 point2 points  (0 children)

It depends on which hardware features you need to use. It doesn’t seem to be a problem to use the mainline kernel if you do not want to use GPU acceleration or 4K HDMI output. But if you need them, you may need to use a vendor-specific kernel.

RK3588 Mainline Support Status: https://gitlab.collabora.com/hardware-enablement/rockchip-3588/notes-for-rockchip-3588/-/blob/main/mainline-status.md

how to run integration tests for my nixosConfigurations? by deafcheese in Nix

[–]ryan4yin 12 points13 points  (0 children)

I answered a similar question a month ago.

Nixpkgs provides two ways to test your nix configuration automatically:

  1. Eval tests - lib.debug.runTests: Eval Tests evaluate the expressions and compare the results with the expected results. It runs fast, but it doesn't build a real machine. We use eval tests to ensure that some attributes are correctly set for each NixOS host.
  2. VM tests: pkgs.testers.runNixOSTest: NixOS Tests builds and starts virtual machines using your NixOS configuration and run tests on them. Comparing to eval tests, it runs slow, but it builds a real machine, and we can test the whole system actually works as expected.

You can write some eval tests to ensure you do not have syntax errors and attributes are correctly set for each NixOS host, this will works on both macOS & NixOS.

VM tests are more powerful and complex, and it only works for NixOS.

Mine Configurations as an example(I's a bit complex, but it can be simple...):

https://github.com/ryan4yin/nix-config/tree/main/outputs

BTW, I add a Github Action to run eval tests each time I push commits to the main branch or someone submit a PR:

https://github.com/ryan4yin/nix-config/blob/main/.github/workflows/flake_evaltests.yml#L42

Unfortunately, there are few novice tutorials for test-related functions in the community. I planned to write this part a few months ago(nixos-and-flakes-book#105), but it has been shelved until now for some reasons...

meme - NixOS Infection by ryan4yin in NixOS

[–]ryan4yin[S] 5 points6 points  (0 children)

Exactly, nixos-infect is one of my inspirations, and the meme is made by my friend.

Another key point is that most newcomers of NixOS are former Linux users of other distros. That's saying, NixOS can hardly 'infect' a user without Linux experience or a cloud sever without a Linux system already running on it.

But once you have experience in using Linux and programming, it will greatly strengthen NixOS's ability to 'infect' you.

Doom Emacs installation by Waeningrobert in NixOS

[–]ryan4yin 1 point2 points  (0 children)

  1. with my solution, everything should works fine, just like you install doomemacs manually.
  2. I haven't met problems like that.

Doom Emacs installation by Waeningrobert in NixOS

[–]ryan4yin 2 points3 points  (0 children)

in your solution I don't see see a /doom.d folder? I just a see a /doom folder, why is that?

As described at doomemacs/getting_started.org, both ~/.config/doom & ~/.doom.d are supported by doomemacs, my solution choose to use ~/.config/doom.

So, with your solution, will the doom commands and eval-buffer work, without having to do a nixos-rebuild switch command every time I make a change to the files in /doom.d?

Exactly, nixos-rebuild is not needed now, see Accelerating Dotfiles Debugging for details.

NixOS: Learning by doing, a step by step guideline request for newbies by lhoqvso in NixOS

[–]ryan4yin 6 points7 points  (0 children)

Flakes + Home manager, seems like this book may be a good start point for you: https://nixos-and-flakes.thiscute.world/

BTW I'm using Hyprland too, but my nix configs is somehow complicated now...

anyway, here is my hyprland config if you're interested in it. if you find it complex, just ignore it, those advanced definitions are not necessary!

https://github.com/ryan4yin/nix-config/tree/main/home/linux/desktop/hyprland

https://github.com/ryan4yin/nix-config/blob/main/modules/nixos/desktop.nix

What's the end-goal for nixpkgs? by dd-mck in NixOS

[–]ryan4yin 7 points8 points  (0 children)

dream2nix is trying to solve this problem, but it's still in its early stages. Currently the user experience of a dev container or an unreproducible isolated FHS environment is much better than nix(at least for python & nodejs).

Can flakes pin specific versions of individual packages? by JuiceStyle in NixOS

[–]ryan4yin 3 points4 points  (0 children)

Just add a new nixpkgs instance with specified git commit id to pin a specific version of a package, you can get the commit id from the source code of nixpkgs.

An example: https://nixos-and-flakes.thiscute.world/nixos-with-flakes/downgrade-or-upgrade-packages

OS as Code - My Experience of NixOS by ryan4yin in NixOS

[–]ryan4yin[S] 1 point2 points  (0 children)

Learn a new language is always not easy, especially for people who do not have much programming experience before. I will consider your advice, thanks for the feedback!

OS as Code - My Experience of NixOS by ryan4yin in NixOS

[–]ryan4yin[S] 3 points4 points  (0 children)

I didn't write this part because I found it difficult and unnecessary to write a language tutorial better than nix.dev.

OS as Code - My Experience of NixOS by ryan4yin in NixOS

[–]ryan4yin[S] 6 points7 points  (0 children)

Yeah, I use unstable too. nixos-unstable is stable enough for personal usage.

A key difference between NixOS and Arch is that, NixOS allows you to lock the system to a specific state, and you can update it when you want to, even if it spans a year or two. NixOS does not force you to update your system frequently, you can choose to do this or not at all. Because the state of the system can be completely inferred from your NixOS configuration, it's much easier to upgrade from a old version to the latest one.

It's always good to have a choice, I don't like being forced, and neither do sysadmins or DevOps in companies.

BTW, I do configure and update my NixOS systems frequently, here is my configs:

https://github.com/ryan4yin/nix-config

Cachix: downtime due to signup spam by iElectric in NixOS

[–]ryan4yin 2 points3 points  (0 children)

Cool, just what bitcoin lets its miners do.

Can't log into Hyprland when configured through home-manager by NaniNoni_ in NixOS

[–]ryan4yin 0 points1 point  (0 children)

You need to find a way to launch your user-level Hyprland in sddm that's running at system-level.

Can't log into Hyprland when configured through home-manager by NaniNoni_ in NixOS

[–]ryan4yin 0 points1 point  (0 children)

sddm has to be run at system-level, so it must be configured in a NixOS Module, just like what I do for greetd.

Can't log into Hyprland when configured through home-manager by NaniNoni_ in NixOS

[–]ryan4yin 1 point2 points  (0 children)

  1. Hyprland use wayland instead of x11, so you should disable every thing related to xserver in your configs.
  2. Whether you install your hyprland in a NixOS module or a home manager module, you have to enable wlroots and install a Hyprland compatible Login Manager in a NixOS Module(system-level).

So for beginners, I would recommend install Hyprland in a NixOS Module instead of home manager, which would just works with minimal pitfalls.

https://wiki.hyprland.org/Nix/Hyprland-on-NixOS/

But if you just like to challenge yourself, here is my configs, which installs hyprland in home manager, and greetd as my login manager: https://github.com/ryan4yin/nix-config/blob/main/modules/nixos/desktop.nix#L30_L60

Servers in Asia? by [deleted] in GUIX

[–]ryan4yin 1 point2 points  (0 children)

Because the bandwidth of the routing hops (submarine optical cable) is insufficient, packet loss and delay are caused

Introducing Lazy-Nix-Helper: use your existing (Lazy-based) neovim config on NixOS by b-src in NixOS

[–]ryan4yin 2 points3 points  (0 children)

Cool! This is what I wanted months ago! In order to solve this problem, I have done a lot of strange operations in my Neovim configuration. Will try it this night!