nixos-config/flake.nix

56 lines
1.8 KiB
Nix
Raw Normal View History

2022-06-10 00:22:53 -03:00
{
description = "My system config";
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.05";
2022-07-16 02:12:18 -03:00
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
2022-06-10 00:22:53 -03:00
home-manager.url = "github:nix-community/home-manager/release-22.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2022-07-16 02:12:18 -03:00
nur.url = github:nix-community/NUR;
2022-06-10 00:22:53 -03:00
};
2022-07-16 02:12:18 -03:00
outputs = { nixpkgs, nixpkgs-unstable, home-manager, nur, ... }:
2022-06-10 00:22:53 -03:00
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
2022-07-16 02:12:18 -03:00
overlay-unstable = final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
# use this variant if unfree packages are needed:
# unstable = import nixpkgs-unstable {
# inherit system;
# config.allowUnfree = true;
# };
};
2022-06-10 00:22:53 -03:00
lib = nixpkgs.lib;
2022-07-16 02:12:18 -03:00
common_modules = [
./system/configuration.nix
# nur.nixosModules.nur
2022-07-19 23:43:50 -03:00
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable nur.overlay ]; })
2022-07-16 02:12:18 -03:00
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.lelgenio = import ./user/home.nix;
home-manager.backupFileExtension = "bkp";
2022-07-16 02:12:18 -03:00
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
2022-06-10 00:22:53 -03:00
in {
nixosConfigurations = {
i15 = lib.nixosSystem {
inherit system;
2022-07-11 21:34:04 -03:00
modules = [
./system/i15-hardware-configuration.nix
2022-07-16 02:12:18 -03:00
] ++ common_modules;
};
2022-07-11 21:34:04 -03:00
monolith = lib.nixosSystem {
inherit system;
modules = [
./system/monolith-hardware-configuration.nix
2022-07-16 02:12:18 -03:00
] ++ common_modules;
2022-06-10 00:22:53 -03:00
};
};
};
2022-07-16 02:12:18 -03:00
}