!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

885 Members
179 Servers

Load older messages


SenderMessageTime
18 May 2023
@hab25:matrix.orghab25

Is there some flake input URL syntax for the latest tag of a git repo? For example, I have

# a flake.nix
{
  inputs = {
    fish-plugin-fzf-dot-fish = {
      url = "github:PatrickF1/fzf.fish?ref=v9.5";
      flake = false;
    };
  };
  outputs = {self, ...}: {
    #...
  };
}

Instead of ?ref=v9.5, I'm looking to do something like ?latest_tag so that it automatically just shifts to the latest available tag when I run e.g. nix flake lock --update-input fish-plugin-fzf-dot-fish and therefore give me less toil.

01:19:45
@pyrox:pyrox.devPyrox [Fox/It/She]
In reply to@hab25:matrix.org

Is there some flake input URL syntax for the latest tag of a git repo? For example, I have

# a flake.nix
{
  inputs = {
    fish-plugin-fzf-dot-fish = {
      url = "github:PatrickF1/fzf.fish?ref=v9.5";
      flake = false;
    };
  };
  outputs = {self, ...}: {
    #...
  };
}

Instead of ?ref=v9.5, I'm looking to do something like ?latest_tag so that it automatically just shifts to the latest available tag when I run e.g. nix flake lock --update-input fish-plugin-fzf-dot-fish and therefore give me less toil.

You can just remove the ?ref=v9.5 part to get the latest commit
02:18:04
@pyrox:pyrox.devPyrox [Fox/It/She] So just url = "github:PatrickF1/fzf.fish"; 02:18:28
@hab25:matrix.orghab25
In reply to @pyrox:pyrox.dev
You can just remove the ?ref=v9.5 part to get the latest commit
thanks; I prefer following tags for more stability
14:13:34
19 May 2023
@nowaaay:matrix.orgnowaaay joined the room.15:50:30
@nowaaay:matrix.orgnowaaay

howdy, i have a flake i use for a devShell containing dotnet, nuget, and omnisharp, and i'm wondering how i can prevent these dependencies from clogging up $HOME. here's my flake:

  description = "Basic dotnet dev environment";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem
      (system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
          omnisharp = pkgs.omnisharp-roslyn;

          # nvimrc = ...;
        in
        {
          # Used by `nix develop`
          devShells.default = pkgs.mkShell {
            buildInputs = with pkgs; [
              #basics
              dotnet-sdk
              dotnet-runtime
              #packages
              dotnetPackages.Nuget #install nuget declaratively

              #unit testing
              dotnetPackages.NUnit
              dotnetPackages.NUnitRunners

              #language server of choice
              omnisharp-roslyn
            ];

           # My attempts at decluttering HOME

            DOTNET_ROOT = "\${XDG_DATA_HOME}/dotnet";
            DOTNET_CLI_TELEMETRY_OPTOUT = 1;
            DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "true";

            shellHook = ''
              echo '${nvimrc}' > .nvimrc.lua
              export NUGET_PACKAGES=$XDG_DATA_HOME/nuget
              export OMNISHARPHOME=$XDG_CONFIG_HOME/omnisharp
            '';
          };
        }
      );
}

one thing i've been suggested is to use https://github.com/queer/boxxy, which i'm not against, but i would prefer something native to Nix. supposedly i can fiddle with LD_LIBRARY_PATH to recreate what boxxy does, but i don't know anything about what to do. any pointers?

18:40:24
@joepie91:pixie.townjoepie91 🏳️‍🌈hmm, I don't think this is really within the domain of Nix, to be honest - as it essentially concerns runtime isolation, and Nix only really concerns itself with build/install-time stuff18:50:49
@joepie91:pixie.townjoepie91 🏳️‍🌈both in the sense that I don't think Nix really has tools for this, and in the sense that using arbitrary tools like boxxy wouldn't interfere with Nix usage18:51:16
@joepie91:pixie.townjoepie91 🏳️‍🌈on NixOS, you could use systemd's container spawn stuff and there's even some declarative NixOS container stuff, but that doesn't help you outside of NixOS, and that's more meant for services than for on-demand applications I think18:52:38
@joepie91:pixie.townjoepie91 🏳️‍🌈(though of course the container spawning should be available on any systemd system, but by that point Nix is no longer involved)18:53:05
@joepie91:pixie.townjoepie91 🏳️‍🌈 one thing you could do on a Nix level is actually patch their packages to hardcode a different folder where stuff goes, instead of $HOME, but that'd be software-dependent changes 18:53:43
@joepie91:pixie.townjoepie91 🏳️‍🌈and probably quite a bit more work than "just throw a tool like boxxy at it" :p18:54:22
@joepie91:pixie.townjoepie91 🏳️‍🌈 hmm. I guess you could patch packages so that instead of exposing the original binary, they expose a wrapper script pretending to be that binary, but actually it invokes it via boxxy 18:59:16
@joepie91:pixie.townjoepie91 🏳️‍🌈as a built-in alias of sorts18:59:21
@nowaaay:matrix.orgnowaaaythose are good points, i was hoping i could cast some Nix spells and be done with it 🥲 i do plan to share this with the team, but if i could package boxxy in with this flake and run a shell hook to encapsulate these dependencies i might get what i want. all speculation; i gotta try it first19:00:45
@joepie91:pixie.townjoepie91 🏳️‍🌈sandboxing spells are unfortunately only available in the NixOS Service Management Plus package :p19:02:17
@joepie91:pixie.townjoepie91 🏳️‍🌈would be cool to have a generic Nix utility for boxxy-fying arbitrary packages, though19:03:14
@nowaaay:matrix.orgnowaaaymaybe if i cry loud enough someone will make a nix module out of it19:03:51
@joepie91:pixie.townjoepie91 🏳️‍🌈It Could Be You(tm)19:04:41
@joepie91:pixie.townjoepie91 🏳️‍🌈:p19:04:44
21 May 2023
@loving-melody:matrix.org@loving-melody:matrix.org changed their display name from loving-melody to Melody.20:53:07
23 May 2023
@bendlas:matrix.orgbendlas Does anyone have an example nixos flake, with nixpkgs-config and nixpkgs-overlay, as described under Using nixpkgs.overlays from configuration.nix in https://nixos.wiki/wiki/Overlays? 21:15:12
@sandro:supersandro.deSandro 🐧That should just work as normal and don't change with flakes unless you try to load something which would be considered impure22:31:03
@bendlas:matrix.orgbendlas Sandro 🐧: I'm talking about having nix-build, nix repl and other nixpkgs tools use the same config and overlay as the nixos config. preferrably without setting anything into your home folder. are you positive that this works? 22:47:34
@figsoda:matrix.orgfigsoda but nix-build and nix repl don't read nixpkgs 22:52:50
@figsoda:matrix.orgfigsoda * but nix-build and nix repl don't read nixpkgs unless you tell it to 22:53:01
@bendlas:matrix.orgbendlas and if I do, it would read <nixpkgs-overlay> as well as NIXPKGS_CONFIG, in order to configure nixpkgs. And how would I best configure that with flake-based nixos config? 22:56:56
@bendlas:matrix.orgbendlas Particularly, how would I best make it so that it takes the same configs and overlays, as configured through nixos modules? The wiki section I referenced, has stub files that do import <nixpkgs/nixos> {}, but that doesn't work so well with flakes ... 23:00:01
@figsoda:matrix.orgfigsoda
In reply to @bendlas:matrix.org
and if I do, it would read <nixpkgs-overlay> as well as NIXPKGS_CONFIG, in order to configure nixpkgs. And how would I best configure that with flake-based nixos config?
you can set nixpkgs-overlay in nix.nixPath
23:08:14
@figsoda:matrix.orgfigsoda
In reply to @bendlas:matrix.org
and if I do, it would read <nixpkgs-overlay> as well as NIXPKGS_CONFIG, in order to configure nixpkgs. And how would I best configure that with flake-based nixos config?
* you can set nixpkgs-overlays in nix.nixPath
23:08:26

Show newer messages


Back to Room ListRoom Version: 6