Created
January 22, 2025 23:58
-
-
Save randallb/469bed145962242436fa6d7841b7250c to your computer and use it in GitHub Desktop.
My base flake.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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