Nix / NixOS

2361 readers
11 users here now

Main links

Videos

founded 2 years ago
MODERATORS
1
 
 

For example, compose2nix lets you build nixos configuration for containers defined in a docker compose compose.yml. But this step happens offline. You have to first ad hoc generate the config from the compose.yml and then use that generated output in your config.

It seems obvious to me that the best user experience would be to write a flake/module that let's you just point to a compose file directly in your config. On rebuild, it would parse the compose file and build the appropriate config.

But I've not really seen that. These projects that convert from one package mamagement scheme or config file to another (xxx2nix projects) work using this preprocessing step. More examples include pip2nix and cargo2nix.

Given how common this pattern is, I suspect there is something preventing generating at rebuild time from being feasible, or at least easy. Does anyone have ideas for why this is? Thanks.

2
3
4
 
 

Sequel to prior series discussed:

5
 
 

Just discovered this article recently from a related thread:

6
 
 

The image shows what happens when i boot on the ISO, i get the error:

x sysroot-nix-rrv\v2dstore.mount - /sysroot/nix/.rc-store
    Loaded: loaded (/nix/store/1779scwag89fja51b1q7jg5savcj5tyrlnltrd-fstab; generated)
    Active: failed (Result: exit-code) since Tue 2023-07-29 18:37:53 UTC; 35s ago
Invocation: 94ea87636cc24a4c83d8e147275a8124
    Where: /sysroot/nix/.rc-store
    What: /iso/nix-store.squashfs
    Docs: man:fstab(f)
    man:systemd-fstab-generator(8)
    Item peak: 1.9M
    CPU: 9ms
Jul 29 19:37:53 hostruc systemdf11: Mounting /sysroot/nix/.rc-store...
Jul 29 19:37:53 hostruc mountt2531: mount: /sysroot/nix/.rc-store: failed to setup loop device for /iso/nix-store.squashfs.
Jul 29 19:37:53 hostruc systemdf11: sysroot-nix-rrv\v2dstore.mount: Mount process exited, code-exited, status=82/n/a
Jul 29 19:37:53 hostruc systemdf11: sysroot-nix-rrv\v2dstore.mount: Failed with result: exit-code .
Jul 29 19:37:53 hostruc systemdf11: Failed to mount /sysroot/nix/.rc-store.

and I am pretty confident this is because I have initrd systemd on a iso build, so does anyone know how I can fix this issue in either my flake where i set how the iso is built or in main.nix (which i linked), which is about initrd settings main.nix (imported in configuration.nix): https://pastebin.com/3VVv4epH flake.nix: https://pastebin.com/yzVrJ0YJ

Image

7
8
 
 

I want to edit .desktop files of some nixpkgs for customization, but they are located in /run/current-system/sw/share/applications.. and are readable only.

One possible solution would be to copy them to ~/.local/share/applications but duplicating doesnt sit right with me (this would be my last resort tho).

I would prefer to override the parameters I want to change somehow preferably in my configuration.nix only.

9
 
 

Hi all,

Since intel-media-sdk-23.2.2 + has been marked as vulnerable in NixPkgs ( commit ) is there an alternative for enabling Jellyfin hardware transcoding on an Intel i5-8500? Thanks!

10
6
submitted 1 week ago* (last edited 1 week ago) by hyveltjuven@lemmy.world to c/nix@programming.dev
 
 

Hi, new NixOS user here.

Liking it so far but just hit an issue that I'm having trouble getting past. Pages in firefox cannot access my geolocation, even after I hit allow when the page asks for permission. Same with the default Gnome maps app, it just places me in a central location of my countrys capital (I don't live in the capital).

I've added the following to my configuration.nix file and rebuilt but it made no difference.

 # Geolocation
  services.geoclue2.enable = true;

  environment.sessionVariables = {
    # Allows geolocation in firefox
    MOZ_ENABLE_WAYLAND = "1"; 
  };

What am I missing?

11
 
 

Hello guys,

I made a group for nix and nixos for those who want to have casual talk about it in a signal group. I chose Signal since it's e2ee and very seamless to use. You can now hide phone numbers and add usernames in Signal so anonymity can still be a priority.

I hope to see your guys there!

12
13
11
submitted 3 weeks ago* (last edited 5 days ago) by beegnyoshi@lemmy.zip to c/nix@programming.dev
 
 

Hey all. Last time I searched about how to make LazyVim "just work" in nixos (which it didn't mostly because of mason and treesitter) was a few years ago, so maybe if I were to try to do it again nowadays I would find a better solution but anyway.

When I first switched to nixos, I already had my neovim config, and I wanted it to just work in my new system. I didn't want to rewrite it in nix or manually install treesitter grammar packages or lsps. Alas, due to nixos not following FHS, it didn't work.

So, a few days ago, here's what I seem to have found as a solution: Adding this:

      (pkgs.buildFHSEnv {
        name = "nvim";
        multiPkgs = pkgs:
          with pkgs; [
            libz # For codelldb to work
            icu # For marksman to work
          ];
        targetPkgs = pkgs:
          with pkgs; [
            neovim
            # Whatever other things you need inside neovim
            gnumake # for compiling some plugins
          ];
        runScript = "nvim";
      })

To my environment.systemPackages.

Note that I wasn't using steam-run because I remember I got a ton of errors when I tried it a few years ago, though it seemed to work normally when I tried it just now. I still think that this is a better way to go about it than to use steam-run nvim every time, though. I also haven't tested this all that much, so it might have some sort of caveat I have yet to discover.

Hopefully this post helps someone.

Edit: Added icu for marksman

14
 
 

In this video, I show you how to turn your phone into a mobile typewriter using NixOS, Emacs, Org Roam, and Syncthing — no Google, no distractions.

Not very touch friendly yet, and not sure if anyone has gotten the cellar radios to work with a SIM carrier.

15
 
 

Sascha Koenig looks to have some quality deep guides around NixOS!

16
17
18
 
 

Nixgl: https://github.com/nix-community/nixGL

Also, it seems like this requires the latest "stateversion", since this is a new feature.

This is pretty big, because it makes it easy to use applications that use the GPU from nixpkgs on non Nixos systems.

19
12
submitted 1 month ago* (last edited 1 month ago) by recursive_recursion@lemmy.ca to c/nix@programming.dev
 
 

I forgot that I shared this a week ago.
It's licensed under AGPL-3.0.

One of my thoughts is to add pictures of how the system looks with this config.

My current questions are:

  • What do you think could be improved?
  • What would you like to see?
20
 
 

Basically the title. I would like apps that auto detect system theme to see it as dark mode. I’ve come across post after post of doing this with home manager, but I’d like to just do it in my base nix config. I tried a few different ways to declare what I thought was being done in the home manager tutorials in my config, but none of it worked. Any help would be greatly appreciated!

21
22
23
 
 

I think it's about time I improved a bit on my Nix and NixOS knowledge, and I guess the best way is having someone more experienced critique my monstrosity of a setup.

Maybe it's too modular? Not modular enough? Convoluted? Complete garbage altogether?

Go to the repo and find out! Just be sure to let me know after.

24
 
 

Whenever I run any command line tools without sudo, they take the settings as in ~/.config and work fine. But whenever I run the same CLI tools with same parameters but with sudo, it falls back to default setting. How can I make this behavior consistent?

25
 
 

Ich würd gerne für einen Kollegen und mich zwei TShirts mit dem "Ansible? Nein Danke" Print bestellen. Redbubble ist ja schlecht von der Qualität, ich finde aber auch keine hochauflösende File um es wo anders drucken zu lassen. Wer kann hier vielleicht helfen? @nix

view more: next ›