Nix / NixOS

2336 readers
4 users here now

Main links

Videos

founded 2 years ago
MODERATORS
1
1
submitted 6 days ago* (last edited 6 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
          ];
        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.

2
 
 

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.

3
 
 

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

4
5
6
7
 
 

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.

8
1
submitted 4 weeks ago* (last edited 4 weeks 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?
9
 
 

Thought this would be fun and potentially handy for others to share. I recently did some work with Typst, and the template I ended up using made use of fonts not in my system install.

I was curious if you could use fonts in a nix-shell. Simply adding a font package via nix-shell doesn't make it accesible to applications. Thanks to this forum post, I ran a test using makeFontsConf, and it works! The way I used it it does require a .nix file, but I'm sure you could turn it into some one-line magic.

{ pkgs ? import <nixpkgs> {} }:

let
  fontsConf = pkgs.makeFontsConf {
    fontDirectories = [
      pkgs.font-awesome
      pkgs.fira
      pkgs.noto-fonts
      pkgs.roboto
    ];
  };
in

pkgs.mkShell {
  nativeBuildInputs = with pkgs.buildPackages; [ typst ];

  shellHook = ''
    export FONTCONFIG_FILE="${fontsConf}"
  '';
}
10
1
submitted 4 weeks ago* (last edited 4 weeks ago) by phantomwise@lemmy.ml to c/nix@programming.dev
 
 

Hi! I'm trying out Nix and I'm trying to set up and organize everything. Usually I put all my configs in a directory which is also a git repo and synced to my NAS, using the same subfolders they'd be in, and use GNU Stow to symlink the top-level folders (/dotfiles/home/ to /home/username/, /dotfiles/etc to /etc and /dotfiles/usr to /usr) and let it do its thing. Would it cause problems to also do that for configuration.nix?

On Arch I already had a /dotfiles/etc symlinked to /etc for my custom keyboard layouts, which worked fine... until the update which moved the location of the GUI keyboard layouts. It prevented the update so I undid the symlinks, updated, and put them again to the new location... but somehow it broke everything except the tty and no Wayland compositor I tried would work anymore (and there went my record of having never broken Arch since the first install over a year ago 😅 )

So I'm kinda wary of doing it on an even more critical file... but also I'm very lazy and having everything in a single repo is very convenient... How do you do it?

11
 
 

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!

12
13
14
 
 

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.

15
 
 

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?

16
 
 

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

17
 
 

https://web.archive.org/save/https%3A%2F%2Ftypekmatus.blogspot.com%2F2025%2F05%2Fre-recenzia-nixos-ako-sa-pouziva.html

Use the translator in the sidebar to translate the page.

Asi pred rokom som napísal kontroverzný článok na kontroverziu v NixOS. Áno, viem, je to paradox. Potom som prešiel na Fedoru od napísania tohoto článku, pričom ju stále používam na mojom Macu, lebo tam mám dôležité veci. Ale teraz po roku som sa rozhodol, že NixOS vyskúšam znova, tentokrát ale ako používateľ, ktorý nesleduje dianie okolo NixOS (na fórum tejto distribúcie som sa prihlásil iba teraz, aby som mohol ľahšie dohľadať príspevok a skopírovať odkaz naň). Poďme sa pozrieť, ako som si ho nastavil.


18
 
 

The idea behind the first requirement was that I want to be able to reduce the creation of the logo to a few simple parameters. Additionally, if I can generate the SVG files programmatically, I can programmatically generate the Branding Guide and Media Kit. I’m calling this approach “Branding as Code” (BaC)

That sounds neat, and quite in the spirit of Nix itself! This PR looks to be the work in progress mentioned:

19
 
 

I just want to know from you how you (or how you would) pass options to packages you develop with flakes.

I am currently writing a widget bar using Astal and then import the flake in my NixOS flake and use the package.default output in home.packages. I'd like to also style this bar according to my Stylix theme, how do you do something like this?

20
21
 
 

I'm trying to write a Nix package for a closed-source, precompiled binary with an unusual twist. The binary is statically-linked, but it contains an embedded binary that is dynamically-linked. Is there some way I can use patchelf or another tool to path the interpreter path in the embedded binary?

The embedded binary does not have any runtime library dependencies, but it does need an interpreter which it expects at the hard-coded path /lib64/ld-linux-x86-64.so.2. It is embedded using the golang "embed" library.

I have a workaround that wraps the binary using buildFHSEnv. That works, but the resulting closure is about 300 MB bigger than it needs to be.

22
23
24
 
 

As the title says. Want that i can have a single config for my systems and just require a single line to install and configure software which i always use in a bundle(office, specific programming applications, server applications,...).

25
1
submitted 2 months ago* (last edited 2 months ago) by SpiderUnderUrBed@lemmy.zip to c/nix@programming.dev
 
 

https://pastebin.com/30Bh23EV and this:

  DVfio.configuration = {
        systemd.tmpfiles.rules = [
          "f /tmp/enable-vfio-switch 0644 spiderunderurbed users -"
        ];
        environment.variables = {
          KWIN_DRM_DEVICES = lib.mkForce "";
        };
        environment.extraInit = ''
                export KWIN_DRM_DEVICES=$(${vfio}/bin/vfio)
        '';
  };

So there is a issue with my configuration, so, you dont really need to understand nix, just like, look at my qemu hook script, its in plain sh, and the stuff above might be self explanitory, the issue is, my nvidia drivers are still being used, despite, setting KWIN_DRM_DEVICES to card0 so the logs of libvirtd looks something like this: https://pastebin.com/TaKrsY9S if setting kwin_drm_devices to my gpu card does not work, i dont know what does and can use help

view more: next ›