This repository has been archived on 2024-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
desktop_nixos_config_legacy/flake.nix

78 lines
1.9 KiB
Nix
Raw Normal View History

2024-08-23 21:32:44 +02:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; # actualizar esto para actualizar
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
hm-isolation.url = "github:3442/hm-isolation";
nixGL.url = "github:guibou/nixGL";
home-manager = {
url = "github:nix-community/home-manager/release-24.05"; # actualizar esto para actualizar
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, unstable, home-manager, nur, hm-isolation, nixGL, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
inherit (pkgs) lib;
base = platform: {
name = platform;
value = nixpkgs.lib.nixosSystem {
inherit system;
modules = [ (import ./base) ];
};
};
home = platform: {
name = "fabian@${platform}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(import ./home {
inherit self nixpkgs unstable hm-isolation nixGL;
})
./home/platforms/${platform}.nix
{
config.local = { inherit platform; };
}
];
};
};
localPkgs = import ./pkgs;
platforms = domain:
map
(lib.removeSuffix ".nix")
(lib.attrNames (builtins.readDir ./${domain}/platforms));
configs = domain: builder:
lib.listToAttrs
(map builder (platforms domain));
in
{
nixosConfigurations = configs "base" base;
homeConfigurations = configs "home" home;
packages.${system} = localPkgs pkgs;
formatter.${system} = pkgs.nixpkgs-fmt;
overlay = self: super: {
unstable = import unstable {
inherit (super) config system;
};
local = localPkgs self;
};
};
}