2023-02-07 11:42:25 +01:00
|
|
|
{
|
|
|
|
description = "nekowinston's hm flake";
|
|
|
|
|
|
|
|
inputs = {
|
2023-04-27 09:30:26 +02:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2023-02-07 11:42:25 +01:00
|
|
|
darwin = {
|
2023-02-11 02:37:39 +01:00
|
|
|
url = "github:lnl7/nix-darwin";
|
2023-04-27 09:30:26 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-02-10 07:46:37 +01:00
|
|
|
};
|
2023-04-21 05:59:56 +02:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-02-07 11:42:25 +01:00
|
|
|
|
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-04-13 22:14:04 +02:00
|
|
|
nix-index-database.url = "github:Mic92/nix-index-database";
|
|
|
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
2023-02-10 10:03:16 +01:00
|
|
|
|
2023-05-18 19:10:41 +02:00
|
|
|
# TODO: commit remove once fixed
|
|
|
|
swayfx.url = "github:willpower3309/swayfx/479cc4e7456a93aed1a89bef8d83c1f8c43bd291";
|
2023-05-01 05:46:00 +02:00
|
|
|
swayfx.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
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-04-13 22:14:04 +02:00
|
|
|
nix-index-database,
|
2023-02-07 11:42:25 +01:00
|
|
|
nixpkgs,
|
|
|
|
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-13 00:54:29 +01:00
|
|
|
nur = import nur {
|
|
|
|
nurpkgs = prev;
|
|
|
|
pkgs = prev;
|
2023-03-04 05:50:49 +01:00
|
|
|
repoOverrides = {
|
2023-05-21 18:37:10 +02:00
|
|
|
nekowinston = nekowinston-nur.packages.${prev.system};
|
2023-03-04 05:50:49 +01:00
|
|
|
};
|
2023-02-13 00:54:29 +01:00
|
|
|
};
|
2023-05-01 05:46:00 +02:00
|
|
|
sway-unwrapped = swayfx.packages.${prev.system}.default;
|
2023-02-09 17:35:00 +01:00
|
|
|
};
|
2023-05-18 15:19:31 +02:00
|
|
|
commonHMConfig = {username}: ({
|
2023-04-03 22:44:03 +02:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
config = {
|
|
|
|
nixpkgs.overlays = [overlays];
|
|
|
|
home-manager = {
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
backupFileExtension = "backup";
|
2023-04-13 22:14:04 +02:00
|
|
|
sharedModules = [
|
|
|
|
./modules
|
|
|
|
nix-index-database.hmModules.nix-index
|
|
|
|
sops.homeManagerModules.sops
|
|
|
|
];
|
2023-04-03 22:44:03 +02:00
|
|
|
users.${username}.imports = [./home];
|
|
|
|
extraSpecialArgs = {
|
|
|
|
flakePath =
|
|
|
|
if pkgs.stdenv.isDarwin
|
|
|
|
then "/Users/${username}/.config/nixpkgs"
|
|
|
|
else "/home/${username}/.config/nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
2023-02-10 10:03:16 +01:00
|
|
|
in
|
|
|
|
{
|
2023-02-11 04:58:34 +01:00
|
|
|
nixosConfigurations = {
|
2023-05-11 23:26:32 +02:00
|
|
|
"futomaki" = nixpkgs.lib.nixosSystem {
|
2023-02-11 04:58:34 +01:00
|
|
|
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";
|
|
|
|
})
|
2023-02-11 04:58:34 +01:00
|
|
|
];
|
|
|
|
};
|
2023-05-11 23:26:32 +02:00
|
|
|
"bento" = nixpkgs.lib.nixosSystem {
|
2023-03-01 21:03:45 +01:00
|
|
|
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";
|
|
|
|
})
|
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-05-11 23:26:32 +02:00
|
|
|
"sashimi" = darwin.lib.darwinSystem {
|
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";
|
|
|
|
})
|
2023-02-10 10:03:16 +01:00
|
|
|
];
|
|
|
|
};
|
2023-02-07 11:42:25 +01:00
|
|
|
};
|
2023-04-21 05:59:56 +02:00
|
|
|
homeConfigurations.winston = let
|
|
|
|
system = "aarch64-linux";
|
2023-04-27 09:30:26 +02:00
|
|
|
pkgs = import nixpkgs {
|
2023-04-21 05:59:56 +02:00
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
|
|
|
username = "winston";
|
|
|
|
in
|
|
|
|
home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules = [
|
|
|
|
{
|
|
|
|
home.homeDirectory = "/home/winston";
|
|
|
|
home.username = "/home/winston";
|
|
|
|
nixpkgs.overlays = [overlays];
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
}
|
|
|
|
./modules
|
|
|
|
./home
|
|
|
|
nix-index-database.hmModules.nix-index
|
|
|
|
sops.homeManagerModules.sops
|
|
|
|
];
|
|
|
|
extraSpecialArgs = {
|
|
|
|
flakePath =
|
|
|
|
if pkgs.stdenv.isDarwin
|
|
|
|
then "/Users/${username}/.config/nixpkgs"
|
|
|
|
else "/home/${username}/.config/nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
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;
|
2023-05-14 13:40:39 +02:00
|
|
|
luacheck.enable = true;
|
|
|
|
nil.enable = true;
|
|
|
|
shellcheck.enable = true;
|
|
|
|
stylua.enable = true;
|
2023-02-10 10:03:16 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
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 {
|
2023-05-08 23:49:13 +02:00
|
|
|
name = "nixpkgs";
|
2023-02-11 02:37:39 +01:00
|
|
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
2023-05-14 07:07:08 +02:00
|
|
|
packages = [pkgs.just pkgs.git-crypt pkgs.sops];
|
2023-02-11 02:37:39 +01:00
|
|
|
};
|
2023-05-14 09:27:30 +02:00
|
|
|
formatter = nixpkgs.legacyPackages.${system}.alejandra;
|
2023-02-10 10:03:16 +01:00
|
|
|
});
|
2023-02-07 11:42:25 +01:00
|
|
|
}
|