Skip to content

Commit

Permalink
fix: make elmer into a proper module
Browse files Browse the repository at this point in the history
This fixes the flake check not passing
  • Loading branch information
mk3z committed Jul 25, 2024
1 parent 9a7c753 commit 8581dc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions checks/side-effects.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ let
modules = [
configModule
];
specialArgs = { inherit inputs; };
};
wslModuleConfig = inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules = [
configModule
inputs.self.nixosModules.wsl
];
specialArgs = { inherit inputs; };
};
in
# Check that both configs evaluate to the same derivation
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
config = { legacy ? false }: { config, lib, pkgs, ... }: {
wsl.enable = true;
wsl.nativeSystemd = lib.mkIf legacy false;
wsl.elmer.enable = true;
programs.bash.loginShellInit = "nixos-wsl-welcome";

# When the config is built from a flake, the NIX_PATH entry of nixpkgs is set to its flake version.
Expand All @@ -57,7 +58,6 @@
];
system.stateVersion = config.system.nixos.release;
};
elmer = inputs.elmer.packages.x86_64-linux.gui;
in
{
default = nixpkgs.lib.nixosSystem {
Expand All @@ -66,7 +66,7 @@
self.nixosModules.default
(config { })
];
specialArgs = { inherit elmer; };
specialArgs = { inherit inputs; };
};
};

Expand Down
11 changes: 9 additions & 2 deletions modules/elmer.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{ elmer, ... }: {
environment.systemPackages = [ elmer ];
{ lib, config, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf;
in
{
options.wsl.elmer.enable = mkEnableOption "ElmerFEM";
config = mkIf config.wsl.elmer.enable {
environment.systemPackages = [ inputs.elmer.packages.x86_64-linux.gui ];
};
}

0 comments on commit 8581dc8

Please sign in to comment.