Nix

10 readers
1 users here now

founded 1 year ago
MODERATORS
1
 
 

I am trying to use Nixos as my docker host. Everything works fine except for weird behavior when it comes to the config files. When the containers start up and apply permissions to /config instead of using the supplied PUID and PGID it instead uses (PUID -1+100000) and (PGID-1+100000).

For example if I supply 1026 as the PUID and 100 as the PGID it applies 101025 as the owner and 100099 as the group.

This is my docker config from my configuration.nix:

  # Docker Config
  virtualisation.docker.enable = true;
  virtualisation.docker.rootless = {
    enable = true;
    setSocketVariable = true;
  };

And this is a sample docker-compose config:

services:
  jackett:
      image: ghcr.io/linuxserver/jackett:latest
      container_name: jackett
      environment:
          - PUID=${PUID_NEW}
          - PGID=${PGID_NEW}
          - TZ=${TZ}
      volumes:
          - '${DOCKER_CONFIG}/jackett:/config'
          - '${SHARE_DRIVE}:/downloads'
      networks:
          - medianetwork
      ports:
          - 9117:9117
      restart: always

2
 
 
3
 
 

I'm currently trying to get comfortable on NixOS on my laptop before switching over to it from Arch on my desktop, and I've noticed that there's a .keep file in the ~/.cache directory. I normally wouldn't care about it, except that my XDG_CACHE_HOME isn't ~/.cache, but rather set to $XDG_STATE_HOME/cache which is ~/.var/cache (to mirror how cache is in /var/cache).

So what even is the .keep file, and how do I make it go to my XDG_CACHE_HOME to stop it from cluttering up my home directory?

4
 
 

Hi all,

Trying to get a systemd timer script working that would turn off the scree at a set time each day.

This is the script that I am using in default.nix

   systemd.timers.screenoff = {
 	timerConfig = { 
 		Unit = "screenoff.service";
 		OnCalendar = "*-*-* 14:35:00";
 	};
 	wantedBy = ["default.target"]; 
 };
 
 systemd.user.services.screenoff = {
 	script = ''
 	${pkgs.bash}/bin/bash /home/"user"/screen_off.sh
 	'';
	wantedBy = ["default.target"];
	};

The script contains this bit of bash

#!/usr/bin/env

busctl --user set-property org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig PowerSaveMode i 3

I have tired a few various formats but in this current version I see the time and service listed in systemctl list-timers --all, but typing systemctl enable screenoff.service leads to error stating that service doesn't exist.

Any help would be greatly appreciated! Thank you!

5
 
 

I am trying to apply qt theme to share picker. I have QT_QPA_PLATFORMTHEME variable set to qt5ct and working qt configuration in home-manager, but share picker uses ugly default theme. Wiki instructions dont work either.

share picker

qt5ct and qt6ct

6
 
 

I'd like to add 'ImageMagick' as a dependency for ranger to enable sixel support for image preview. How do I go about doing this?

7
 
 

I host a bunch of websites with NixOS. Most of them need the bin 'convert' from imagemagick.

It is a bit tedious to specify in every website the path to convert = /run/current-system/sw/bin/convert

Is there a way to put a symlink /usr/bin/convert -> /run/current-system/sw/bin/convert ?

8
 
 

Hello, hope your all well?

So I'm about to install NixOS on my primary workstation. I've been tinkering on an old laptop, learning flakes, getting to grips with home-manager and the nix commands especially garbage collection.

So the configuration.nix I've created on my laptop, isn't all the tooling I'll use on my workstation and honestly, I can remember half the stuff I've installed or tools I install along the way.

So here is my actual question is there anything like a nix config generator, where I can cherry pick apps, services and utilities?

9
 
 

I'm trying to package this. I followed the wiki and when I tried to run it with autopatchelf hook I got this:

setting interpreter of /nix/store/bwxdfc238al3mmvsqx7qf3a1l4i3ip3l-keymapp-21.07.0/bin/keymapp
searching for dependencies of /nix/store/bwxdfc238al3mmvsqx7qf3a1l4i3ip3l-keymapp-21.07.0/bin/keymapp
    libusb-1.0.so.0 -> not found!
    libudev.so.1 -> not found!
    libwebkit2gtk-4.0.so.37 -> not found!
    libgtk-3.so.0 -> not found!
    libgdk-3.so.0 -> not found!
    libgdk_pixbuf-2.0.so.0 -> not found!
    libgio-2.0.so.0 -> not found!
    libjavascriptcoregtk-4.0.so.18 -> not found!
    libgobject-2.0.so.0 -> not found!
    libglib-2.0.so.0 -> not found!
    libstdc++.so.6 -> not found!
    libgcc_s.so.1 -> not found!
auto-patchelf: 12 dependencies could not be satisfied

I figured out that the first (and actually second too) get resolved by adding libusb1, but I have trouble figuring out the name of the package that contains libwebkit2gtk-4.0.so.37.

Is there some tool that could tell me which packages do I need to install to get these files? Or what is the best way to do this?

10
 
 

Ok, maybe not everywhere, but at least in all my docker directories and some repo directories.

The symlink points to /nix/store/

This is what's in the target directory:

result
├── lib
│   └── locale
│       └── locale-archive
├── nix-support
│   └── setup-hook
└── share
    └── i18n
        └── SUPPORTED

How do I get it to stop creating this 'result' symlink all over the place? My google-fu failed to find me an answer.

-- A little more info for clarity: I'm currently running on Ubuntu, I used nix-env to install some apps in the past. What other info is relevant?

11
 
 

i'm using home manager on a non nixos distro (gentoo), and I like it because I can declarative configure my programs, eg firefox nushell etc etc. but, each time I have to unlink some programs in ~/.nix-profile/bin/ because they get picked up instead of the one that are native to my system (managed via package manager).
i've been unlink manually, but is there a way to tell home manager "just configure this, don't install the binary"?

12
 
 

Nothing fancy, I just put

programs.vscode.enable = true;

in home manager config. I am presented with this error after a successful rebuild switch.

[1117/114505.763499:FATAL:v8_initializer.cc(538)] Error loading V8 startup snapshot file
/nix/store/1lqh595004maiapcx72wkp65r1nbnh9n-vscode-1.84.2/bin/.code-wrapped: line 63: 39906 Trace/breakpoint trap   (core dumped) ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"

I have tried a lot of fixes, from reinstalling, to adding some custom settings in vscode config. Nothing seems to work. Thanks in advance! If you want any additional information, let me know.

13
 
 

I'll start by saying I'm super new to vim, so I'm messing around with make a configuration from scratch. As such, I'd like to use nix as my plugin manager; However, I'm seemingly failing to install nvim-tree, and I was hoping someone could point out what I'm missing.

programs.neovim = {
    enable = true;
    defaultEditor = true;
    viAlias = true;
    vimAlias = true;
    vimdiffAlias = true;

    plugins = with pkgs.vimPlugins; [
        # nerdtree
        nvim-tree-lua
        vim-sleuth
        catppuccin-nvim
    ];

    extraConfig = lib.fileContents ./init.vim;
};

This works for installing the other plugins. But I can't seem to access nvim-tree. According to the website (https://github.com/nvim-tree/nvim-tree.lua), I should be able enter :NvimTreeOpen in neovim, but I get "Not an editor command: NvimTreeOpen." Any ideas?

Thanks.

14
15
 
 

Is anyone else experiencing this? when I try and launch lxqt-config from the terminal I get the message 'Menu file not defined'

16
 
 

Hello everyone, I just found out that it's possible to use NixOS on WSL. But I'm wondering if it really works properly so please let me know if you've used it. Would help a lot!

Btw this is the video that talks about it: https://youtu.be/UmRXXYxq8k4?si=8LAY__35DiVlwZY7

17
18
 
 

I've been seeing that nix develop takes a very long time on large projects, and I believe it's due to the whole folder being copied to the store.

nix-shell doesn't have this problem, but I need flakes specifically because they allow to have runtime libraries, which shell doesn't seem to support. (Translating flake.nix to a shell.nix exactly has different execution results.)

What can I do? I've tried putting the flake.nix on an empty subfolder, and it solves it, but it's extremely tedious and clunky.

19
 
 

jounalctl gives the error -

Nov 16 22:34:46 nixos kernel: input: MSFT0001:01 04F3:3140 Touchpad as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-2/i2c-MSFT00
01:01/0018:04F3:3140.0001/input/input15
Nov 16 22:34:46 nixos kernel: hid-multitouch 0018:04F3:3140.0001: input,hidraw0: I2C HID v1.00 Mouse [MSFT0001:01 04F3:3140] on i2c-MSFT0
001:01
Nov 16 22:34:46 nixos kernel: mousedev: PS/2 mouse device common for all mice
Nov 16 22:34:47 nixos kernel: Bluetooth: hci0: Waiting for firmware download to complete
Nov 16 22:34:47 nixos kernel: Bluetooth: hci0: Firmware loaded in 1603830 usecs
Nov 16 22:34:47 nixos kernel: Bluetooth: hci0: Waiting for device to boot
Nov 16 22:34:47 nixos kernel: Bluetooth: hci0: Device booted in 14713 usecs
Nov 16 22:34:47 nixos kernel: Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-19-0-4.ddc
Nov 16 22:34:47 nixos kernel: Bluetooth: hci0: Applying Intel DDC parameters completed
Nov 16 22:34:47 nixos kernel: Bluetooth: hci0: Firmware revision 0.4 build 249 week 27 2023
Nov 16 22:34:47 nixos kernel: NVRM nvAssertOkFailedNoLog: Assertion failed: Invalid data passed [NV_ERR_INVALID_DATA] (0x00000025) returned from PlatformRequestHandler failed to get target temp from SBIOS @ platform_request_handler_ctrl.c:2146
Nov 16 22:34:47 nixos kernel: NVRM nvAssertFailedNoLog: Assertion failed: PRH failed to update thermal limit! @ platform_request_handler.c:685
Nov 16 22:34:47 nixos systemd-modules-load[497]: Inserted module 'nvidia_uvm'
Nov 16 22:34:47 nixos kernel: nvidia-uvm: Loaded the UVM driver, major device number 237.
Nov 16 22:34:47 nixos kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
Nov 16 22:34:47 nixos systemd-modules-load[497]: Inserted module 'nvidia_drm'
Nov 16 22:34:47 nixos systemd[1]: Finished Load Kernel Modules.

I don't really know if this is crashing the OS, but this was the only error that I could find. I have intel processor, plus Nvidia MX450 dedicated GPU. I am using hyprland on NixOS. My video and audio settings in hardware-configuration.nix are as follows :

# Graphics Stuff

  hardware.opengl = {
    enable = true;
    driSupport = true;
    driSupport32Bit = true;
  };

  hardware.nvidia = {
    modesetting.enable = true;
    open = true;
    nvidiaSettings = true; 
    package = config.boot.kernelPackages.nvidiaPackages.stable;
  };

  hardware.nvidia.prime = {
    offload = {
      enable = true;
      enableOffloadCmd = true;
    };
    intelBusId = "PCI:00:02:0";
    nvidiaBusId = "PCI:01:00:0";
  };

  # Audio Stuff

  services.pipewire = {
    enable = true;
    alsa.enable = true;
    audio.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
  }; 

Hyprland parameters are as follows :

programs.hyprland = {
    enable = true; 
    xwayland = {
      enable = true;
    };
  };

x11 parameters :

services.xserver = {
    enable = true;
    layout = "us";
    videoDrivers = ["nvidia"];
    libinput = {
      enable = true;
    };
  };
20
 
 

Any suggestions to make my internal webcam work, it works sometimes but sometimes not.. Installed nix os recently and pre-installed cheese webcam not showing my webcam and only No devices found . similar to online web apps too..

21
 
 

Hello,

i cant decide whats better: NixOs with his Configuration File and Snapshots of the complete System or other Linux Distro with ZFS.

Can you say whats make more sence on day2day use?

22
 
 

Reminder: the first episode of the 2023 Nix Developer Dialogues will be streamed this Friday, 2023-11-17 10:30 UTC.

Hope to see you there!

23
 
 

Kind of a strange question, but let's say that the apocalypse occurs, or at least solar flares that knock out the internet for months. What services would you need to self-host to be able to arbitrarily configure and build a NixOS based system?

Ideally, you'd point your system to self-hosted services, such as your own nixpkgs and binary cache, which get synced with public repos regularly. Is that all that is needed? Or would there be more to it? How would you ensure the cache has all needed packages? Presumably you wouldn't be able to rebuild a lot of packages without internet. Or can dependencies be cached as well?

24
 
 

So I have been using PopOS/Mint for a couple of years now and I regularly listen to Linux Unplugged and have been getting some FOMO when all they talk about how great NixOS is. So I guess my default starting point is going to be a Vm through VMware. My question is: Is this a good place to start? Should I just use a basic desktop on bare metal to get it running.

25
 
 

Is anyone running the unstable channel having issues upgrading due to python3.10-subliminal failing to build?

view more: next ›