I’ve created a very simple Haskell flake that doesn’t use IFD, so I expect to be able to include it in my NixOS configuration:
{
description = "My NixOS Configuration";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
# My flakes
hello-nix-flake.url = github:mhwombat/hello-nix-flake;
hello-haskell-flake.url = github:mhwombat/hello-haskell-flake;
};
outputs = { self, nixpkgs, hello-nix-flake, hello-haskell-flake, ... }: {
nixosConfigurations = {
wombat11k = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
hello-nix-flake.nixosModules.hello
hello-haskell-flake.nixosModules.${system}
./configuration.nix
];
};
};
};
}
When I try to rebuild my NixOS, I get an error I don’t understand. I’m wasn’t sure if the syntax hello-haskell-flake.nixosModules.${system}
was OK, but this error message seems to indicate that hello-haskell-flake
isn’t visible?
$ sudo nixos-rebuild switch --upgrade
unpacking channels...
building the system configuration...
warning: Git tree '/home/amy/github/nixos-config' is dirty
error: The option `hello-haskell-flake' does not exist. Definition values:
- In `/nix/store/f71alr07xb2swc37fiqjr5h416qcs6wr-source/flake.nix': <function, args: {pkgs}>
Here’s more info on the flake.
$ nix flake show github:mhwombat/hello-haskell-flake
github:mhwombat/hello-haskell-flake/e41c0c5d35a35d4350f68f5f2efc89a8a84ba047
├───defaultPackage
│ ├───aarch64-darwin: package 'hello-haskell-flake-0.1.0.0'
│ ├───aarch64-linux: package 'hello-haskell-flake-0.1.0.0'
│ ├───i686-linux: package 'hello-haskell-flake-0.1.0.0'
│ ├───x86_64-darwin: package 'hello-haskell-flake-0.1.0.0'
│ └───x86_64-linux: package 'hello-haskell-flake-0.1.0.0'
├───devShell
│ ├───aarch64-darwin: development environment 'nix-shell'
│ ├───aarch64-linux: development environment 'nix-shell'
│ ├───i686-linux: development environment 'nix-shell'
│ ├───x86_64-darwin: development environment 'nix-shell'
│ └───x86_64-linux: development environment 'nix-shell'
├───nixosModules
│ ├───aarch64-darwin: NixOS module
│ ├───aarch64-linux: NixOS module
│ ├───i686-linux: NixOS module
│ ├───x86_64-darwin: NixOS module
│ └───x86_64-linux: NixOS module
└───packages
├───aarch64-darwin
│ └───hello-haskell-flake: package 'hello-haskell-flake-0.1.0.0'
├───aarch64-linux
│ └───hello-haskell-flake: package 'hello-haskell-flake-0.1.0.0'
├───i686-linux
│ └───hello-haskell-flake: package 'hello-haskell-flake-0.1.0.0'
├───x86_64-darwin
│ └───hello-haskell-flake: package 'hello-haskell-flake-0.1.0.0'
└───x86_64-linux
└───hello-haskell-flake: package 'hello-haskell-flake-0.1.0.0'