dotfiles/flake.nix

168 lines
4.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";
nekowinston-nur.url = "github:nekowinston/nur";
nekowinston-nur.inputs.nixpkgs.follows = "nixpkgs-unstable";
2023-02-11 02:37:39 +01:00
sops.url = "github:Mic92/sops-nix";
2023-03-08 08:52:23 +01:00
hyprland.url = "github:hyprwm/Hyprland";
# 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,
flake-utils,
2023-02-12 08:05:51 +01:00
home-manager,
2023-03-08 08:52:23 +01:00
hyprland,
nekowinston-nur,
2023-02-07 11:42:25 +01:00
nixpkgs,
nixpkgs-unstable,
nur,
2023-02-12 08:05:51 +01:00
pre-commit-hooks,
2023-02-07 11:42:25 +01:00
sops,
...
2023-02-10 07:46:37 +01:00
}: let
2023-02-18 22:36:15 +01:00
overlays = final: prev: {
unstable = import nixpkgs-unstable {
system = prev.system;
config.allowUnfree = true;
};
nur = import nur {
nurpkgs = prev;
pkgs = prev;
repoOverrides = {
nekowinston = import nekowinston-nur {
pkgs = import nixpkgs-unstable {system = prev.system;};
};
};
};
};
in
{
nixosConfigurations = {
"futomaki" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
2023-03-08 08:52:23 +01:00
hyprland.nixosModules.default
./machines/common
./machines/futomaki
({config, ...}: {
config = {
2023-03-08 08:52:23 +01:00
nixpkgs.overlays = [overlays hyprland.outputs.overlays.default];
home-manager = {
useGlobalPkgs = true;
2023-03-01 21:03:45 +01:00
sharedModules = [sops.homeManagerModules.sops];
2023-02-19 00:18:25 +01:00
users.winston.imports = [./home];
extraSpecialArgs = {
flakePath = "/home/winston/.config/nixpkgs";
machine.personal = true;
};
};
};
})
];
};
2023-03-01 21:03:45 +01:00
"bento" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
./machines/common
2023-03-01 21:03:45 +01:00
./machines/bento
({config, ...}: {
config = {
2023-03-08 21:53:54 +01:00
nixpkgs.overlays = [overlays hyprland.outputs.overlays.default];
2023-03-01 21:03:45 +01:00
home-manager = {
useGlobalPkgs = true;
sharedModules = [sops.homeManagerModules.sops];
users.w.imports = [./home];
extraSpecialArgs = {
flakePath = "/home/w/.config/nixpkgs";
machine.personal = false;
};
};
};
})
];
};
};
darwinConfigurations = {
"sashimi" = darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
2023-02-07 11:42:25 +01:00
modules = [
home-manager.darwinModules.home-manager
./machines/common
2023-02-20 09:09:29 +01:00
./machines/sashimi
({config, ...}: {
config = {
2023-02-18 22:36:15 +01:00
nixpkgs.overlays = [overlays];
home-manager = {
useGlobalPkgs = true;
2023-02-18 21:33:19 +01:00
backupFileExtension = "backup";
2023-02-18 22:36:15 +01:00
sharedModules = [
sops.homeManagerModules.sops
2023-02-13 14:24:07 +01:00
];
2023-02-19 00:18:25 +01:00
users.winston.imports = [./home];
extraSpecialArgs = {
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;
2023-02-18 23:25:28 +01:00
commitizen.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
}