Skip to content

Commit

Permalink
Merge pull request #170 from traP-jp/feat/#169-nixpkgs-2411
Browse files Browse the repository at this point in the history
  • Loading branch information
comavius authored Dec 11, 2024
2 parents 2fce3b6 + 4137334 commit a0d5012
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 30 deletions.
41 changes: 41 additions & 0 deletions exec-container/allpkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
flake-inputs,
system,
}: let
overlays = with flake-inputs; [
(final: prev: {
myGoLibraries = {
inherit gods gonum gostl golang-org-exp;
};
})
(final: prev: {
inherit uv2nix pyproject-nix;
})
rust-overlay.overlays.default
(final: prev: {
inherit seed7-source;
})
(final: prev: {
toj-helper = toj-helper.packages.${system}.default;
toj-utils = import ./utils {pkgs = prev;};
})
];
to-pkgs = {
nixpkgs,
system,
}:
import nixpkgs {
inherit system overlays;
};
in
with flake-inputs; {
default = to-pkgs {inherit system nixpkgs;};
release2405 = to-pkgs {
inherit system;
nixpkgs = nixpkgs-2405;
};
release2411 = to-pkgs {
inherit system;
nixpkgs = nixpkgs-2411;
};
}
3 changes: 2 additions & 1 deletion exec-container/compilers/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs}: let
{allpkgs}: let
pkgs = allpkgs.default;
golang = import ./golang {inherit pkgs;};
brainfuck = import ./brainfuck {inherit pkgs;};
rust = import ./rust {inherit pkgs;};
Expand Down
34 changes: 34 additions & 0 deletions exec-container/flake.lock

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

37 changes: 11 additions & 26 deletions exec-container/flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-2405.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-2411.url = "github:NixOS/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
toj-helper.url = "github:traP-jp/traO-Judge-helper";
pyproject-nix = {
Expand Down Expand Up @@ -39,9 +41,11 @@
};
};

outputs = {
outputs = flake-inputs @ {
self,
nixpkgs,
nixpkgs-2405,
nixpkgs-2411,
flake-utils,
toj-helper,
uv2nix,
Expand All @@ -54,34 +58,15 @@
seed7-source,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
myGoLibraries = {
inherit gods gonum gostl golang-org-exp;
};
})
(final: prev: {
inherit uv2nix pyproject-nix;
})
rust-overlay.overlays.default
(final: prev: {
inherit seed7-source;
})
(final: prev: {
toj-helper = toj-helper.packages.${system}.default;
toj-utils = import ./utils {inherit pkgs;};
})
];
};
allpkgs = import ./allpkgs.nix {inherit flake-inputs system;};
pkgs = allpkgs.default;
in {
packages = {
environment = let
interpreters = import ./interpreters {inherit pkgs;};
compilers = import ./compilers {inherit pkgs;};
tools = import ./tools {inherit pkgs;};
misc = import ./misc {inherit pkgs;};
interpreters = import ./interpreters {inherit allpkgs;};
compilers = import ./compilers {inherit allpkgs;};
tools = import ./tools {inherit allpkgs;};
misc = import ./misc {inherit allpkgs;};
in
pkgs.symlinkJoin {
name = "exec-container-enviroment";
Expand Down
3 changes: 2 additions & 1 deletion exec-container/interpreters/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{pkgs}: let
{allpkgs}: let
pkgs = allpkgs.default;
python = import ./python {inherit pkgs;};
bash = import ./bash {inherit pkgs;};
sed = import ./sed {inherit pkgs;};
Expand Down
3 changes: 2 additions & 1 deletion exec-container/misc/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Files which is not executables.
{pkgs}: let
{allpkgs}: let
pkgs = allpkgs.default;
typescript = import ./typescript {inherit pkgs;};
in {
all = [
Expand Down
4 changes: 3 additions & 1 deletion exec-container/tools/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{pkgs}: {
{allpkgs}: let
pkgs = allpkgs.default;
in {
all = [
pkgs.coreutils
pkgs.toj-helper
Expand Down

0 comments on commit a0d5012

Please sign in to comment.