dotfiles/flake.nix

183 lines
5.3 KiB
Nix
Raw Normal View History

2023-02-07 11:42:25 +01:00
{
description = "nekowinston's hm flake";
2024-05-07 18:20:52 +02:00
outputs =
{ flake-parts, self, ... }@inputs:
let
inherit (import ./machines/lib.nix { inherit inputs overlays; }) mkSystems;
overlays = import ./pkgs/overlays.nix { inherit inputs; };
in
flake-parts.lib.mkFlake { inherit self inputs; } {
flake = mkSystems [
{
host = "sashimi";
system = "aarch64-darwin";
username = "winston";
2023-11-28 12:21:17 +01:00
isGraphical = true;
}
{
host = "futomaki";
system = "x86_64-linux";
username = "winston";
2023-11-28 12:21:17 +01:00
isGraphical = true;
}
{
2024-02-11 20:12:32 +01:00
host = "yuba";
system = "x86_64-linux";
2024-02-11 20:12:32 +01:00
username = "winston";
isGraphical = false;
2024-09-19 21:52:54 +02:00
extraModules = [ inputs.nixos-wsl.nixosModules.default ];
}
];
2024-05-07 18:20:52 +02:00
imports = [ inputs.pre-commit-hooks.flakeModule ];
perSystem =
{
config,
self',
inputs',
pkgs,
lib,
system,
...
}:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit overlays system;
config.allowUnfree = true;
};
2023-06-15 01:40:55 +02:00
2024-05-07 18:20:52 +02:00
pre-commit = {
check.enable = true;
settings.excludes = [ "_sources/" ];
settings.hooks = {
commitizen.enable = true;
editorconfig-checker.enable = true;
luacheck.enable = true;
nil.enable = true;
2024-09-08 23:48:59 +02:00
nixfmt-rfc-style.enable = true;
2024-05-07 18:20:52 +02:00
shellcheck.enable = true;
stylua.enable = true;
};
2023-06-15 01:40:55 +02:00
};
2024-05-07 18:20:52 +02:00
devShells.default = pkgs.mkShellNoCC {
2024-05-07 18:20:52 +02:00
inherit (config.pre-commit.devShell) shellHook;
RULES = "./home/secrets/secrets.nix";
buildInputs =
(with pkgs; [
just
nix-output-monitor
nixd
nvd
])
2024-05-11 03:00:26 +02:00
++ [
inputs'.agenix.packages.agenix
self'.formatter
]
2024-05-07 18:20:52 +02:00
++ lib.optionals pkgs.stdenv.isDarwin [ inputs'.darwin.packages.darwin-rebuild ];
2023-06-15 01:40:55 +02:00
};
2023-06-21 23:47:02 +02:00
2024-05-07 18:20:52 +02:00
legacyPackages.homeConfigurations =
let
homeLib = import ./home/lib.nix {
inherit inputs pkgs username;
isNixOS = false;
};
username = "winston";
in
{
${username} = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
inherit (homeLib) extraSpecialArgs modules;
};
};
formatter = pkgs.nixfmt-rfc-style;
};
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
};
2023-05-29 14:11:41 +02:00
nixConfig = {
2023-07-18 04:20:56 +02:00
extra-substituters = [
2023-05-29 14:11:41 +02:00
"https://nix-community.cachix.org"
"https://cosmic.cachix.org"
2023-05-29 14:11:41 +02:00
"https://pre-commit-hooks.cachix.org"
2024-05-02 17:50:03 +02:00
"https://nekowinston.cachix.org"
"https://mic92.cachix.org"
2023-05-29 14:11:41 +02:00
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
2023-05-29 14:11:41 +02:00
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
2024-05-02 17:50:03 +02:00
"nekowinston.cachix.org-1:lucpmaO+JwtoZj16HCO1p1fOv68s/RL1gumpVzRHRDs="
"mic92.cachix.org-1:gi8IhgiT3CYZnJsaW7fxznzTkMUOn1RY4GmXdT/nXYQ="
2023-05-29 14:11:41 +02:00
];
};
2023-11-26 12:12:22 +01:00
inputs = {
2023-12-24 15:47:06 +01:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2023-11-26 12:12:22 +01:00
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-09-19 21:52:54 +02:00
nixos-wsl = {
2024-02-11 20:12:32 +01:00
url = "github:nix-community/nixos-wsl";
inputs.flake-compat.follows = "";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-26 12:12:22 +01:00
nur.url = "github:nix-community/nur";
nekowinston-nur.url = "github:nekowinston/nur";
2024-02-23 10:13:54 +01:00
agenix = {
url = "github:ryantm/agenix";
inputs.darwin.follows = "darwin";
inputs.home-manager.follows = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "flake-utils/systems";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-26 12:12:22 +01:00
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.flake-compat.follows = "";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-23 10:13:54 +01:00
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-26 12:12:22 +01:00
2024-02-23 10:13:54 +01:00
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
2023-11-26 12:12:22 +01:00
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.flake-compat.follows = "";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-26 12:12:22 +01:00
};
2023-02-07 11:42:25 +01:00
}