229 lines
7.3 KiB
Nix
229 lines
7.3 KiB
Nix
{
|
|
description = "Configuration for Everest";
|
|
|
|
inputs = {
|
|
secrets = {
|
|
url = "git+ssh://forgejo@git.everest.tailscale:4222/Toast/nix-secrets";
|
|
flake = false;
|
|
};
|
|
nixpkgs-raw.url = "nixpkgs/nixos-24.05";
|
|
nixpkgs-unstable-raw.url = "nixpkgs/nixos-unstable";
|
|
|
|
agenix = {
|
|
url = "github:ryantm/agenix";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs-raw";
|
|
darwin.follows = ""; # Not using this on MacOS, so this doesn't pull it's dependencies
|
|
};
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-24.05";
|
|
inputs.nixpkgs.follows = "nixpkgs-raw";
|
|
};
|
|
|
|
home-manager-unstable = {
|
|
url = "github:nix-community/home-manager/";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
};
|
|
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
|
|
jovian = {
|
|
url = "github:Jovian-Experiments/Jovian-NixOS";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
};
|
|
|
|
nix-impermanence.url = "github:nix-community/impermanence";
|
|
|
|
/*
|
|
These are the same input, just following different nixpkgs versions
|
|
This avoids some wierdness when using one that follows unstable on a stable nixpkgs
|
|
*/
|
|
nix-index-db = {
|
|
url = "github:Mic92/nix-index-database";
|
|
inputs.nixpkgs.follows = "nixpkgs-raw";
|
|
};
|
|
|
|
nix-index-db-unstable = {
|
|
url = "github:Mic92/nix-index-database";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
};
|
|
|
|
plasma-manager = {
|
|
url = "github:toast003/plasma-manager/libinput";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
inputs.home-manager.follows = "home-manager-unstable";
|
|
};
|
|
|
|
catppuccin-vsc.url = "github:catppuccin/vscode";
|
|
|
|
vscode-extensions = {
|
|
url = "github:nix-community/nix-vscode-extensions";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
};
|
|
nix-flatpak.url = "github:gmodena/nix-flatpak/main";
|
|
|
|
nur.url = "github:nix-community/NUR";
|
|
|
|
catppuccin.url = "github:catppuccin/nix";
|
|
|
|
lix = {
|
|
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
|
flake = false;
|
|
};
|
|
lix-module = {
|
|
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
|
|
inputs.nixpkgs.follows = "nixpkgs-raw";
|
|
inputs.lix.follows = "lix";
|
|
};
|
|
lix-module-unstable = {
|
|
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
inputs.lix.follows = "lix";
|
|
};
|
|
|
|
nix-minecraft = {
|
|
url = "github:Infinidoge/nix-minecraft";
|
|
inputs.nixpkgs.follows = "nixpkgs-raw";
|
|
};
|
|
};
|
|
|
|
outputs = {...} @ inputs:
|
|
with inputs;
|
|
# Patch nixpkgs
|
|
# https://ertt.ca/nix/patch-nixpkgs/
|
|
let
|
|
nixpkgs-unstable-patched = nixpkgs-raw.legacyPackages.x86_64-linux.applyPatches {
|
|
name = "patched-nixpkgs-unstable";
|
|
src = nixpkgs-unstable-raw;
|
|
patches = [
|
|
./nixpkgs-patches/handheld-daemon-ui-init.patch
|
|
];
|
|
};
|
|
nixpkgs-patched = nixpkgs-raw.legacyPackages.x86_64-linux.applyPatches {
|
|
name = "patched-nixpkgs";
|
|
src = nixpkgs-raw;
|
|
patches = [];
|
|
};
|
|
# https://discourse.nixos.org/t/proper-way-of-applying-patch-to-system-managed-via-flake/21073/26
|
|
nixpkgs-unstable = (import "${nixpkgs-unstable-patched}/flake.nix").outputs {self = inputs.self;};
|
|
nixpkgs = (import "${nixpkgs-patched}/flake.nix").outputs {self = inputs.self;};
|
|
in {
|
|
formatter.x86_64-linux = nixpkgs-unstable.legacyPackages.x86_64-linux.alejandra;
|
|
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
|
|
name = "toast-devshell";
|
|
# The agenix cli is not needed to activate a configuration, so instead of installing it
|
|
# I'll just add it to de devShell, since that's the only real time I'm going to use it.
|
|
packages = with nixpkgs.legacyPackages.x86_64-linux; [
|
|
agenix.packages.x86_64-linux.default
|
|
git
|
|
nvd
|
|
nix-output-monitor
|
|
nix-diff
|
|
just
|
|
alejandra
|
|
];
|
|
shellHook = ''
|
|
export PS1="$PS1(toast-configs)> "
|
|
'';
|
|
};
|
|
packages = {
|
|
x86_64-linux = with import nixpkgs-unstable-raw {system = "x86_64-linux";}; {
|
|
anything-sync-daemon = callPackage ./pkgs/anything-sync-daemon {};
|
|
discord-krisp-fixer = callPackage ./pkgs/discord-krisp-fixer {};
|
|
};
|
|
};
|
|
nixosConfigurations = let
|
|
mkSystems = hosts:
|
|
builtins.mapAttrs (
|
|
host: settings: let
|
|
pkgs =
|
|
if isStable
|
|
then nixpkgs
|
|
else nixpkgs-unstable;
|
|
isStable = (settings ? stable) && (settings.stable == true);
|
|
in
|
|
mkSystem host settings.modules pkgs isStable
|
|
)
|
|
hosts;
|
|
mkSystem = host: modules: pkgs: stable:
|
|
pkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = {
|
|
systemPkgs =
|
|
if stable
|
|
then nixpkgs-patched
|
|
else nixpkgs-unstable-patched;
|
|
flakeSelf = self;
|
|
};
|
|
modules =
|
|
[
|
|
agenix.nixosModules.default
|
|
(
|
|
if stable
|
|
then home-manager
|
|
else home-manager-unstable
|
|
)
|
|
.nixosModule
|
|
(
|
|
if stable
|
|
then nix-index-db
|
|
else nix-index-db-unstable
|
|
)
|
|
.nixosModules
|
|
.nix-index
|
|
catppuccin.nixosModules.catppuccin
|
|
(
|
|
if stable
|
|
then lix-module
|
|
else lix-module-unstable
|
|
)
|
|
.nixosModules
|
|
.default
|
|
./roles/common
|
|
(./machines + "/${host}")
|
|
]
|
|
++ modules;
|
|
};
|
|
in
|
|
mkSystems {
|
|
Archie.modules = [
|
|
nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
|
./roles/desktop
|
|
./roles/kde
|
|
./roles/gaming
|
|
];
|
|
SurfaceGo.modules = [
|
|
nixos-hardware.nixosModules.microsoft-surface-go
|
|
./roles/desktop
|
|
./roles/kde
|
|
./machines/SurfaceGo
|
|
];
|
|
SteamDeck.modules = [
|
|
jovian.nixosModules.default
|
|
./roles/desktop
|
|
./roles/kde
|
|
./roles/gaming
|
|
];
|
|
WinMax2.modules = [
|
|
jovian.nixosModules.default
|
|
nixos-hardware.nixosModules.gpd-win-max-2-2023
|
|
./roles/desktop
|
|
./roles/kde
|
|
./roles/gaming
|
|
];
|
|
Everest = {
|
|
stable = true;
|
|
modules = [
|
|
nix-minecraft.nixosModules.minecraft-servers
|
|
{nixpkgs.overlays = [nix-minecraft.overlay];}
|
|
./roles/server
|
|
];
|
|
};
|
|
iMac.modules = [
|
|
./roles/desktop
|
|
];
|
|
};
|
|
};
|
|
}
|