!yUrHuDcxUngfTlDbiy:matrix.org

flakelight

38 Members
https://github.com/nix-community/flakelight12 Servers

Load older messages


SenderMessageTime
4 Mar 2024
@cmacr.ae:matrix.orgcmacraespeaking of which, I just had my first day at a new job in a startup which build most of their stuff on rust. hoping to champion Nix at this company and you better believe I'll be doing it with flakelight ✨20:47:05
@accelbread:matrix.orgaccelbreadNice! I also use Nix at work but for embedded c mostly 20:48:12
@accelbread:matrix.orgaccelbreadI use flakelight-rust for application crates, and workspace support was contributed20:49:43
@accelbread:matrix.orgaccelbreadIf using it for a library crate, I'd be interested in knowing how it goes20:50:21
@cmacr.ae:matrix.orgcmacraevery nice :) yeah for sure I'll share experiences with you 👍️20:50:56
@cmacr.ae:matrix.orgcmacraeI'll probably write a blog post about using flakelight some time soon (not a big deal, I seldom write). it's the first time since transitioning to flakes a matter of years ago that I've been satisfied with the composition of my config20:52:08
@accelbread:matrix.orgaccelbreadYeah, I went through using a bunch of flake libraries before i came to the conclusion that I was going to have to write one, ha20:53:29
@cmacr.ae:matrix.orgcmacraewell i'm very glad you did, because we obviously have similar outlooks on how things "should" be done haha20:54:11
@accelbread:matrix.orgaccelbreadOne thing i've noticed, is that a lot of projects have an icon. I didn't think that was needed, and kinda tacky, though I think it may be needed. I just used Nix icon when adding it to nixos-landscape. Now also need one for stuff like chatroom icon21:01:00
@accelbread:matrix.orgaccelbread* One thing i've noticed, is that a lot of projects have an icon. I didn't think that was needed, and kinda tacky, though now I think it may be needed. I just used Nix icon when adding it to nixos-landscape. Now also need one for stuff like chatroom icon21:01:33
@cmacr.ae:matrix.orgcmacraeyeah I feel you - it's almost become a necessity. could be kinda fun from a design perspective at least, though; if you're looking to take something positive from it :) thoughts in my mind immediately point to some sort of Nix logo with fewer "branches", in keeping with the aptly named "light" ethos21:07:53
@cmacr.ae:matrix.orgcmacraebut hey, maybe that's a little boring (most Nix derived projects do something with modifying the logo)21:08:31
@accelbread:matrix.orgaccelbreadOh, I didnt even think to interpret the name as light as in lightweight21:09:24
@cmacr.ae:matrix.orgcmacraeno? haha, that's totally how I interpreted it! like "this is flakes... simplified" in my head 😅21:10:21
@accelbread:matrix.orgaccelbreadI named it combining "flake" with one of my favorite words, "snowlight"21:10:22
@cmacr.ae:matrix.orgcmacraeoh I love that - so funny that it wasn't intentional21:10:40
@accelbread:matrix.orgaccelbreadYeah nix icon with missing peg is already used by nix-community21:12:03
@cmacr.ae:matrix.orgcmacraeyeah, not all that inspired an idea either 😂 21:15:40
5 Mar 2024
@cmacr.ae:matrix.orgcmacrae

yo accelbread - running into an issue with something I'm workin on. any idea why I can't access pkgs.stdenv here?

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    limani.url = "/Users/cmacrae/src/github.com/cmacrae/limani";
    flakelight.url = "github:nix-community/flakelight";
    home-manger.url = "github:nix-community/home-manager";
  };

  outputs = { flakelight, home-manager, ... }@inputs:
    flakelight ./. ({ config, ... }: {
      inherit inputs;
      homeConfigurations.example = pkgs: {
        system = "aarch64-darwin";
        modules = [{
          home.stateVersion = "24.05";

          home-manager.users.example = {
            imports = [ inputs.limani.homeModules.default ];
            programs.limani.enable = true;
            programs.limani.vms.podman = {
              runAtLoad = true;
              config = inputs.limani.vms.podman { inherit pkgs; }; # <- this includes an expression with `pkgs.stdenv`
            };
          };
        }];
      };
    });
}

this yeilds:

nix flake check ./templates/podman --all-systems --override-input limani .

error:
       … while checking flake output 'checks'

         at «none»:0: (source not available)

       … while evaluating the attribute 'optionalValue.value'

         at /nix/store/lwyjz70qh12nq6cb7fixl85vryzxqm3c-source/lib/modules.nix:856:5:

          855|
          856|     optionalValue =
             |     ^
          857|       if isDefined then { value = mergedValue; }

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'stdenv' missing

       at /nix/store/xd5kbp70zxhqq18bfb7xj5mhqzhn07k5-source/examples/podman.nix:3:15:

            2| {
            3|   vmType = if pkgs.stdenv.hostPlatform.isDarwin then "vz" else null;
             |               ^
            4|
16:45:58
@cmacr.ae:matrix.orgcmacrae *

yo accelbread - running into an issue with something I'm working on. any idea why I can't access pkgs.stdenv here?

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    limani.url = "/Users/cmacrae/src/github.com/cmacrae/limani";
    flakelight.url = "github:nix-community/flakelight";
    home-manger.url = "github:nix-community/home-manager";
  };

  outputs = { flakelight, home-manager, ... }@inputs:
    flakelight ./. ({ config, ... }: {
      inherit inputs;
      homeConfigurations.example = pkgs: {
        system = "aarch64-darwin";
        modules = [{
          home.stateVersion = "24.05";

          home-manager.users.example = {
            imports = [ inputs.limani.homeModules.default ];
            programs.limani.enable = true;
            programs.limani.vms.podman = {
              runAtLoad = true;
              config = inputs.limani.vms.podman { inherit pkgs; }; # <- this includes an expression with `pkgs.stdenv`
            };
          };
        }];
      };
    });
}

this yeilds:

nix flake check ./templates/podman --all-systems --override-input limani .

error:
       … while checking flake output 'checks'

         at «none»:0: (source not available)

       … while evaluating the attribute 'optionalValue.value'

         at /nix/store/lwyjz70qh12nq6cb7fixl85vryzxqm3c-source/lib/modules.nix:856:5:

          855|
          856|     optionalValue =
             |     ^
          857|       if isDefined then { value = mergedValue; }

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'stdenv' missing

       at /nix/store/xd5kbp70zxhqq18bfb7xj5mhqzhn07k5-source/examples/podman.nix:3:15:

            2| {
            3|   vmType = if pkgs.stdenv.hostPlatform.isDarwin then "vz" else null;
             |               ^
            4|
16:46:30
@accelbread:matrix.orgaccelbread

flakelight there does not know what system your home-configuration is for, so can only give module args, not pkgs args
Home-manager has its own pkgs set as well

You will need something like this:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    limani.url = "/Users/cmacrae/src/github.com/cmacrae/limani";
    flakelight.url = "github:nix-community/flakelight";
    home-manger.url = "github:nix-community/home-manager";
  };

  outputs = { flakelight, home-manager, ... }@inputs:
    flakelight ./. ({ config, ... }: {
      inherit inputs;
      homeConfigurations.example = {
        system = "aarch64-darwin";
        modules = [({ pkgs, ... }: {
          home.stateVersion = "24.05";

          home-manager.users.example = {
            imports = [ inputs.limani.homeModules.default ];
            programs.limani.enable = true;
            programs.limani.vms.podman = {
              runAtLoad = true;
              config = inputs.limani.vms.podman { inherit pkgs; }; # <- this includes an expression with `pkgs.stdenv`
            };
          };
        })];
      };
    });
}

17:45:39
@accelbread:matrix.orgaccelbreadThat pulls home-manager's packages set (which flakelight sets to nixpkgs and adds its overlays on top of)17:47:28
@accelbread:matrix.orgaccelbread Home-manager allows overriding the pkgs set so it could be shared but that breaks hm nixpkgs.* options that some home modules use 17:48:47
@accelbread:matrix.orgaccelbread Though home-manager doesn't seem to have a home-manager.users.* option (thats in the NixOS home-manager module) 17:50:15
@accelbread:matrix.orgaccelbread

So probably:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    limani.url = "/Users/cmacrae/src/github.com/cmacrae/limani";
    flakelight.url = "github:nix-community/flakelight";
    home-manger.url = "github:nix-community/home-manager";
  };

  outputs = { flakelight, home-manager, ... }@inputs:
    flakelight ./. ({ config, ... }: {
      inherit inputs;
      homeConfigurations.example = {
        system = "aarch64-darwin";
        modules = [({ pkgs, ... }: {
          home.stateVersion = "24.05";

          home-manager.users.example = {
            imports = [ inputs.limani.homeModules.default ];
            programs.limani.enable = true;
            programs.limani.vms.podman = {
              runAtLoad = true;
              config = inputs.limani.vms.podman { inherit pkgs; }; # <- this includes an expression with `pkgs.stdenv`
            };
          };
        })];
      };
    });
}


17:50:56
@accelbread:matrix.orgaccelbread *

So probably:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    limani.url = "/Users/cmacrae/src/github.com/cmacrae/limani";
    flakelight.url = "github:nix-community/flakelight";
    home-manger.url = "github:nix-community/home-manager";
  };

  outputs = { flakelight, home-manager, ... }@inputs:
    flakelight ./. ({ config, ... }: {
      inherit inputs;
      homeConfigurations.example = {
        system = "aarch64-darwin";
        modules = [
          inputs.limani.homeModules.default
          ({ pkgs, ... }: {
            home.stateVersion = "24.05";
            programs.limani.enable = true;
            programs.limani.vms.podman = {
              runAtLoad = true;
              config = inputs.limani.vms.podman { inherit pkgs; }; # <- this includes an expression with `pkgs.stdenv`
            };
          })
        ];
      };
    });
}


17:52:37
@cmacr.ae:matrix.orgcmacraeahhh, okay yeah that makes sense! thanks so much for the swift response 🙌17:56:44
8 Mar 2024
@accelbread:matrix.orgaccelbread

I'd like to float an idea.

If you just want flakelight to provide you a recent nixpkgs (the default), you dont have to do anything:

{
  inputs.flakelight.url = "github:nix-community/flakelight";
  outputs = { flakelight, ... }:
    flakelight ./. {
    };
}

If you want to bring your own nixpkgs, you have to pass it to flakelight:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flakelight.url = "github:nix-community/flakelight";
  };
  outputs = { flakelight, ... }@inputs:
    flakelight ./. {
      inherit inputs;
    };
}

But what if you didn't have to pass it and flakelight would use your input?

Like this:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flakelight.url = "github:nix-community/flakelight";
  };
  outputs = { flakelight, ... }:
    flakelight ./. {
    };
}

Currently, that is having a nixpkgs input, but having flakelight still use its
default.

With this proposal, that becomes using your nixpkgs input for flakelight as well.

Upsides:

  • Easier to just override inputs
  • current behavior might confuse people?
  • Less boilerplate

Downsides:

  • Someone might intentionally want to have a nixpkgs input but still have
    flakelight use the default.

Passing inputs may still be preferred for performance or unusual circumstances,
so of course passed inputs override detected ones. It would also need to be
passed if one wishes to pass inputs and the path passed is not ./..

(The autodetection would work by reading ./flake.lock, which is why if the
path passed is not the usual ./., it can't autodetect.)

04:39:44
@accelbread:matrix.orgaccelbread *

I'd like to float an idea.

If you just want flakelight to provide you a recent nixpkgs (the default), you dont have to do anything:

{
  inputs.flakelight.url = "github:nix-community/flakelight";
  outputs = { flakelight, ... }:
    flakelight ./. {
    };
}

If you want to bring your own nixpkgs, you have to pass it to flakelight:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flakelight.url = "github:nix-community/flakelight";
  };
  outputs = { flakelight, ... }@inputs:
    flakelight ./. {
      inherit inputs;
    };
}

But what if you didn't have to pass it and flakelight would use your input?

Like this:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flakelight.url = "github:nix-community/flakelight";
  };
  outputs = { flakelight, ... }:
    flakelight ./. {
    };
}

Currently, that is having a nixpkgs input, but having flakelight still use its
default.

With this proposal, that becomes using your nixpkgs input for flakelight as well.

Upsides:

  • Easier to just override inputs
  • current behavior might confuse people?
  • Less boilerplate

Downsides:

  • Someone might intentionally want to have a nixpkgs input but still have
    flakelight use the default.

Passing inputs explicitly may still be preferred for performance or unusual circumstances,
so of course passed inputs override detected ones. It would also need to be
passed if one wishes to pass inputs and the path passed is not ./..

(The autodetection would work by reading ./flake.lock, which is why if the
path passed is not the usual ./., it can't autodetect.)

04:41:10
@accelbread:matrix.orgaccelbread *

I'd like to float an idea.

If you just want flakelight to provide you a recent nixpkgs (the default), you dont have to do anything:

{
  inputs.flakelight.url = "github:nix-community/flakelight";
  outputs = { flakelight, ... }:
    flakelight ./. {
    };
}

If you want to bring your own nixpkgs, you have to pass it to flakelight:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flakelight.url = "github:nix-community/flakelight";
  };
  outputs = { flakelight, ... }@inputs:
    flakelight ./. {
      inherit inputs;
    };
}

But what if you didn't have to pass it and flakelight would use your input?

Like this:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flakelight.url = "github:nix-community/flakelight";
  };
  outputs = { flakelight, ... }:
    flakelight ./. {
    };
}

Currently, that is having a nixpkgs input, but having flakelight still use its
default.

With this proposal, that becomes using your nixpkgs input for flakelight as well.

Upsides:

  • Easier to just override inputs
  • current behavior might confuse people?
  • Less boilerplate

Downsides:

  • Someone might intentionally want to have a nixpkgs input but still have
    flakelight use the default (seems unlikely).

Passing inputs explicitly may still be preferred for performance or unusual circumstances,
so of course passed inputs override detected ones. It would also need to be
passed if one wishes to pass inputs and the path passed is not ./..

(The autodetection would work by reading ./flake.lock, which is why if the
path passed is not the usual ./., it can't autodetect.)

04:45:34

Show newer messages


Back to Room ListRoom Version: 10