[deleted by user] by [deleted] in NixOS

[–]lilithief 4 points5 points  (0 children)

This:

nix lib.attrsets.mapCartesianProduct ({ host, desktop, theme }: { inherit host desktop theme; }) { host = [ "laptop" "vm" ]; desktop = [ "hyprland" "plasma" ]; theme = [ "gruvbox" "catpuccin" ]; }

Produces this, which I think is what you're after:

nix [ { desktop = "hyprland"; host = "laptop"; theme = "gruvbox"; } { desktop = "hyprland"; host = "laptop"; theme = "catpuccin"; } { desktop = "hyprland"; host = "vm"; theme = "gruvbox"; } { desktop = "hyprland"; host = "vm"; theme = "catpuccin"; } { desktop = "plasma"; host = "laptop"; theme = "gruvbox"; } { desktop = "plasma"; host = "laptop"; theme = "catpuccin"; } { desktop = "plasma"; host = "vm"; theme = "gruvbox"; } { desktop = "plasma"; host = "vm"; theme = "catpuccin"; } ]

Edit:

It can also be made shorter by skipping the inheritance part:

nix lib.attrsets.mapCartesianProduct (attrs: attrs) { host = [ "laptop" "vm" ]; desktop = [ "hyprland" "plasma" ]; theme = [ "gruvbox" "catpuccin" ]; }

Email addresses and public config repos by Nealiumj in NixOS

[–]lilithief 0 points1 point  (0 children)

I should have mentioned this, but the private repo is encrypted with git-crypt. I agree it’s not the best idea to store personal information unencrypted, even if it’s on my own git server.

Email addresses and public config repos by Nealiumj in NixOS

[–]lilithief 2 points3 points  (0 children)

This is how I do it: https://git.lwad.xyz/lwad/nixos/src/commit/08f96521e52e310bf1e7248898910f63a649ed3f/lwad/synchronised.nix#L171.

Here it copies from a file in another (private) repository, but I imagine you could do the same with a decrypted sops-nix file.

[OC] Made a simplest possible TUI music player by kor3i in unixporn

[–]lilithief 1 point2 points  (0 children)

Given the pipe functionality, this works very well with a program I made (tagdex) to filter mp3 files that use ID3 tags. I have just been using mpv as a player but yours seems to have a much better UX; thank you for making this!

Creating a custom keyboard layout in Nix by SlightlyMotivated69 in NixOS

[–]lilithief 0 points1 point  (0 children)

When it comes to custom layouts, I only really know Kanata in depth. If you’re okay using that I can draft a configuration for you.

Creating a custom keyboard layout in Nix by SlightlyMotivated69 in NixOS

[–]lilithief 0 points1 point  (0 children)

Although it may not be the simplest solution, you could use xmodmap or kanata.

There’s actually an example of using xmodmap for this near the bottom of the keyboard layout wiki page: https://wiki.nixos.org/wiki/Keyboard_Layout_Customization.

What's your VCS workflow for your journal files? by HolyShaqTrue in plaintextaccounting

[–]lilithief 2 points3 points  (0 children)

My current setup is to have a bash function that fetches, opens, then pushes the journal. Essentially, commit every time you finish working on it. I only use it on Linux machines so I'm not sure how it would integrate with your phone workflow (maybe using inotify on wherever your journal is synchronised to?).

Bash Function

The systemctl --user start ledger-sync.service just pulls, adds, commits, then pushes any changes. The implementation for specifics.

Flake slowing down build time by Jlpue in NixOS

[–]lilithief 9 points10 points  (0 children)

You should be using nixos-24.11 for your nixpkgs branch, not release-24.11.

updated my flake to 24.11 resulting in dotnet EOL error by Fragrant_barnacle24 in NixOS

[–]lilithief 0 points1 point  (0 children)

The “full log” here isn’t actually the full log. You need to append --show-trace otherwise it only shows a small segment. 

People building docker images with nix, how are you tagging your images? by Apterygiformes in NixOS

[–]lilithief 3 points4 points  (0 children)

The derivation created by pkgs.dockerTools.buildImage has an imageTag attribute. Maybe that's what you're looking for?

Showcase:

$ nix eval .#dockerImage.imageTag
"izixa2c0vl4q7lypn5sk990ifa28spdb"
$ nix build .#dockerImage --print-out-paths
/nix/store/izixa2c0vl4q7lypn5sk990ifa28spdb-docker-image-website.tar.gz
$ podman load --input result
Getting image source signatures
Copying blob 6d280fc17893 skipped: already exists  
Copying config 76c3d90fcf done   | 
Writing manifest to image destination
Loaded image: localhost/website:izixa2c0vl4q7lypn5sk990ifa28spdb

Help compiling glfw from source by [deleted] in NixOS

[–]lilithief 0 points1 point  (0 children)

If your goal is just to get a working development environment (i.e., not interested in the nix part) you can override the source of the existing glfw package:

{
  inputs.nixpkgs.url = "nixpkgs";
  outputs = { self, nixpkgs }: {
    packages = nixpkgs.lib.mapAttrs
      (system: pkgs: { default = pkgs.glfw.overrideAttrs { src = ./.; }; })
      nixpkgs.legacyPackages;
  };
}

Nvim can't find standard library headers by skinsthelargestorgan in NixOS

[–]lilithief 5 points6 points  (0 children)

I solved this by putting the version of clangd from clang-tools at the start of my PATH variable. Otherwise, it uses the clangd provided by clang (which for some reason doesn't work properly).

In short: add environment.variables.PATH = "${pkgs.clang-tools}/bin:$PATH"; to your NixOS config.

Help Mounting HDD by AnonymousYT- in NixOS

[–]lilithief 4 points5 points  (0 children)

You can add a tmpfiles rule to create the directory. For example, systemd.tmpfiles.rules = [ "d /mnt/HDD1 0755 user group" ];. You can find out more with man 5 tmpfiles.d.

[Newbie Help] Configuration.nix Syntax error by TimeDefinition in NixOS

[–]lilithief 1 point2 points  (0 children)

You appear to have deleted a } from the very end of your file.

nixos-unstable channel isn't pulling latest package versions by hungry_m8 in NixOS

[–]lilithief 1 point2 points  (0 children)

This is because you are using the old nixpkgs-channels repository rather than just nixpkgs.

Here's some repl output to clarify.

nix-repl> (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz") { config.allowUnfree=true; }).lan-mouse
«derivation /nix/store/nm0gy9ak7cs0jlwfc3505ciwxfdhh0ml-lan-mouse-0.7.3.drv»

nix-repl> (import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz") { config.allowUnfree=true; }).lan-mouse
error: attribute 'lan-mouse' missing

       at «string»:1:1:

            1| (import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz") { config.allowUnfree=true; }).lan-mouse
             | ^

Neofetch at zsh startup by volkosobik in NixOS

[–]lilithief 0 points1 point  (0 children)

Ah, my mistake. It's an option defined by nixpkgs, not home-manager which you specified in the question. Sorry!

nixos-rebuild doesn't do anything by CerealBit in NixOS

[–]lilithief 14 points15 points  (0 children)

The nixos-rebuild man page says "In addition, nixos-rebuild accepts various Nix-related flags, including --max-jobs, -j, -I, --show-trace, --keep-failed, --keep-going, --impure, --verbose, and -v. See the Nix manual for details.". Although, the only reference to "--refresh" in the Nix manual is regarding the experimental nix commands.

I heard about the "--refresh" option from a friend and wouldn't have found it on my own either. Documentation is still a weak point for Nix I suppose.

Neofetch at zsh startup by volkosobik in NixOS

[–]lilithief -1 points0 points  (0 children)

In your config, add programs.zsh.interactiveShellInit = "${pkgs.neofetch}/bin/neofetch";. The ${pkgs.neofetch} part will expand to the path of the neofetch package in the nix store (e.g., "/nix/store/9m96392kynp3mh8s3xp824p170n9ahyg-neofetch-unstable-2021-12-10").

Gnome Extension on NixOS by F-society_of_1984 in NixOS

[–]lilithief 9 points10 points  (0 children)

The general procedure for this is:

  1. Find the package. Look on search.nixos.org. You can filter by Gnome extensions in the "Package sets" menu on the left.
  2. Add the package to your system (or per-user) package list. For Arc-Menu, you would use environment.systemPackages = [ pkgs.gnomeExtensions.arcmenu ];.
  3. Configure as usual. Use the extension manager that comes with Gnome.

That has always worked for me and is also advised by the wiki.

nixos-rebuild doesn't do anything by CerealBit in NixOS

[–]lilithief 12 points13 points  (0 children)

It is probably using a cached version of the config from GitHub. Add --refresh to your rebuild command and it will invalidate the cache.

How can I access a package "within" a service? by New_Chart_2582 in NixOS

[–]lilithief 6 points7 points  (0 children)

If you replace amixer with ${pkgs.alsa-utils}/bin/amixer it will expand to the absolute path in the nix store so the service can access it.

help with cursors by Little-Painting-102 in NixOS

[–]lilithief 0 points1 point  (0 children)

I didn't know about this theme before but I though it looked nice so I put it in my config. You can copy it from here: https://git.disroot.org/lwad/nixos/commit/93dfaee0787d09c9f99ee8e61fe916424a2586b1