| 15 Jul 2025 |
| @softmoonworld:matrix.org set a profile picture. | 00:13:34 |
atagen | devShells is not a project, it's an output of a nix flake ie.
{
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.${system}.default = pkgs.mkShell { packages = [ pkgs.hello ]; };
};
}
| 01:46:56 |
atagen | if you are looking at devenv or something it's totally different and usually unnecessary | 01:47:10 |
@softmoonworld:matrix.org | In reply to @atagen:ch.atagen.co if you are looking at devenv or something it's totally different and usually unnecessary oh i see! i need to read up on this. sounds like i was heading in the right direction with a flake, but wasn't using devShells to wrap my mkShell. will report back | 07:27:29 |
| ginkogruen joined the room. | 22:52:11 |
@softmoonworld:matrix.org | yay it worked! thank you
| 22:58:13 |
| 16 Jul 2025 |
| cods joined the room. | 13:47:38 |
| SCOTT-HAMILTON joined the room. | 14:36:15 |
SCOTT-HAMILTON | Hello, I have a environment that is built with buildEnv.
I've added this buildEnv to a devShell's packages and I can confirm that when I run nix develop the environment is accessible.
How can I create a bash default runnable (nix run) such that running it is equivalent to running nix develop and then running the bash script ?
| 14:38:45 |
SCOTT-HAMILTON | * Hello, I have an environment that is built with buildEnv.
I've added this buildEnv to a devShell's packages and I can confirm that when I run nix develop the environment is accessible.
How can I create a bash default runnable (nix run) such that running it is equivalent to running nix develop and then running the bash script ?
| 14:39:05 |
| 17 Jul 2025 |
atagen | are you perhaps looking for shellHook in the mkShell ? | 04:16:03 |
atagen | using nix run to enter a dev shell seems a little off but if you put the bash script into the shell packages and execute it in shellHook I think you can achieve what you want | 04:17:34 |
atagen | using nix run to enter a dev shell seems a little off but if you put the bash script into the shell packages and execute it in shellHook I think you can achieve what you want with just the nix develop cmd | 04:17:44 |
woobilicious | open the flake in nix repl and look at the devShell attrset to see how it works. and I think for nix run to work you just set mainProgram in the meta section of a package, plenty of examples in nixpkgs. | 06:17:36 |
| jsnf joined the room. | 15:00:04 |
| Thibaut joined the room. | 18:20:07 |
| Tom joined the room. | 18:58:42 |
| 18 Jul 2025 |
| @haauler:matrix.org joined the room. | 14:23:39 |
| Thibaut set a profile picture. | 21:52:51 |
| 21 Jul 2025 |
| @exaltia:chat.exaltia.fr left the room. | 11:07:58 |
| 22 Jul 2025 |
| @exaltia:chat.exaltia.fr joined the room. | 02:21:11 |
| ayoreis joined the room. | 15:32:16 |
ayoreis | using a flake with nixos configuration, should i use the imports list in configuration.nix, or the modules list in flake.nix for including hardware-configuration.nix? | 15:34:25 |
ayoreis | same question with disko-config.nix | 15:55:22 |
Thibaut | I use this:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
home-manager.url = "github:nix-community/home-manager/release-25.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-unfree.url = "github:numtide/nixpkgs-unfree";
nixpkgs-unfree.inputs.nixpkgs.follows = "nixpkgs-unstable";
};
outputs = {
self,
nixpkgs,
home-manager,
nixpkgs-unstable,
...
} @ attrs: {
nixosConfigurations.laptopname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
./configuration.nix
];
};
};
}
and my configuration.nix includes everything for me
| 15:58:18 |
| Max joined the room. | 18:57:01 |
| 24 Jul 2025 |
| codgician changed their profile picture. | 16:58:08 |
| S0AndS0 joined the room. | 23:16:19 |
S0AndS0 | Howdy all! I've got a pending PR that I wanna reduce back-and-forth on, so have been trying to do some local testing to ensure my eyes are crossed.
My end-goal is to have locally cloned NixOS/nixpkgs under a name-space like git-nixpkgs so I can pick-and-choose bits I wanna test. But been hitting some skill issues I have x-)
Got me the source successfully;
mkdir -vp ~/git/hub/NixOS &&
pushd "${_}" &&
git clone --depth=1 git@github.com:NixOS/nixpkgs.git
Did edits and they work when doing import, but now I wanna use the local repo as an inputs to my system flake.nix file, ex;
/etc/nixos/flake.nix (snip)
{
inputs = {
# ...
git-nixpkgs = {
type = "path";
path = "/home/s0ands0/git/hub/NixOS/nixpkgs";
};
};
outputs = { self, ... }@attrs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem = {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
./configuration.nix
# ...
];
};
};
}
... But this is where things fall apart;
/etc/nixos/configuration.nix
{ git-nix, ... }:
{
# ...
services.dictd = {
enable = true;
DBs = with git-nixpkgs.pkgs.dictdDBs; [
gcide
];
};
}
I'm popping errors of pkgs attribute doesn't exist on git-nixpkgs :-(
This be less than fantastic as REPL shows the attribute available if I start it with something like, nix repl --expr 'import /home/s0ands0/git/hub/NixOS/nixpkgs {}', so I feel like I'm missing some key differences between classy flavored Nix imports vs the new fancy flakes?
| 23:22:11 |
S0AndS0 | * Howdy all! I've got a pending PR that I wanna reduce back-and-forth on, so have been trying to do some local testing to ensure my eyes are crossed.
My end-goal is to have locally cloned NixOS/nixpkgs under a name-space like git-nixpkgs so I can pick-and-choose bits I wanna test. But been hitting some skill issues I have x-)
Got me the source successfully;
mkdir -vp ~/git/hub/NixOS &&
pushd "${_}" &&
git clone --depth=1 git@github.com:NixOS/nixpkgs.git
Did edits and they work when doing import, but now I wanna use the local repo as an inputs to my system flake.nix file, ex;
/etc/nixos/flake.nix (snip)
{
inputs = {
# ...
git-nixpkgs = {
type = "path";
path = "/home/s0ands0/git/hub/NixOS/nixpkgs";
};
};
outputs = { self, ... }@attrs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem = {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
./configuration.nix
# ...
];
};
};
}
... But this is where things fall apart;
/etc/nixos/configuration.nix
{ git-nixpkgs, ... }:
{
# ...
services.dictd = {
enable = true;
DBs = with git-nixpkgs.pkgs.dictdDBs; [
gcide
];
};
}
I'm popping errors of pkgs attribute doesn't exist on git-nixpkgs :-(
This be less than fantastic as REPL shows the attribute available if I start it with something like, nix repl --expr 'import /home/s0ands0/git/hub/NixOS/nixpkgs {}', so I feel like I'm missing some key differences between classy flavored Nix imports vs the new fancy flakes?
| 23:23:15 |