NixOS/flake.nix

164 lines
5.3 KiB
Nix
Raw Normal View History

2022-11-01 19:04:13 -04:00
{
inputs = {
2023-11-29 18:46:56 -05:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; # NixOS release channel
2022-11-16 05:18:24 -05:00
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; # NixOS unstable channel
2023-04-14 14:42:30 -04:00
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
2022-11-16 05:18:24 -05:00
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; # NixOS hardware channel
2023-10-14 20:18:21 -04:00
home-manager = {
2023-11-29 18:46:56 -05:00
url = "github:nix-community/home-manager/release-23.11"; # Home Manager release channel
2023-10-12 17:44:37 -04:00
inputs.nixpkgs.follows = "nixpkgs";
};
2024-04-17 16:02:48 -04:00
update = {
url = "github:ryantm/nixpkgs-update";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-monitored = {
url = "github:ners/nix-monitored";
inputs.nixpkgs.follows = "nixpkgs";
};
nixd = {
url = "github:nix-community/nixd";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-14 20:18:21 -04:00
fan-controller = {
url = "github:Krutonium/BetterFanController";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-04-17 16:02:48 -04:00
nur = {
url = "github:nix-community/NUR";
2024-04-17 16:03:25 -04:00
# inputs.nixpkgs.follows = "nixpkgs"; NUR does not.
2024-04-17 16:02:48 -04:00
};
2022-11-01 19:04:13 -04:00
};
2024-03-27 05:57:12 -04:00
outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-master, nixos-hardware, home-manager, update, nix-monitored, nixd, fan-controller, nur, ... }@inputs:
2023-03-19 04:12:03 -04:00
let
# This is a Generic Block of St00f
2022-11-01 19:04:13 -04:00
system = "x86_64-linux";
2023-03-19 04:12:03 -04:00
genericModules = [
2022-11-01 19:04:13 -04:00
./common.nix
2022-11-16 05:18:24 -05:00
{
2023-04-02 14:53:54 -04:00
# This fixes things that don't use Flakes, but do want to use NixPkgs.
2023-03-19 03:05:54 -04:00
nix.registry.nixos.flake = inputs.self;
2023-03-19 04:12:03 -04:00
environment.etc."nix/inputs/nixpkgs".source = nixpkgs.outPath;
2023-08-10 20:08:15 -04:00
nix.nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
2022-11-16 05:18:24 -05:00
}
home-manager.nixosModules.home-manager
{
2023-03-19 03:05:54 -04:00
nix.registry.nixos.flake = inputs.self;
2023-03-19 04:12:03 -04:00
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
2023-04-02 14:55:06 -04:00
2023-04-02 14:58:39 -04:00
# Make sure you add Overlays here
2023-04-02 14:57:46 -04:00
({ config, pkgs, ... }:
2023-04-02 14:57:54 -04:00
{
nixpkgs.overlays =
[
overlay-unstable
2023-04-14 14:42:30 -04:00
overlay-master
overlay-nixpkgs-update
2023-09-07 22:50:04 -04:00
overlay-monitored
2023-09-20 06:40:38 -04:00
nixd.overlays.default
2023-10-14 20:18:21 -04:00
overlay-fanController
2024-03-27 05:57:12 -04:00
nur.overlay
2023-04-02 14:57:54 -04:00
];
2023-04-02 14:57:46 -04:00
}
)
2023-03-19 04:12:03 -04:00
];
2023-04-02 14:53:54 -04:00
# Overlays
# nixpkgs-unstable
2023-03-19 04:12:03 -04:00
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
2024-04-12 20:21:47 -04:00
config.nvidia.acceptLicense = true;
};
};
2024-03-27 05:57:12 -04:00
# nixpkgs-master
2023-04-14 14:42:30 -04:00
overlay-master = final: prev: {
master = import nixpkgs-master {
inherit system;
config.allowUnfree = true;
2024-04-12 20:21:47 -04:00
config.nvidia.acceptLicense = true;
2023-04-14 14:42:30 -04:00
};
};
2023-04-02 15:01:05 -04:00
# overlay for nixpkgs-update
2023-04-02 14:59:41 -04:00
overlay-nixpkgs-update = final: prev: {
2023-04-02 14:53:54 -04:00
nixpkgs-update = update.defaultPackage.x86_64-linux;
};
2023-10-14 20:18:21 -04:00
# Fan Controller for AMD Devices
overlay-fanController = self: super: {
BetterFanController = fan-controller.defaultPackage.x86_64-linux;
};
2023-09-07 22:50:04 -04:00
overlay-monitored = self: super: {
nixos-rebuild = super.nixos-rebuild.override {
2023-09-08 06:32:03 -04:00
nix = self.nix-monitored;
2023-09-07 22:50:04 -04:00
};
nix-direnv = super.nix-direnv.override {
2023-09-08 06:32:03 -04:00
nix = self.nix-monitored;
2023-09-07 22:50:04 -04:00
};
2023-09-08 06:32:03 -04:00
nix-monitored = inputs.nix-monitored.packages.${self.system}.default.override self;
2023-09-07 22:50:04 -04:00
};
2023-03-19 04:12:03 -04:00
in
{
##################
### uWebServer ###
##################
nixosConfigurations.uWebServer = nixpkgs.lib.nixosSystem {
2023-03-19 04:12:03 -04:00
inherit system;
modules = genericModules ++ (with nixos-hardware.nixosModules; [
common-pc
common-pc-ssd
common-cpu-intel
]) ++ [ ./devices/uWebServer.nix ];
};
2023-03-19 04:12:03 -04:00
#################
### uGamingPC ###
#################
nixosConfigurations.uGamingPC = nixpkgs.lib.nixosSystem {
inherit system;
modules = genericModules ++ (with nixos-hardware.nixosModules; [
common-pc
common-pc-ssd
common-cpu-amd
]) ++ [ ./devices/uGamingPC.nix ];
2023-01-24 21:43:57 -05:00
};
2023-03-19 04:12:03 -04:00
##################
### uMsiLaptop ###
##################
nixosConfigurations.uMsiLaptop = nixpkgs.lib.nixosSystem {
#deploy#https://github.com/Skulltrail192/One-Core-API-Binaries/archive/refs/heads/master.zip
2023-03-19 04:12:03 -04:00
inherit system;
modules = genericModules ++ (with nixos-hardware.nixosModules; [
common-pc
common-pc-ssd
common-pc-laptop
common-cpu-intel
]) ++ [ ./devices/uMsiLaptop.nix ];
};
#################
### uHPLaptop ###
#################
nixosConfigurations.uHPLaptop = nixpkgs.lib.nixosSystem {
inherit system;
modules = genericModules ++ (with nixos-hardware.nixosModules; [
common-pc
common-pc-ssd
common-pc-laptop
common-cpu-intel
]) ++ [ ./devices/uHPLaptop.nix ];
};
###################
### uMacBookPro ###
###################
nixosConfigurations.uMacBookPro = nixpkgs.lib.nixosSystem {
inherit system;
modules = genericModules ++ (with nixos-hardware.nixosModules; [
common-pc
common-pc-ssd
common-pc-laptop
common-cpu-intel
2023-03-19 04:37:00 -04:00
]) ++ [ ./devices/uMacBookPro.nix ];
};
};
2022-11-16 05:18:24 -05:00
}