| 4 Mar 2024 |
accelbread | I named it combining "flake" with one of my favorite words, "snowlight" | 21:10:22 |
cmacrae | oh I love that - so funny that it wasn't intentional | 21:10:40 |
accelbread | Yeah nix icon with missing peg is already used by nix-community | 21:12:03 |
cmacrae | yeah, not all that inspired an idea either 😂 | 21:15:40 |
| 5 Mar 2024 |
cmacrae | 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 |
cmacrae | * 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 | 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 | That pulls home-manager's packages set (which flakelight sets to nixpkgs and adds its overlays on top of) | 17:47:28 |
accelbread | 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 | Though home-manager doesn't seem to have a home-manager.users.* option (thats in the NixOS home-manager module) | 17:50:15 |
accelbread | 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 | * 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 |
cmacrae | ahhh, okay yeah that makes sense! thanks so much for the swift response 🙌 | 17:56:44 |
| 8 Mar 2024 |
accelbread | 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 | * 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 | * 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 |
accelbread | * 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).
- Maybe small perf impact as have to read flake lock?
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:46:49 |
| 10 Mar 2024 |
accelbread | I'll also be at Nixcon NA btw | 03:54:31 |
cmacrae | yeah I like your above approval. personally, the main reason I use flakelight is because of how succinct and elegant it is. I think as long as it's well documented and passing inputs explicitly can override detected ones, it's a nice addition :) | 09:02:48 |
| 11 Mar 2024 |
accelbread | Added the change; should now only need to set inputs if using self or want to override | 02:49:04 |
accelbread | * Added the change; should now only need to set inputs if using inputs.self or want to override | 02:49:30 |
| 13 Mar 2024 |
cmacrae | just wondering, regarding devShells in flakelight, is there a means to use something like devenv ? it has it's own devenv.lib.mkShell which I'd love to be able to use with flakelight | 13:49:14 |
accelbread | Yeah, you can just set any of the devshells to the output of that function | 14:58:08 |
accelbread | Something like:
{
inputs = {
flakelight.url = "github:nix-community/flakelight";
devenv.url = "github:cachix/devenv";
};
outputs = { flakelight, devenv, ... }:
flakelight ./. {
};
}
| 15:08:40 |
accelbread | * Something like:
{
inputs = {
flakelight.url = "github:nix-community/flakelight";
devenv.url = "github:cachix/devenv";
};
outputs = { flakelight, devenv, ... }:
flakelight ./. {
devShell = { pkgs, inputs, ... }: devenv.lib.mkShell {
inherit inputs pkgs;
...
};
};
}
| 15:10:18 |
accelbread | there we go, not used to enter in middle of message submitting ha | 15:10:43 |
accelbread | * Something like:
{
inputs = {
flakelight.url = "github:nix-community/flakelight";
devenv.url = "github:cachix/devenv";
};
outputs = { flakelight, devenv, ... }:
flakelight ./. {
devShell = { pkgs, inputs, ... }: devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
];
};
};
}
| 15:16:35 |
accelbread | * Something like:
{
inputs = {
flakelight.url = "github:nix-community/flakelight";
devenv.url = "github:cachix/devenv";
};
outputs = { flakelight, devenv, ... }:
flakelight ./. {
devShell = { pkgs, inputs, ... }: devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
# Your stuff here
];
};
};
}
| 15:17:10 |
accelbread | I think that should work? Though it seems devenv requires impure? | 15:17:32 |
cmacrae | awesome, how about if I wanted to use the autoload for devShells/ ? | 16:01:36 |