blob: 32f19d922eb031ef818950342b85ef159b117f59 [file] [log] [blame]
Skyler Greydeea2f72023-05-31 20:14:49 +02001{
2 description = "Description for the project";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6 devenv.url = "github:cachix/devenv";
7 nix2container.url = "github:nlewo/nix2container";
8 nix2container.inputs.nixpkgs.follows = "nixpkgs";
9 mk-shell-bin.url = "github:rrbutani/nix-mk-shell-bin";
10 };
11
12 outputs = inputs@{ flake-parts, ... }:
13 flake-parts.lib.mkFlake { inherit inputs; } {
14 imports = [
15 inputs.devenv.flakeModule
16 ];
17 systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
18
19 perSystem = { config, self', inputs', pkgs, system, ... }: {
20 # Per-system attributes can be defined here. The self' and inputs'
21 # module parameters provide easy access to attributes of the same
22 # system.
23
24 # Equivalent to inputs'.nixpkgs.legacyPackages.hello;
25 packages.default = pkgs.hello;
26
27 devenv.shells.default =
28 let
Skyler Grey40db1d42023-06-02 14:31:24 +020029 scripts = [
Skyler Grey8fffb182023-06-02 15:30:01 +020030 [ "ui" "pnpx shadcn-svelte add" ]
31 [ "nx" "pnpm nx" ]
Skyler Greydeea2f72023-05-31 20:14:49 +020032 ];
33 in
34 {
35 name = "my-project";
36
37 # https://devenv.sh/reference/options/
38 packages = [
39 config.packages.default
40 ] ++ (builtins.attrValues {
41 inherit (pkgs.nodePackages)
42 pnpm
43 svelte-language-server
44 prettier;
45 }) ++ (builtins.attrValues {
Skyler Grey3afac092023-12-08 22:06:29 +000046 inherit (pkgs)
47 netlify-cli;
Skyler Grey40db1d42023-06-02 14:31:24 +020048 nodejs-18_x = (pkgs.nodejs-18_x.override { enableNpm = true; });
49 });
50
51 scripts = pkgs.lib.pipe scripts [
52 (map (alias: {
53 name = builtins.elemAt alias 0;
54 value.exec = (builtins.elemAt alias 1) + " \"$@\"";
55 }))
56 pkgs.lib.listToAttrs
57 ];
Skyler Greydeea2f72023-05-31 20:14:49 +020058 };
59
60 };
61 flake = {
62 # The usual flake attributes can be defined here, including system-
63 # agnostic ones like nixosModule and system-enumerating ones, although
64 # those are more easily expressed in perSystem.
65
66 };
67 };
68}