dotfiles/flake.nix

106 lines
2.7 KiB
Nix
Raw Normal View History

2023-02-07 11:42:25 +01:00
{
description = "nekowinston's hm flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
darwin = {
2023-02-11 02:37:39 +01:00
url = "github:lnl7/nix-darwin";
2023-02-07 11:42:25 +01:00
inputs.nixpkgs.follows = "nixpkgs";
2023-02-10 07:46:37 +01:00
};
2023-02-07 11:42:25 +01:00
home-manager = {
2023-02-11 02:37:39 +01:00
url = "github:nix-community/home-manager";
2023-02-07 11:42:25 +01:00
inputs.nixpkgs.follows = "nixpkgs";
};
2023-02-11 02:37:39 +01:00
nur.url = "github:nix-community/NUR";
sops.url = "github:Mic92/sops-nix";
# dev
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
flake-utils.url = "github:numtide/flake-utils";
2023-02-07 11:42:25 +01:00
};
outputs = {
self,
darwin,
home-manager,
flake-utils,
pre-commit-hooks,
2023-02-07 11:42:25 +01:00
nixpkgs,
nixpkgs-unstable,
nur,
sops,
...
2023-02-10 07:46:37 +01:00
}: let
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
system = prev.system;
config.allowUnfree = true;
};
};
in
{
darwinConfigurations = {
"sashimi-slicer" = darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
2023-02-07 11:42:25 +01:00
modules = [
home-manager.darwinModules.home-manager
2023-02-10 10:56:43 +01:00
./machines/sashimi/darwin.nix
({config, ...}: {
config = {
2023-02-10 10:56:43 +01:00
nixpkgs.overlays = [
overlay-unstable
(import ./packages/default.nix)
];
nixpkgs.config.allowUnfree = true;
home-manager = {
useGlobalPkgs = true;
users.winston.imports = [./home.nix];
extraSpecialArgs = {
nur = nur.nixosModules.nur;
sops = sops.homeManagerModules.sops;
flakePath = "/Users/winston/.config/nixpkgs";
machine.personal = true;
};
};
};
})
];
};
2023-02-07 11:42:25 +01:00
};
}
// flake-utils.lib.eachDefaultSystem (system: {
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true;
editorconfig-checker.enable = true;
deadnix.enable = true;
shellcheck.enable = true;
stylua.enable = true;
};
settings.deadnix = {
noLambdaPatternNames = true;
noLambdaArg = true;
};
};
};
2023-02-11 02:37:39 +01:00
devShell = let
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
packages = [
pkgs.just
pkgs.sops
];
};
});
2023-02-07 11:42:25 +01:00
}