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-04-06 15:41:53 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
2023-02-10 07:46:37 +01:00
|
|
|
};
|
2023-02-07 11:42:25 +01:00
|
|
|
|
2023-04-08 13:06:13 +02:00
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
2023-04-06 15:41:53 +02:00
|
|
|
nur.url = "github:nix-community/nur";
|
2023-02-13 00:54:29 +01:00
|
|
|
nekowinston-nur.url = "github:nekowinston/nur";
|
2023-02-11 02:37:39 +01:00
|
|
|
sops.url = "github:Mic92/sops-nix";
|
2023-02-10 10:03:16 +01:00
|
|
|
|
|
|
|
# dev
|
2023-03-16 12:50:59 +01:00
|
|
|
swayfx.url = "github:willpower3309/swayfx";
|
2023-02-10 10:03:16 +01:00
|
|
|
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,
|
2023-02-10 10:03:16 +01:00
|
|
|
flake-utils,
|
2023-02-12 08:05:51 +01:00
|
|
|
home-manager,
|
2023-02-13 00:54:29 +01:00
|
|
|
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-03-16 12:50:59 +01:00
|
|
|
swayfx,
|
2023-02-07 11:42:25 +01:00
|
|
|
...
|
2023-02-10 07:46:37 +01:00
|
|
|
}: let
|
2023-02-18 22:36:15 +01:00
|
|
|
overlays = final: prev: {
|
2023-02-09 17:35:00 +01:00
|
|
|
unstable = import nixpkgs-unstable {
|
2023-02-10 06:29:23 +01:00
|
|
|
system = prev.system;
|
2023-02-09 17:35:00 +01:00
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
2023-02-13 00:54:29 +01:00
|
|
|
nur = import nur {
|
|
|
|
nurpkgs = prev;
|
|
|
|
pkgs = prev;
|
2023-03-04 05:50:49 +01:00
|
|
|
repoOverrides = {
|
|
|
|
nekowinston = import nekowinston-nur {
|
|
|
|
pkgs = import nixpkgs-unstable {system = prev.system;};
|
|
|
|
};
|
|
|
|
};
|
2023-02-13 00:54:29 +01:00
|
|
|
};
|
2023-02-09 17:35:00 +01:00
|
|
|
};
|
2023-04-08 13:03:00 +02:00
|
|
|
commonHMConfig = {
|
|
|
|
username,
|
|
|
|
machine,
|
|
|
|
}: ({
|
2023-04-03 22:44:03 +02:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
config = {
|
|
|
|
nixpkgs.overlays = [overlays];
|
|
|
|
home-manager = {
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
backupFileExtension = "backup";
|
|
|
|
sharedModules = [sops.homeManagerModules.sops ./modules];
|
|
|
|
users.${username}.imports = [./home];
|
|
|
|
extraSpecialArgs = {
|
|
|
|
flakePath =
|
|
|
|
if pkgs.stdenv.isDarwin
|
|
|
|
then "/Users/${username}/.config/nixpkgs"
|
|
|
|
else "/home/${username}/.config/nixpkgs";
|
2023-04-08 13:03:00 +02:00
|
|
|
inherit machine swayfx;
|
2023-04-03 22:44:03 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
2023-02-10 10:03:16 +01:00
|
|
|
in
|
|
|
|
{
|
2023-02-11 04:58:34 +01:00
|
|
|
nixosConfigurations = {
|
|
|
|
"futomaki" = nixpkgs.lib.nixosSystem rec {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
home-manager.nixosModules.home-manager
|
2023-03-02 17:14:11 +01:00
|
|
|
./machines/common
|
2023-02-11 04:58:34 +01:00
|
|
|
./machines/futomaki
|
2023-04-08 13:03:00 +02:00
|
|
|
(commonHMConfig {
|
|
|
|
username = "winston";
|
|
|
|
machine.personal = true;
|
|
|
|
})
|
2023-02-11 04:58:34 +01:00
|
|
|
];
|
|
|
|
};
|
2023-03-01 21:03:45 +01:00
|
|
|
"bento" = nixpkgs.lib.nixosSystem rec {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
home-manager.nixosModules.home-manager
|
2023-03-02 17:14:11 +01:00
|
|
|
./machines/common
|
2023-03-01 21:03:45 +01:00
|
|
|
./machines/bento
|
2023-04-08 13:03:00 +02:00
|
|
|
(commonHMConfig {
|
|
|
|
username = "w";
|
|
|
|
machine.personal = false;
|
|
|
|
})
|
2023-03-01 21:03:45 +01:00
|
|
|
];
|
|
|
|
};
|
2023-02-11 04:58:34 +01:00
|
|
|
};
|
2023-02-10 10:03:16 +01:00
|
|
|
darwinConfigurations = {
|
2023-02-19 20:06:19 +01:00
|
|
|
"sashimi" = darwin.lib.darwinSystem rec {
|
2023-02-10 10:03:16 +01:00
|
|
|
system = "aarch64-darwin";
|
|
|
|
modules = [
|
|
|
|
home-manager.darwinModules.home-manager
|
2023-03-02 17:14:11 +01:00
|
|
|
./machines/common
|
2023-02-20 09:09:29 +01:00
|
|
|
./machines/sashimi
|
2023-04-08 13:03:00 +02:00
|
|
|
(commonHMConfig {
|
|
|
|
username = "winston";
|
|
|
|
machine.personal = true;
|
|
|
|
})
|
2023-02-10 10:03:16 +01:00
|
|
|
];
|
|
|
|
};
|
2023-02-07 11:42:25 +01:00
|
|
|
};
|
2023-02-10 10:03:16 +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;
|
2023-02-10 10:03:16 +01:00
|
|
|
editorconfig-checker.enable = true;
|
|
|
|
deadnix.enable = true;
|
|
|
|
shellcheck.enable = true;
|
|
|
|
stylua.enable = true;
|
2023-03-09 14:30:30 +01:00
|
|
|
flake-check = {
|
2023-03-10 02:49:11 +01:00
|
|
|
enable = false;
|
2023-03-09 14:30:30 +01:00
|
|
|
types = ["nix"];
|
|
|
|
language = "system";
|
|
|
|
entry = "just check";
|
|
|
|
pass_filenames = false;
|
|
|
|
};
|
2023-02-10 10:03:16 +01:00
|
|
|
};
|
|
|
|
settings.deadnix = {
|
|
|
|
noLambdaPatternNames = true;
|
|
|
|
noLambdaArg = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-04-03 22:44:03 +02:00
|
|
|
devShells.default = let
|
2023-02-11 02:37:39 +01:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in
|
|
|
|
pkgs.mkShell {
|
|
|
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
|
|
packages = [
|
|
|
|
pkgs.just
|
|
|
|
pkgs.sops
|
|
|
|
];
|
|
|
|
};
|
2023-02-10 10:03:16 +01:00
|
|
|
});
|
2023-02-07 11:42:25 +01:00
|
|
|
}
|