2020-12-10 20:58:21 +11:00
|
|
|
{
|
2021-11-13 18:51:16 +11:00
|
|
|
description = "xeals's Nix repository";
|
2020-12-10 20:58:21 +11:00
|
|
|
|
2021-11-13 18:51:16 +11:00
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2023-02-23 09:48:25 +11:00
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
2020-12-10 20:58:21 +11:00
|
|
|
|
2023-02-23 09:48:25 +11:00
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
2020-12-10 20:58:21 +11:00
|
|
|
let
|
2021-11-13 18:51:16 +11:00
|
|
|
inherit (nixpkgs) lib;
|
2023-02-23 09:48:25 +11:00
|
|
|
inherit (flake-utils.lib) mkApp;
|
2020-12-10 20:58:21 +11:00
|
|
|
in
|
2023-02-23 09:48:25 +11:00
|
|
|
flake-utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
2021-11-13 18:51:16 +11:00
|
|
|
let
|
2023-02-23 09:48:25 +11:00
|
|
|
pkgs = import nixpkgs { inherit system; };
|
2021-11-13 18:51:16 +11:00
|
|
|
in
|
|
|
|
{
|
2023-09-21 12:27:35 +10:00
|
|
|
packages = import ./pkgs/top-level { localSystem = system; inherit pkgs; };
|
2023-02-23 09:48:25 +11:00
|
|
|
|
2023-02-23 10:51:53 +11:00
|
|
|
checks = {
|
2023-09-27 17:24:53 +10:00
|
|
|
# FIXME: Disabled until I can work out what to do with generated code.
|
|
|
|
# nixpkgs-fmt = pkgs.writeShellScriptBin "nixpkgs-fmt-check" ''
|
|
|
|
# ${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check .
|
|
|
|
# '';
|
|
|
|
# deadnix = pkgs.writeShellScriptBin "deadnix-check" ''
|
|
|
|
# ${pkgs.deadnix}/bin/deadnix --fail .
|
|
|
|
# '';
|
2023-03-06 11:59:25 +11:00
|
|
|
# Ensures that the NUR bot can evaluate and find all our packages.
|
|
|
|
# Normally we'd also run with `--option restrict-eval true`, but
|
|
|
|
# this is incompatible with flakes because reasons.
|
|
|
|
nur = pkgs.writeShellScriptBin "nur-check" ''
|
2023-06-20 16:21:11 +10:00
|
|
|
# Prefer nixpkgs channel (actual build), otherwise read from flake.lock (CI)
|
|
|
|
if ! nixpkgs=$(nix-instantiate --find-file nixpkgs 2>/dev/null); then
|
|
|
|
_rev=$(${pkgs.jq}/bin/jq -r .nodes.nixpkgs.locked.rev flake.lock)
|
|
|
|
nixpkgs="https://github.com/nixos/nixpkgs/archive/''${_rev}.tar.gz"
|
|
|
|
fi
|
2023-03-06 11:59:25 +11:00
|
|
|
nix-env -f . -qa \* --meta \
|
|
|
|
--allowed-uris https://static.rust-lang.org \
|
|
|
|
--option allow-import-from-derivation true \
|
|
|
|
--drv-path --show-trace \
|
2023-06-20 16:21:11 +10:00
|
|
|
-I nixpkgs="$nixpkgs" \
|
2023-03-06 11:59:25 +11:00
|
|
|
-I ./ \
|
|
|
|
--json | ${pkgs.jq}/bin/jq -r 'values | .[].name'
|
|
|
|
'';
|
2023-02-23 10:51:53 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
devShells.ci = pkgs.mkShellNoCC {
|
2023-02-23 10:21:52 +11:00
|
|
|
buildInputs = [ pkgs.nix-build-uncached ];
|
|
|
|
};
|
|
|
|
|
2023-02-23 09:48:25 +11:00
|
|
|
apps = {
|
|
|
|
alacritty = mkApp { drv = pkgs.alacritty-ligatures; exePath = "/bin/alacritty"; };
|
|
|
|
protonmail-bridge = mkApp { drv = pkgs.protonmail-bridge; };
|
|
|
|
protonmail-bridge-headless = mkApp { drv = pkgs.protonmail-bridge; };
|
|
|
|
psst-cli = mkApp { drv = pkgs.psst; exePath = "/bin/psst-cli"; };
|
|
|
|
psst-gui = mkApp { drv = pkgs.psst; exePath = "/bin/psst-gui"; };
|
|
|
|
samrewritten = mkApp { drv = pkgs.samrewritten; };
|
|
|
|
spotify-ripper = mkApp { drv = pkgs.spotify-ripper; };
|
|
|
|
};
|
|
|
|
})
|
|
|
|
// {
|
|
|
|
nixosModules = lib.mapAttrs (_: path: import path) (import ./modules) // {
|
|
|
|
default = {
|
|
|
|
imports = lib.attrValues self.nixosModules;
|
|
|
|
};
|
|
|
|
};
|
2021-11-13 18:51:16 +11:00
|
|
|
|
2023-02-23 09:48:25 +11:00
|
|
|
overlays = import ./overlays // {
|
|
|
|
pkgs = _: prev: import ./pkgs/top-level/all-packages.nix { pkgs = prev; };
|
|
|
|
default = _: _: { xeals = nixpkgs.lib.composeExtensions self.overlays.pkgs; };
|
|
|
|
};
|
2021-11-13 18:51:16 +11:00
|
|
|
};
|
2020-12-10 20:58:21 +11:00
|
|
|
}
|