aux-search/flake.nix

145 lines
5.4 KiB
Nix
Raw Normal View History

2020-06-18 22:41:01 +00:00
{
description = "Code behind search.nixos.org";
nixConfig.extra-substituters = [ "https://nixos-search.cachix.org" ];
nixConfig.extra-trusted-public-keys = [ "nixos-search.cachix.org-1:1HV3YF8az4fywnH+pAd+CXFEdpTXtv9WpoivPi+H70o=" ];
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
# https://github.com/nix-community/npmlock2nix/blob/master/nix/sources.json
inputs.nixpkgs-npmlock2nix.url = "nixpkgs/c5ed8beb478a8ca035f033f659b60c89500a3034";
inputs.npmlock2nix.url = "github:nix-community/npmlock2nix";
inputs.npmlock2nix.flake = false;
inputs.nixos-infra.url = "github:NixOS/infra";
inputs.nixos-infra.flake = false;
2020-06-18 22:41:01 +00:00
outputs = { self
, nixpkgs
, nixpkgs-npmlock2nix
, flake-utils
, npmlock2nix
, nixos-infra
}:
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
flake-utils.lib.eachDefaultSystem
(system:
2020-06-18 22:41:01 +00:00
let
pkgs = import nixpkgs { inherit system; };
pkgsNpmlock2nix = import nixpkgs-npmlock2nix {
inherit system;
overlays = [
(self: super: {
npmlock2nix = super.callPackage npmlock2nix {};
})
];
};
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
lib = nixpkgs.lib;
warnToUpgradeNix = lib.warn "Please upgrade Nix to 2.7 or later.";
version = lib.fileContents ./VERSION;
nixosChannels =
let
allChannels = (import "${nixos-infra}/channels.nix").channels;
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
filteredChannels =
lib.filterAttrs
(n: v:
2022-06-07 23:55:26 +00:00
builtins.elem v.status ["rolling" "beta" "stable" "deprecated"] &&
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
lib.hasPrefix "nixos-" n &&
v ? variant && v.variant == "primary"
)
allChannels;
in
{
channels =
lib.mapAttrsToList
(n: v:
{
id = lib.removePrefix "nixos-" n;
status = v.status;
jobset =
builtins.concatStringsSep
"/"
(lib.init (lib.splitString "/" v.job));
branch = n;
}
)
filteredChannels;
default =
builtins.head
(builtins.sort (e1: e2: ! (builtins.lessThan e1 e2))
(builtins.map
(lib.removePrefix "nixos-")
(builtins.attrNames
(lib.filterAttrs (_: v: v.status == "stable") filteredChannels)
)
)
);
};
nixosChannelsFile = pkgs.runCommand "nixosChannels.json" {} ''
echo '${builtins.toJSON (builtins.map (c: c.id) nixosChannels.channels)}' > $out
'';
2022-06-07 23:55:26 +00:00
mkDevShell = { inputsFrom ? [], extraPackages ? [], extraShellHook ? "" }:
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
pkgs.mkShell {
inherit inputsFrom;
packages = extraPackages;
shellHook = ''
export NIXOS_CHANNELS='${builtins.toJSON nixosChannels}';
export ELASTICSEARCH_MAPPING_SCHEMA_VERSION="${version}";
'' + extraShellHook;
};
in rec {
packages.default = packages.flake-info;
packages.flake-info = import ./flake-info { inherit pkgs; };
packages.frontend = import ./frontend {
pkgs = pkgs // {
inherit (pkgsNpmlock2nix) npmlock2nix;
};
inherit nixosChannels version;
};
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
packages.nixosChannels = nixosChannelsFile;
devShells.default = mkDevShell {
inputsFrom = [
packages.flake-info
packages.frontend
];
extraPackages = [
pkgs.rustfmt
pkgs.yarn
];
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
extraShellHook = ''
export RUST_SRC_PATH="${pkgs.rustPlatform.rustLibSrc}";
export LINK_MANPAGES_PANDOC_FILTER="${packages.flake-info.LINK_MANPAGES_PANDOC_FILTER}";
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
export PATH=$PWD/frontend/node_modules/.bin:$PATH
'';
};
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
devShells.flake-info = mkDevShell {
inputsFrom = [packages.flake-info];
extraPackages = [pkgs.rustfmt];
extraShellHook = ''
export RUST_SRC_PATH="${pkgs.rustPlatform.rustLibSrc}";
export LINK_MANPAGES_PANDOC_FILTER="${packages.flake-info.LINK_MANPAGES_PANDOC_FILTER}";
'';
2020-06-18 22:41:01 +00:00
};
2021-08-17 08:55:08 +00:00
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
devShells.frontend = mkDevShell {
inputsFrom = [packages.frontend] ;
extraPackages = [pkgs.rustfmt pkgs.yarn];
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
extraShellHook = ''
export PATH=$PWD/frontend/node_modules/.bin:$PATH
rm -rf frontend/node_modules
ln -sf ${packages.frontend.node_modules}/node_modules frontend/
Feat/dynamic import (#473) * Make the channel importer versions dynamic * few things fromt he list 1. add nixos-org-configurations as input to flake.nix 2. evaluate channels.nix file and export channels via environment variable. that environment variable (lets call it NIXOS_CHANNELS) should be present during the build and inside the nix shell. the content of the variable can be JSON. 3. we pickup the NIXOS_CHANNELS environment variable in frontend/webpack.config.js and pass it further to webpack process, just like we do with ELASTICSEARCH_MAPPING_SCHEMA_VERSION. 4. we forward NIXOS_CHANNELS to Elm via frontend/src/index.js as an Elm application flag. Just like we do with other variables there. * Decode nixosChannels in Elm * Use nixosChannels that came via application flag * read nixos channels in github action * defaultNixOSChannel should be calculated * add two pointers where the check should be added * pass nixosChannels to flake-info and remove title, rather calculate it * Add NixosChannels struct validation and validation Error * Read NIXOS_CHANNEL variable * Check channel * Add channel struct to fix parsing NIXOS_CHANNELS * Use `eachDefaultSystem` instead of listing them manually * Add individual dev shells for frontend and backend * Update .github/workflows/import-to-elasticsearch.yml Co-authored-by: Naïm Favier <n@monade.li> * use both development environments by default (as it was) but still provide devShells for each of the subprojects * pkgs.lib → lib everywhere and define lib = nixpkgs.lib before the call to eachDefaultSystem Also, version = lib.fileContents ./VERSION; * Update flake.nix Co-authored-by: Naïm Favier <n@monade.li> * typo * bumping version to test the changes to import-to-elasticsearch github action * some invisibile characters needed to be removed * typo * will this work * typo * forgot the checkout step * add some debugging * typo * read NIXOS_CHANNELS from environment not via argument * fix for the NIXOS_CHANNELS variable Co-authored-by: Janne Heß <janne@hess.ooo> Co-authored-by: ysndr <me@ysndr.de> Co-authored-by: Naïm Favier <n@monade.li>
2022-04-24 21:48:01 +00:00
echo "========================================================"
echo "= To develop the frontend run: cd frontend && yarn dev ="
echo "========================================================"
'';
};
# XXX: for backwards compatibility
devShell = warnToUpgradeNix devShells.default;
defaultPackage = warnToUpgradeNix packages.default;
}
);
2020-06-18 22:41:01 +00:00
}