nix/flake.nix

62 lines
1.7 KiB
Nix
Raw Normal View History

2023-08-14 07:11:18 -04:00
{
2023-08-14 07:45:15 -04:00
description = "mehbark's NixOS configuration";
2023-08-14 07:11:18 -04:00
inputs = {
2023-09-10 00:04:10 -04:00
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2023-09-10 00:04:10 -04:00
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
};
outputs = inputs@{ self, nixpkgs, home-manager, flake-utils, nixos-generators, hyprland, ... }:
2023-08-15 18:19:41 -04:00
let
2023-08-15 18:31:53 -04:00
# :(
# could do like nix-i3, nix-hyprland but that would be LAME
2023-08-16 03:28:41 -04:00
conf = (import ./build.conf.nix) { wm = "plasma"; };
2023-08-15 21:11:02 -04:00
modules = [
((import ./configuration.nix) conf)
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.mbk = (import ./home.nix) conf;
}
];
2023-08-15 18:19:41 -04:00
in
{
nixosConfigurations =
{
2023-08-14 07:45:15 -04:00
nix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
2023-09-04 07:45:29 -04:00
inherit modules;
specialArgs = { inherit inputs; };
2023-08-15 21:11:02 -04:00
};
};
homeConfigurations.mbk = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = if conf.wm == "hyprland" then modules ++ [
hyprland.homeManagerModules.default
{wayland.windowManager.hyprland.enable = true;}
] else modules;
};
# meh, doesn't rly work
2023-08-15 21:11:02 -04:00
packages.x86_64-linux = {
iso = nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = modules;
format = "iso";
2023-08-14 07:45:15 -04:00
};
2023-08-15 18:31:53 -04:00
};
2023-08-14 07:45:15 -04:00
};
2023-08-14 07:11:18 -04:00
}