chore(nix): update flake.nix and shell.nix
This commit is contained in:
parent
28f245dfe4
commit
1a678d4b9d
17
flake.lock
17
flake.lock
@ -1,5 +1,21 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"docker-nixpkgs": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1678089139,
|
||||||
|
"narHash": "sha256-cK0RDcxR4eWMrdZIcqNVqnjo9k2LwVmNZO3qj1ctDXU=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "docker-nixpkgs",
|
||||||
|
"rev": "2205fb4968adf683324e6d0401b74b9d250d8f56",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "docker-nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678901627,
|
"lastModified": 1678901627,
|
||||||
@ -34,6 +50,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"docker-nixpkgs": "docker-nixpkgs",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
|||||||
74
flake.nix
74
flake.nix
@ -2,14 +2,21 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
{
|
rec {
|
||||||
inputs = {
|
inputs = {
|
||||||
|
# haskell-nix = {
|
||||||
|
# url = "github:input-output-hk/haskell.nix";
|
||||||
|
# };
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "NixOS";
|
owner = "NixOS";
|
||||||
repo = "nixpkgs";
|
repo = "nixpkgs";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
};
|
};
|
||||||
|
docker-nixpkgs = {
|
||||||
|
url = "github:nix-community/docker-nixpkgs";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
flake-utils = {
|
flake-utils = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "numtide";
|
owner = "numtide";
|
||||||
@ -18,19 +25,74 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem
|
outputs = { self, nixpkgs, docker-nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let pkgs = import nixpkgs {
|
let frontendSource = pkgs.lib.sourceByRegex ./. [
|
||||||
inherit system;
|
"^(assets|frontend)(/.*)?$"
|
||||||
|
"^config(/(favicon\.json|robots\.txt))?$"
|
||||||
|
"^(webpack|postcss)\.config\.js$"
|
||||||
|
"^karma\.conf\.js$"
|
||||||
|
"^(package|jsconfig|\.eslintrc)\.json$"
|
||||||
|
"^\.babelrc$"
|
||||||
|
];
|
||||||
|
|
||||||
|
backendSource = pkgs.lib.sourceByRegex ./. [
|
||||||
|
"^(\.hlint|package|stack-flake)\.yaml$"
|
||||||
|
"^stack\.yaml\.lock$"
|
||||||
|
"^config(/(archive-types|mimetypes|personalised-sheet-files-collate|settings\.yml|submission-blacklist|test-settings\.yml|video-types|wordlist\.txt))?$"
|
||||||
|
"^routes$"
|
||||||
|
"^testdata(/.*)?$"
|
||||||
|
];
|
||||||
|
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system overlays;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
overlay = import ./nix/maildev;
|
|
||||||
|
overlays = [
|
||||||
|
(import "${docker-nixpkgs}/overlay.nix")
|
||||||
|
|
||||||
|
(import ./nix/maildev)
|
||||||
|
# haskell-nix.overlay
|
||||||
|
(import ./nix/uniworx { inherit inputs frontendSource backendSource; })
|
||||||
|
(import ./nix/docker { inherit self; })
|
||||||
|
(import ./nix/parse-changelog.nix {})
|
||||||
|
];
|
||||||
|
|
||||||
|
haskellFlake = pkgs.uniworx.flake {};
|
||||||
|
|
||||||
|
mkPushDocker = imageName: dockerImage: pkgs.writeScriptBin "push-${dockerImage.imageName}" ''
|
||||||
|
#!${pkgs.zsh}/bin/zsh -xe
|
||||||
|
|
||||||
|
target=''${1-docker://registry.gitlab.com/fradrive/fradrive/${imageName}:${dockerImage.imageTag}}
|
||||||
|
[[ -n "''${1}" ]] && shift
|
||||||
|
${pkgs.skopeo}/bin/skopeo ''${@} --insecure-policy copy docker-archive://${dockerImage} ''${target}
|
||||||
|
'';
|
||||||
|
|
||||||
inherit (pkgs.lib) recursiveUpdate;
|
inherit (pkgs.lib) recursiveUpdate;
|
||||||
in {
|
in {
|
||||||
|
packages = haskellFlake.packages // {
|
||||||
|
inherit (pkgs) uniworxNodeDependencies uniworxWellKnown uniworxFrontend uniworxDemoDocker uniworxDocker ciDocker changelogJson;
|
||||||
|
};
|
||||||
|
|
||||||
|
apps = haskellFlake.apps // {
|
||||||
|
pushUniworxDemoDocker = flake-utils.lib.mkApp { drv = mkPushDocker "uniworx-demo" pkgs.uniworxDemoDocker; };
|
||||||
|
pushUniworxDocker = flake-utils.lib.mkApp { drv = mkPushDocker "uniworx" pkgs.uniworxDocker; };
|
||||||
|
pushCIDocker = flake-utils.lib.mkApp { drv = mkPushDocker "nix-unstable" pkgs.ciDocker; };
|
||||||
|
calculateMaterializedSha = flake-utils.lib.mkApp { drv = pkgs.uniworx.stack-nix.passthru.calculateMaterializedSha; execPath = ""; };
|
||||||
|
jqChangelogJson = flake-utils.lib.mkApp { drv = pkgs.jqChangelogJson; };
|
||||||
|
};
|
||||||
|
|
||||||
|
checks = haskellFlake.checks // {
|
||||||
|
uniworxFrontend = pkgs.uniworxFrontend.check;
|
||||||
|
};
|
||||||
|
|
||||||
devShell = import ./shell.nix { pkgs = self.legacyPackages.${system}; nixpkgsPath = nixpkgs; };
|
devShell = import ./shell.nix { pkgs = self.legacyPackages.${system}; nixpkgsPath = nixpkgs; };
|
||||||
|
|
||||||
legacyPackages = recursiveUpdate (overlay self.legacyPackages.${system} pkgs) pkgs;
|
legacyPackages = pkgs.lib.foldr (overlay: acc: acc // recursiveUpdate (overlay self.legacyPackages.${system} pkgs) pkgs) {} overlays;
|
||||||
|
|
||||||
|
defaultPackage = self.packages.${system}."uniworx:exe:uniworx";
|
||||||
|
defaultApp = self.apps.${system}."uniworx:exe:uniworx";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>
|
# SPDX-FileCopyrightText: 2022-2023 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@uniworx.de>,Steffen Jost <jost@tcs.ifi.lmu.de>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
@ -284,6 +284,7 @@ in pkgs.mkShell {
|
|||||||
babel-german babel-english booktabs textpos
|
babel-german babel-english booktabs textpos
|
||||||
enumitem eurosym koma-script parskip xcolor dejavu
|
enumitem eurosym koma-script parskip xcolor dejavu
|
||||||
luatexbase lualatex-math unicode-math selnolig # required for LuaTeX
|
luatexbase lualatex-math unicode-math selnolig # required for LuaTeX
|
||||||
|
;
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
) ++ (with pkgs.haskellPackages; [ stack yesod-bin hlint cabal-install weeder profiteur ]);
|
) ++ (with pkgs.haskellPackages; [ stack yesod-bin hlint cabal-install weeder profiteur ]);
|
||||||
|
|||||||
Reference in New Issue
Block a user