define base packages in another module

This commit is contained in:
Andreas 2024-09-24 01:01:54 +00:00
parent a39878e91c
commit d0ed46d044
3 changed files with 23 additions and 12 deletions

10
base-packages/default.nix Normal file
View File

@ -0,0 +1,10 @@
{ lib, pkgs }:
{
mkBasePackages = {
inherit pkgs;
packages = [
pkgs.vim
pkgs.haxe
];
};
}

View File

@ -13,17 +13,8 @@
#<nixos-wsl/modules>
];
environment.systemPackages = with pkgs; [
wget
git
vim
wget
curl
haxe
];
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
};
# Enable Experimental Features

View File

@ -6,10 +6,11 @@
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
};
outputs = { self, nixpkgs, nixos-wsl, nix, ...}@inputs:
let
system = if builtins ? currentSystem
let system = if builtins ? currentSystem
then builtins.currentSystem
else "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
basePackages = (import ./base-packages { inherit pkgs; });
in
{
nixosConfigurations = {
@ -22,6 +23,15 @@
system.stateVersion = "24.05";
wsl.enable = true;
nix.settings.experimental-features = ["nix-command" "flakes" ];
environment.systemPackages = basePackages.mkBasePackages.packages [
pkgs.wget
pkgs.git
pkgs.curl
];
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
};
}
];
specialArgs = { inherit inputs; };