flocon/flake.nix

84 lines
2.2 KiB
Nix
Raw Normal View History

2024-08-25 19:58:12 +00:00
{
description = "nezia's nixos configuration";
2024-09-24 21:47:40 +00:00
outputs = {
nixpkgs,
2024-09-26 11:41:04 +00:00
systems,
2024-09-24 21:47:40 +00:00
home-manager,
sops-nix,
stylix,
2024-09-26 11:41:04 +00:00
treefmt-nix,
2024-09-24 21:47:40 +00:00
...
} @ inputs: let
username = "nezia";
system = "x86_64-linux";
2024-09-26 11:41:04 +00:00
# small tool to iterate over each systems
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
# eval the treefmt modules from ./treefmt.nix
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
2024-09-24 21:47:40 +00:00
commonModules = hostname: [
./modules
./hosts/common
./hosts/${hostname}
2024-09-24 21:47:40 +00:00
sops-nix.nixosModules.sops
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs system;
};
2024-09-24 21:47:40 +00:00
};
}
{
_module.args = {
inherit hostname username;
};
}
];
2024-08-25 21:53:48 +00:00
2024-09-24 21:47:40 +00:00
configureSystem = hostname: homeConfig:
nixpkgs.lib.nixosSystem {
inherit system;
modules = commonModules hostname ++ [{home-manager.users."${username}" = import homeConfig;}];
specialArgs = {
inherit inputs;
};
2024-08-25 19:58:12 +00:00
};
2024-09-24 21:47:40 +00:00
in {
nixosConfigurations = {
vamos = configureSystem "vamos" ./home/laptop;
solaire = configureSystem "solaire" ./home/desktop;
2024-08-25 19:58:12 +00:00
};
2024-09-26 11:41:04 +00:00
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
2024-09-24 21:47:40 +00:00
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix.url = "github:danth/stylix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
wezterm = {
url = "github:wez/wezterm/main?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser.url = "github:MarceColl/zen-browser-flake";
nvf = {
url = "github:notashelf/nvf";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-09-26 11:41:04 +00:00
treefmt-nix.url = "github:numtide/treefmt-nix";
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
2024-08-25 19:58:12 +00:00
}