Remove dependency on flake-utils

This commit is contained in:
Daniel Thwaites 2022-07-24 17:04:14 +01:00
parent 324b951687
commit ff5da2914c
No known key found for this signature in database
GPG key ID: D8AFC4BF05670F9D
2 changed files with 47 additions and 69 deletions

View file

@ -39,23 +39,7 @@
"root": { "root": {
"inputs": { "inputs": {
"base16": "base16", "base16": "base16",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
} }
} }
}, },

View file

@ -5,76 +5,70 @@
url = "github:SenchoPens/base16.nix"; url = "github:SenchoPens/base16.nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
utils.url = "github:numtide/flake-utils";
}; };
outputs = { nixpkgs, base16, utils, self, ... }: outputs =
(utils.lib.eachSystem [ "aarch64-linux" "i686-linux" "x86_64-linux" ] { nixpkgs, base16, self, ... }:
(system: with nixpkgs.lib;
{
packages = genAttrs [ "aarch64-linux" "i686-linux" "x86_64-linux" ] (
system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
ghc = pkgs.haskellPackages.ghcWithPackages (haskellPackages: ghc =
with haskellPackages; [ pkgs.haskellPackages.ghcWithPackages
json (ps: with ps; [ json JuicyPixels random ]);
JuicyPixels
random
]);
in {
palette-generator = pkgs.stdenvNoCC.mkDerivation { palette-generator = pkgs.stdenvNoCC.mkDerivation {
name = "palette-generator"; name = "palette-generator";
src = ./palette-generator; src = ./palette-generator;
buildInputs = [ ghc ]; buildInputs = [ ghc ];
buildPhase = buildPhase = ''
"ghc -O -threaded -Wall -Wno-type-defaults Stylix/Main.hs"; ghc -O -threaded -Wall -Wno-type-defaults Stylix/Main.hs
installPhase = "install -D Stylix/Main $out/bin/palette-generator"; '';
installPhase = ''
install -D Stylix/Main $out/bin/palette-generator
'';
}; };
# Internal documentation
palette-generator-haddock = pkgs.stdenvNoCC.mkDerivation { palette-generator-haddock = pkgs.stdenvNoCC.mkDerivation {
name = "palette-generator-haddock"; name = "palette-generator-haddock";
src = ./palette-generator; src = ./palette-generator;
buildInputs = [ ghc ]; buildInputs = [ ghc ];
buildPhase = buildPhase = ''
"haddock $src/**/*.hs --html --ignore-all-exports --odir $out"; haddock $src/**/*.hs --html --ignore-all-exports --odir $out
'';
dontInstall = true; dontInstall = true;
dontFixup = true; dontFixup = true;
}; };
}
);
palette-generator-app = utils.lib.mkApp { nixosModules.stylix = { pkgs, ... }@args: {
drv = palette-generator; imports = [
name = "palette-generator"; ./modules/alacritty.nix
}; ./modules/console.nix
./modules/dunst.nix
in { ./modules/feh.nix
packages = { ./modules/fish.nix
inherit palette-generator palette-generator-haddock; ./modules/grub.nix
}; ./modules/gtk.nix
apps.palette-generator = palette-generator-app; ./modules/helix.nix
})) // { ./modules/kitty.nix
nixosModules.stylix = { pkgs, ... }@args: { ./modules/lightdm.nix
imports = [ ./modules/plymouth
./modules/alacritty.nix ./modules/qutebrowser.nix
./modules/console.nix ./modules/sway.nix
./modules/dunst.nix ./modules/vim.nix
./modules/feh.nix (import ./stylix/palette.nix {
./modules/fish.nix inherit (self.packages.${pkgs.system}) palette-generator;
./modules/grub.nix base16 = base16.lib args;
./modules/gtk.nix })
./modules/helix.nix ./stylix/fonts.nix
./modules/kitty.nix ./stylix/pixel.nix
./modules/lightdm.nix ];
./modules/plymouth };
./modules/qutebrowser.nix };
./modules/sway.nix
./modules/vim.nix
(import ./stylix/palette.nix {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
})
./stylix/fonts.nix
./stylix/pixel.nix
];
};
};
} }