Nix / NixOS

1789 readers
11 users here now

Main links

Videos

founded 1 year ago
MODERATORS
126
13
submitted 9 months ago by menzel to c/nix
 
 

Hey, i currently try to learn the nix language and i have a question about recursion. This is my solution for Advent of Code 2015 day 4

let
    input = "abcdef";
    part1 = number:
        if (builtins.substring 0 5 (builtins.hashString "md5" "${input}${builtins.toString number}")) == "00000" then
            number
        else
            part1 (number + 1);
    part2 = "not implemented";

in {"Part 1" = part1 1; "Part 2" = part2;}

since i put the recursive call at the end of the function i assumed it would do some magic or tail call optimization stuff, but it results pretty fast in a stack overflow is there a way to get it working?

127
3
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/nix
 
 

So i followed the instructions to install virtualbox and added myself to the vboxusers group, but i cant run VMs as a standard user. The GUI message says "VirtualBox kernel driver is not accessible, permission problem" the VM log says "ERROR [COM]: aRC=E ACCESSDENIED (0x80070005) aText={The console is not powered up}"

Someone on mastodon mentioned /dev/vboxdrv and that file is "crw-rw---- root vboxusers". There is also a file /dev/vboxdrvu which is "crw-rw-rw- root root" but changing that to root vboxusers with chown didnt work.

I can run VMs as root just fine. Any thoughts?

Edit: new to NixOS and really enjoying it so far

Edit 2: SOLVED: I had "virtualbox" as a package under "envoronment.systemPackages = with pkgs; [" and wasnt supposed too.

128
 
 

I just switched one of my systems over to NixOS from Arch and so far it seems interesting. One question I had is regarding the nix-shell. So I get the basic concept of it and that it allows creating a shell that has packages installed with that shell making ideal for dev environments. I've even seen talks where the suggest nix-shells over docker/podman, my question is how is persistent data (like databases) handled?

129
40
submitted 9 months ago by uthredii to c/nix
130
 
 

While updating home-manager I got a notice that freeimage-unstable-2021-11-01 is marked as unsafe.

Since chances are it's used by something I never use, I'd like to know what I'm using that depends on it... any idea how to do it?

Also.. any idea why I have 4 copies of the freeimage stuff in my /nix/store? (I just run nix-collect-garbage -d and the 4 seem to be actually different):

❱ md5sum /nix/store/*freeimage*/lib/libfreeimage.a
67a0ce1cb5dd562473e27d7c88e8a9bd  /nix/store/6gi6hm57zngqnxb6p5dnxhjjcbr96lrk-freeimage-unstable-2021-11-01/lib/libfreeimage.a
5995e0affbfa28b63da7e997cb4dbe63  /nix/store/09nwykzzksc0zknflsyxyah5b67c2rsn-freeimage-unstable-2021-11-01/lib/libfreeimage.a
67a0ce1cb5dd562473e27d7c88e8a9bd  /nix/store/ikfiv4gpmcpyir7lsj45by653qcnvgyx-freeimage-unstable-2021-11-01/lib/libfreeimage.a
213a408e3c1fbb5dfa4491deebe05984  /nix/store/q2sc85f2hclgwl8m3qdw8rpbs44gzmah-freeimage-unstable-2021-11-01/lib/libfreeimage.a
131
23
submitted 9 months ago by [email protected] to c/nix
132
12
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/nix
 
 

Hi,

how would one create a development environment for #xmonad contained within my nixos system configuration?

My flake for my system sets up xmonad with a custom config.hs and I'd like to get a suitable dev environment when editing the config.hs. Usually when developing for haskell, I'll use a flake and setup a devShell which then gets loaded by direnv.

  • is there best practice?
  • my config.hs is in a subdirectory

My first attempt would be to just provide a shell.nix next to my config.hs - but that wouldn't load the exact same xmonad as the system one, since it's separate from the flake.

133
13
submitted 9 months ago* (last edited 9 months ago) by [email protected] to c/nix
 
 

Hi all Nix experts,

I recently started using nix to manage my dev environment on my immutable distro, and I need some help.

I was wondering if I am using a large package like TexLiveFull, how to make sure nix don't delete large packages after I close the shell? I also don't want this package to be available in my global environment, as I don't need to use it outside vscode.

Another question is how to keep my packages up-to-date. I don't do serious development work, thus I typically perfer my package and dev-tools to be on the latest version. I prefer to have a little management of this as possible. Ideally, every time I start up a nix shell, the package manager will grab the latest version of the package if possible without requiring additional interaction from me. Is this possible?

Finally, is there any way to bubblewrap programs installed by nix to only access the file within the starting path of the shell? I don't imagine this is possible, but it would definitely be nice if nix has some security feature like this.

Thanks in advance for your help! I understand parts of this post might be ridiculous. I am still new to nix. Please correct me if I am not using nix in the "correct" way.

134
135
136
137
 
 

cross-posted from: https://pawb.social/post/6260688

Recently, I switched to NixOS and realised that there is no G'MIC plugin package for Krita.

There's this issue that was last active in October 2023.

I was wondering if anyone has managed to install this without using another package manager (such as Flatpak) or installing an AppImage manually, for system reproducibility, and I also don't wanna have two package managers in one system.

Ideally, there'd be a wrapper, so you could do something like:

{ pkgs, ... }: {
  programs.krita = {
    enable = true;
    gmic.enable = true;
    gmic.package = pkgs.krita.gmic-qt;
  };
}

Thoughts?

Related: is there some kind of guide on these program.<name> wrappers? What are they and where are they defined?

138
27
submitted 10 months ago by [email protected] to c/nix
139
140
29
submitted 10 months ago by mac to c/nix
141
 
 

cross-posted from: https://feddit.de/post/7895009

I'm a semi-recent NixOS user and one thing that bothers me since the beginning is that when I change the Gnome theme (between light and dark), Firefox doesn't adapt. The system theme in Firefox is enabled, but it always displays the light theme, no matter what theme is selected in Gnome.

Internet search, including searching through NixOS discourse, packages, options and Nixpkgs repo surfaced a solution.

Any ideas or tips how to achieve system theme integration for Firefox on NixOS?

NixOS 23.11 / Gnome 45 / sway

142
17
COSMIC DE: The Road to Alpha (blog.system76.com)
submitted 10 months ago by ericjmorey to c/nix
 
 

cross-posted from: https://programming.dev/post/8455606

If all goes well, we can release the alpha by the end of March

Now Available on NixOS!

COSMIC Terminal joins a long list of COSMIC DE projects that have been packaged for NixOS! While COSMIC DE will be the flagship desktop for Pop!_OS, it's designed and architected for distros to build their own custom, branded user experiences. Details for distro packaging will be released at the same time as the alpha.

143
144
145
 
 

It's a WIP, but I hope it's understandable and contains the necessary information to start packaging something using the builtin derivation function.

146
15
submitted 11 months ago* (last edited 11 months ago) by tinkralge to c/nix
 
 

Despite the name, the nixlang wiki is a community contributor wiki to document things around nix that the maintainers haven't gotten around to, to short-circuit the lengthy review process for the official documentation, and an attempt to make an entry into the nix ecosystem easier.

It's difficult to write things from a perspective of somebody who doesn't know, despite once being that person!

It would be great to have some feedback on the wiki.

P.S I'm not the maintainer, just a contributor.

147
 
 

🗓️ Mark your calendars! NixCon North America 2024 is happening on March 14th and 15th at the Pasadena Convention Center in Pasadena, CA, USA. Submit your talk or workshop proposal before December 31, 2023, 11:59 PM PST. Be a part of this exciting event! More details at: https://discourse.nixos.org/t/nixcon-na-2024-call-for-proposals/36491

148
 
 

A few months ago I went on a quest for a DNS server and was dissatisfied with current maintained projects. They were either good at adblocking (Blocky, grimd…) or good at specifying custom DNS (CoreDNS…).

So I forked grimd and embarked on rewriting a good chunk of it for it to address my needs - the result is leng.

  • it is fast
  • it is small
  • it is easy
  • you can specify blocklists and it will fetch them for you
  • you can specify custom DNS records with proper zone file syntax (SRV records, etc)
  • it supports DNS-over-HTTPS so you can stay private

I just released a new version which includes full NixOS support via a module! ❄

149
 
 

From this thread I found out about https://devenv.sh and https://www.jetpack.io/devbox but I'm having trouble comparing them to nix-shell.

Are they wrappers around nix-shell? They seem to do the same thing with services, devcontainer generation, environment variables, etc.

150
view more: ‹ prev next ›