!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

859 Members
177 Servers

Load older messages


SenderMessageTime
18 Jan 2025
@netpleb:matrix.orgnetpleb figured it out. Needed to us the // operator: nixosConfigurations = forEachSystem (system: { hello-world = .... }) // { hello-world = self.nixosConfigurations.x86_64-linux.hello-world; }; 01:14:17
@netpleb:matrix.orgnetpleb *

if I want a flake output of nixosConfigurations.hello-world but need it to exist for each system architecture, is there a trick to do that? Doing this:

let
    forEachSystem = nixpkgs.lib.genAttrs [ 
      "aarch64-darwin"
      "aarch64-linux"
      "x86_64-darwin"
      "x86_64-linux"
    ];
  in {    
nixosConfigurations = forEachSystem (system: {
   hello-world = nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          # include our module
          self.outputs.nixosModules.default
          ./examples/hello-world-configuration.nix
        ];
      };
      default = self.nixosConfiguration.${system}.hello-world;
};

almost gets me there but it makes me do nix build .#nixosConfigurations.x86_64-linux.hello-world but I want to get rid of that x86_64-linux part of the command and cannot figure out the trick to do so.

01:15:17
@netpleb:matrix.orgnetpleb *

if I want a flake output of nixosConfigurations.hello-world but need it to exist for each system architecture, is there a trick to do that? Doing this:

let
    forEachSystem = nixpkgs.lib.genAttrs [ 
      "aarch64-darwin"
      "aarch64-linux"
      "x86_64-darwin"
      "x86_64-linux"
    ];
  in {    
nixosConfigurations = forEachSystem (system: {
   hello-world = nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          # include our module
          self.outputs.nixosModules.default
          ./examples/hello-world-configuration.nix
        ];
      };
      default = self.nixosConfiguration.${system}.hello-world;
});

almost gets me there but it makes me do nix build .#nixosConfigurations.x86_64-linux.hello-world but I want to get rid of that x86_64-linux part of the command and cannot figure out the trick to do so.

01:15:40
19 Jan 2025
@wiiplayer2:matrix.orgWaldemar Tomme (they/them) changed their display name from Waldemar Tomme to Waldemar Tomme (they/them).08:17:03
21 Jan 2025
@zkourouma:matrix.orgrouma7 changed their profile picture.13:15:38
22 Jan 2025
@nm0i:matrix.org@nm0i:matrix.org left the room.13:23:56
23 Jan 2025
@level8broccoli:matrix.org@level8broccoli:matrix.org joined the room.22:28:40
@thedragon44:matrix.org@thedragon44:matrix.org changed their profile picture.23:45:10
@thedragon44:matrix.org@thedragon44:matrix.org changed their profile picture.23:51:33
24 Jan 2025
@thedragon44:matrix.org@thedragon44:matrix.org changed their profile picture.01:18:39
25 Jan 2025
@tajo48:matrix.orgtajo48 joined the room.02:53:51
@tajo48:matrix.orgtajo48

ayoooo guys im having trouble setting wifi passwords in my nix flake so that my laptop will connect to my home wifi network by default
i have setup like this:

networking.wireless.enable = true;

networking.wireless.networks = {
  "Bonkek" = {
    psk = "Kek12";
  };
};

where my hotspot is ubiquity with wpa2/wpa3

02:56:43
28 Jan 2025
@crunch:kde.orgcrunch joined the room.02:01:42
29 Jan 2025
@kira:jakira.spaceKira joined the room.00:19:28
30 Jan 2025
@hive:the-apothecary.clubEVA-01 changed their profile picture.01:30:56
@a3don:matrix.orga3don joined the room.03:04:49
@a3don:matrix.orga3donHey! 👋 Can I make a flake that installs other packages to a profile individually, instead of as one package?03:06:51
@laurynasp:matrix.orglaurynasp joined the room.08:54:52
@elikoga:matrix.orgelikoga You could run nix profile install $(nix eval .#packages.x86_64-linux --apply builtins.attrNames --json | jq -r '.[] | ".#\(.) "') 12:59:50
@elikoga:matrix.orgelikogaI don't know why but you could do that13:00:00
@a3don:matrix.orga3donThe idea is that I'd like to take a set of packages installed on one machine and move them to another -- but still allow them to be upgraded independently in the future15:25:31
@elikoga:matrix.orgelikoga I think working with ad hoc shell scripts is your best bet with that use case. As you can see, a creative application of nix eval, jq, or tools like find or xargs can build many of the things you need 15:27:21
@a3don:matrix.orga3dongot it, thanks!15:56:27
31 Jan 2025
@vhdirk:matrix.orgDirk Van Haerenborgh changed their display name from Dirk Van Haerenborgh to Dirk Van Haerenborgh @ FOSDEM.13:48:01
1 Feb 2025
@ohchase:envs.netohchase joined the room.16:14:00
@togareth:matrix.orgtogareth joined the room.16:15:09
@myhlamaeus:matrix.orgmyhlamaeus joined the room.18:32:04
2 Feb 2025
@llakala:matrix.orgllakala

Is anyone well-versed enough in Flakes internals to know how Nix turns a flakeref string (i.e. "github:nixos/nixpkgs") into a URL? Or, if it doesn't do that, how it works with the input without having an intermediary URL stage?

I have a project where I take the flake.lock data and reconstruct the input data into a URL, so I can use git ls-remote and see if the input has changed at all (so I can see which inputs would be updated, without waiting the 15-30 seconds for nix flake update to run). However, I've run into less easy input types to work with, and it's made me question whether I'm reinventing the wheel here.

03:27:22
@pederbs:pvv.ntnu.nopbsds changed their display name from pbsds to pbsds (FOSDEM).16:04:28
@tanvir:mozilla.org@tanvir:mozilla.org removed their profile picture.16:04:28

Show newer messages


Back to Room ListRoom Version: 6