Files
nix/flake.nix

176 lines
4.2 KiB
Nix
Raw Normal View History

2024-01-03 22:53:34 -03:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
2024-08-09 21:53:29 -03:00
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2024-01-03 22:53:34 -03:00
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
2024-01-03 22:53:34 -03:00
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix/release-24.11";
2024-01-12 17:45:22 -03:00
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
2024-01-12 17:45:22 -03:00
};
sops-nix = {
url = "github:Mic92/sops-nix";
2024-01-13 18:58:54 -03:00
inputs.nixpkgs.follows = "nixpkgs";
};
2025-02-07 14:25:59 -03:00
xremap = {
url = "github:xremap/nix-flake";
2024-08-09 21:53:29 -03:00
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-26 18:42:38 -03:00
nix-flatpak = {
url = "github:gmodena/nix-flatpak/?ref=latest";
};
2025-02-09 00:16:27 -03:00
nixpak = {
url = "github:nixpak/nixpak";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim = {
url = "git+https://forge.capytal.company/dot013/nvim";
2024-08-09 21:53:29 -03:00
};
2024-01-03 22:53:34 -03:00
};
outputs = {
self,
nixpkgs,
home-manager,
2024-08-09 21:53:29 -03:00
nixpkgs-unstable,
...
} @ inputs: let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f:
nixpkgs.lib.genAttrs systems (system: let
pkgs = import nixpkgs {inherit system;};
in
f {
inherit pkgs;
inherit (pkgs) lib;
});
2025-02-06 13:05:13 -03:00
# Home manager NixOS module
homeNixOSModules = [
home-manager.nixosModules.home-manager
./colors.nix
];
in {
nixosConfigurations = {
"battleship" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs self;};
modules =
2025-02-06 13:05:13 -03:00
homeNixOSModules
++ [
./hosts/battleship/configuration.nix
inputs.stylix.nixosModules.stylix
./home/guz/configuration.nix
];
};
"fighter" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs self;};
modules =
2025-02-06 13:05:13 -03:00
homeNixOSModules
++ [
./hosts/fighter/configuration.nix
inputs.stylix.nixosModules.stylix
./home/guz-lite/configuration.nix
];
};
};
homeConfigurations = {
"guz-lite" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {inherit inputs self;};
modules = [
inputs.stylix.homeManagerModules.stylix
./colors.nix
inputs.xremap.homeManagerModules.default
./home/guz-lite
];
};
"guz" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = {inherit inputs self;};
modules = [
inputs.stylix.homeManagerModules.stylix
2025-02-06 13:05:13 -03:00
./colors.nix
inputs.xremap.homeManagerModules.default
./home/guz
];
};
};
nixosModules = {
neovim = inputs.neovim.nixosModules.default;
};
homeManagerModules = {
devkit = ./modules/home-manager/devkit.nix;
neovim = inputs.neovim.homeManagerModules.default;
2025-02-10 18:28:24 -03:00
eww = ./modules/home-manager/eww.nix;
};
2025-02-12 11:21:55 -03:00
packages = forAllSystems ({
lib,
pkgs,
...
}: {
neovim = inputs.neovim.packages.${pkgs.system}.default;
devkit =
(import ./packages/devkit {inherit pkgs inputs;})
// {
neovim = self.packages.${pkgs.system}.neovim;
};
devkit-shell = let
devkit = self.packages.${pkgs.system}.devkit;
packages = with devkit; [
git
lazygit
neovim
starship
tmux
yazi
zellij
zsh
# Useful on new Nix installations
(pkgs.writeShellScriptBin "nix" ''
${lib.getExe pkgs.nix} \
--experimental-features 'nix-command flakes' \
"$@"
'')
];
in
pkgs.writeShellScriptBin "devkit-shell" ''
export PATH="$PATH:${lib.makeBinPath packages}"
${lib.getExe devkit.zsh} "$@"
'';
2025-03-02 12:43:48 -03:00
});
devShells = forAllSystems ({
lib,
pkgs,
...
}: {
devkit = pkgs.mkShell {
name = "devkit-shell";
shellHook = "${lib.getExe self.packages.${pkgs.system}.devkit-shell}";
};
default = self.devShells.${pkgs.system}.devkit;
});
};
2024-01-03 22:53:34 -03:00
}