Skip to content

Commit

Permalink
Merge branch 'main' into feat/cleanup-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjobeki committed Oct 13, 2023
2 parents 267ed15 + af64cc5 commit fe14519
Show file tree
Hide file tree
Showing 119 changed files with 4,562 additions and 483 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Install nix
uses: cachix/install-nix-action@6a9a9e84a173d90b3ffb42c5ddaf9ea033fad011 # v23
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/.pre-commit-config.yaml
result
interpreter
__pycache__
__pycache__
*.egg-info
16 changes: 16 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
queue_rules:
- name: default
merge_conditions:
- check-success=buildbot/nix-eval
defaults:
actions:
queue:
allow_merging_configuration_change: true
method: rebase
pull_request_rules:
- name: merge using the merge queue
conditions:
- base=main
- label~=merge-queue|dependencies
actions:
queue:
23 changes: 0 additions & 23 deletions ci.nix

This file was deleted.

83 changes: 83 additions & 0 deletions examples/dream2nix-repo-flake-groups/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
description = "My flake with dream2nix packages";

inputs = {
dream2nix.url = "github:nix-community/dream2nix";
nixpkgs.url = "nixpkgs/nixos-unstable";
};

outputs = inputs @ {
self,
dream2nix,
nixpkgs,
...
}: let
system = "x86_64-linux";
lib = nixpkgs.lib;
in {
# all packages defined inside ./packages/
packages = let
module = {
config,
lib,
dream2nix,
...
}: {
imports = [
dream2nix.modules.dream2nix.groups
];

# Overrides for all package sets
overrides = {};

# We can define various package sets
groups = {
non-overridden-set = {
overrides = lib.mkForce {};
};
# By default, a set has a packages attribute.
# Additional modules can add support for creating environments.
python-set = {
overrides = {};
devShell = {};
packages = {};
};
nodejs-set = {
# ...
};

final-set = {
imports = [
dream2nix.modules.dream2nix.packages
dream2nix.modules.dream2nix.python-packages
dream2nix.modules.dream2nix.symlinked-env
dream2nix.modules.dream2nix.dev-shell
];
packages = {
inherit
(config.groups.python-set)
requests
aiohttp
;
};
symlinked-env = {type = "derivation";};
dev-shell = {type = "derivation";};
# populated automatically
public.symlinked-env = {type = "derivation";};
public.dev-shell = {type = "derivation";};
};
};
};
evaled = lib.evalModules {modules = [module];};
packages = evaled.config.groups.python-set.public.packages;
env = evaled.config.packages-sets.python-set.public.env;
symlinkedEnv = evaled.config.packge-sets.final-set.public.symlinked-env;
in {
inherit
(packages)
hello
torch
;
};
};
}
3 changes: 3 additions & 0 deletions examples/dream2nix-repo-flake-pdm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__pypackages__
.pdm-build
.pdm-python
38 changes: 38 additions & 0 deletions examples/dream2nix-repo-flake-pdm/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
description = "My flake with dream2nix packages";

inputs = {
dream2nix.url = "github:nix-community/dream2nix?dir=modules";
nixpkgs.follows = "dream2nix/nixpkgs";
};

outputs = inputs @ {
self,
dream2nix,
nixpkgs,
...
}: let
system = "x86_64-linux";
lib = nixpkgs.lib;
module = {
config,
lib,
dream2nix,
...
}: {
imports = [
dream2nix.modules.dream2nix.WIP-python-pdm
];
pdm.lockfile = ./pdm.lock;
pdm.pyproject = ./pyproject.toml;
pdm.pythonInterpreter = nixpkgs.legacyPackages.python3;
};
evaled = lib.evalModules {
modules = [module];
specialArgs.dream2nix = dream2nix;
specialArgs.packageSets.nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
};
in {
packages.${system} = evaled.config.groups.default.public.packages;
};
}
103 changes: 103 additions & 0 deletions examples/dream2nix-repo-flake-pdm/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions examples/dream2nix-repo-flake-pdm/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

[project]
name = "my-project"
version = "0.1.0"
description = ""
dependencies = [
"requests>=2.31.0",
]
requires-python = ">=3.10"
readme = "README.md"
license = {text = "MIT"}
[project.optional-dependencies]
dev = [
"pi>=0.1.2",
]

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
Empty file.
6 changes: 3 additions & 3 deletions examples/dream2nix-repo-flake/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

inputs = {
dream2nix.url = "github:nix-community/dream2nix";
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs.follows = "dream2nix/nixpkgs";
};

outputs = inputs @ {
Expand All @@ -18,8 +18,8 @@
packages.${system} = dream2nix.lib.importPackages {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = ".project-root";
packagesDir = "/packages";
projectRootFile = "flake.nix";
packagesDir = ./packages;
packageSets.nixpkgs = nixpkgs.legacyPackages.${system};
};
};
Expand Down
5 changes: 0 additions & 5 deletions examples/dream2nix-repo-flake/settings.nix

This file was deleted.

28 changes: 28 additions & 0 deletions examples/dream2nix-repo-single-package/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
description = "My flake with dream2nix packages";

inputs = {
dream2nix.url = "github:nix-community/dream2nix";
nixpkgs.follows = "dream2nix/nixpkgs";
};

outputs = inputs @ {
self,
dream2nix,
nixpkgs,
...
}: let
system = "x86_64-linux";
in {
# all packages defined inside ./packages/
packages.${system}.default = nixpkgs.lib.evalModules {
modules = [];

projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
packagesDir = ./packages;
packageSets.nixpkgs = nixpkgs.legacyPackages.${system};
};
};
}
6 changes: 3 additions & 3 deletions examples/dream2nix-repo/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
url = "https://github.com/nix-community/dream2nix/tarball/main";
# sha256 = "";
},
pkgs ? import (import dream2nixSource).inputs.nixpkgs {},
}: let
dream2nix = import dream2nixSource;
nixpkgs = import dream2nix.inputs.nixpkgs {};
# all packages defined inside ./packages/
packages = dream2nix.lib.importPackages {
projectRoot = ./.;
# can be changed to ".git" to get rid of .project-root
projectRootFile = ".project-root";
packagesDir = "/packages";
packageSets.nixpkgs = nixpkgs;
packagesDir = ./packages;
packageSets.nixpkgs = pkgs;
};
in
# all packages defined inside ./packages/
Expand Down
5 changes: 0 additions & 5 deletions examples/dream2nix-repo/settings.nix

This file was deleted.

3 changes: 2 additions & 1 deletion examples/packages/multi-language/python-nodejs/lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@
]
}
}
}
},
"invalidationHash": "255d7306e2485fb3c4e4419fc044fed9dade9ea3d0748396036c0e31ea72a03f"
}
Loading

0 comments on commit fe14519

Please sign in to comment.