Fix: Use nix flake check for hooks, simplify module, remove apps
This commit is contained in:
44
flake.nix
44
flake.nix
@@ -50,13 +50,14 @@
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, home-manager
|
||||
, nix-on-droid
|
||||
, nixgl
|
||||
, git-hooks
|
||||
, ...
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
nix-on-droid,
|
||||
nixgl,
|
||||
git-hooks,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
@@ -65,11 +66,13 @@
|
||||
hostDirNames = utils.dirNames ./hosts;
|
||||
system = "x86_64-linux";
|
||||
dotsPath = ./dots;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${inputs.nixpkgs}"
|
||||
]; # <https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md>
|
||||
];
|
||||
|
||||
nixosConfigurations =
|
||||
(lib.genAttrs hostDirNames (
|
||||
host:
|
||||
@@ -103,6 +106,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
work = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
@@ -115,7 +119,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
# https://github.com/nix-community/nix-on-droid/blob/master/templates/advanced/flake.nix
|
||||
|
||||
nixOnDroidConfigurations = {
|
||||
pixel = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
modules = [ ./phone ];
|
||||
@@ -140,30 +144,12 @@
|
||||
checks.${system}.pre-commit-check = git-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
nixfmt.enable = true;
|
||||
statix.enable = true;
|
||||
deadnix.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
apps.${system}.pre-commit-install =
|
||||
let
|
||||
hooks = git-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixpkgs-fmt.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
type = "app";
|
||||
program = toString (
|
||||
pkgs.writeShellScript "install-hooks" ''
|
||||
${hooks.shellHook}
|
||||
''
|
||||
);
|
||||
};
|
||||
|
||||
images.sd-image-aarch64 = self.nixosConfigurations.sd-image-aarch64.config.system.build.sdImage;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user