flake: reorganise, remove flake-utils

This commit is contained in:
xeals 2021-11-13 18:51:16 +11:00
parent 311fb3ff98
commit fe773352f5
2 changed files with 43 additions and 47 deletions

16
flake.lock generated
View File

@ -1,20 +1,5 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1634851050,
"narHash": "sha256-N83GlSGPJJdcqhUxSCS/WwW5pksYf3VP1M13cDRTSVA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c91f3de5adaf1de973b797ef7485e441a65b8935",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1636470166,
@ -33,7 +18,6 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}

View File

@ -1,18 +1,27 @@
{
description = "xeals's flake";
description = "xeals's Nix repository";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs }:
let
inherit (flake-utils.lib) eachDefaultSystem flattenTree;
inherit (nixpkgs.lib.attrsets) filterAttrs mapAttrs;
inherit (nixpkgs) lib;
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems = f: lib.genAttrs supportedSystems (system: f system);
in
{
nixosModules = mapAttrs (_: path: import path) (import ./modules);
nixosModules = lib.mapAttrs (_: path: import path) (import ./modules);
overlays = import ./overlays // {
pkgs = final: prev: import ./pkgs/top-level/all-packages.nix { pkgs = prev; };
@ -21,27 +30,30 @@
overlay = final: prev: {
xeals = nixpkgs.lib.composeExtensions self.overlays.pkgs;
};
} // eachDefaultSystem (system:
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
xPkgs = import ./pkgs/top-level/all-packages.nix { inherit pkgs; };
mkApp = opts: { type = "app"; } // opts;
in
rec {
packages = filterAttrs
lib.filterAttrs
(attr: drv: builtins.elem system (drv.meta.platforms or [ ]))
(flattenTree xPkgs);
xPkgs);
apps = flattenTree {
alacritty = mkApp { program = "${packages.alacritty-ligatures}/bin/alacritty"; };
protonmail-bridge = mkApp { program = "${packages.protonmail-bridge}/bin/protonmail-bridge"; };
protonmail-bridge-headless = mkApp { program = "${packages.protonmail-bridge}/bin/protonmail-bridge"; };
psst = {
cli = mkApp { program = "${packages.psst}/bin/psst-cli"; };
gui = mkApp { program = "${packages.psst}/bin/psst-gui"; };
};
samrewritten = mkApp { program = "${packages.samrewritten}/bin/samrewritten"; };
spotify-ripper = mkApp { program = "${packages.spotify-ripper}/bin/spotify-ripper"; };
};
apps = forAllSystems (system:
let
mkApp = opts: { type = "app"; } // opts;
pkgs = self.packages.${system};
in
{
alacritty = mkApp { program = "${pkgs.alacritty-ligatures}/bin/alacritty"; };
protonmail-bridge = mkApp { program = "${pkgs.protonmail-bridge}/bin/protonmail-bridge"; };
protonmail-bridge-headless = mkApp { program = "${pkgs.protonmail-bridge}/bin/protonmail-bridge"; };
psst-cli = mkApp { program = "${pkgs.psst}/bin/psst-cli"; };
psst-gui = mkApp { program = "${pkgs.psst}/bin/psst-gui"; };
samrewritten = mkApp { program = "${pkgs.samrewritten}/bin/samrewritten"; };
spotify-ripper = mkApp { program = "${pkgs.spotify-ripper}/bin/spotify-ripper"; };
});
};
}