Skip to content

Instantly share code, notes, and snippets.

@randallb
Created January 22, 2025 23:58
Show Gist options
  • Save randallb/469bed145962242436fa6d7841b7250c to your computer and use it in GitHub Desktop.
Save randallb/469bed145962242436fa6d7841b7250c to your computer and use it in GitHub Desktop.
My base flake.
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, flake-utils, nixpkgs-unstable }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgsForSystem = nixpkgsSource:
let
filteredSrc = builtins.filterSource
(path: type: baseName: ! (builtins.match ".*/\\.sl" baseName != null))
./.;
nixpkgsEnv = import nixpkgsSource {
inherit system filteredSrc;
config.allowUnfree = true;
};
in
nixpkgsEnv;
pkgs = pkgsForSystem nixpkgs;
unstablePkgs = pkgsForSystem nixpkgs-unstable;
sharedPackages = with pkgs; [
unstablePkgs.deno
];
defaultPackages = with pkgs; [
];
devShellPackages = with pkgs; [
];
deployPackages = with pkgs; [
];
in
rec {
packages.default = pkgs.buildEnv {
name = "defaultPackage";
paths = sharedPackages ++ defaultPackages;
};
packages.deploy = pkgs.buildEnv {
name = "deploy";
paths = deployPackages ++ sharedPackages;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = sharedPackages ++ devShellPackages ++ defaultPackages;
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment