239 lines
7.6 KiB
Nix
239 lines
7.6 KiB
Nix
{
|
|
description = "Configuration for Everest";
|
|
|
|
inputs = {
|
|
secrets = {
|
|
url = "git+ssh://forgejo@git.toast003.xyz:4222/Toast/nix-secrets";
|
|
flake = false;
|
|
};
|
|
nixpkgs-raw.url = "nixpkgs/nixos-25.11";
|
|
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
|
|
};
|
|
};
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
};
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-25.11";
|
|
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";
|
|
|
|
copyparty.url = "github:9001/copyparty";
|
|
copyparty.inputs.nixpkgs.follows = "nixpkgs-raw";
|
|
|
|
/*
|
|
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:nix-community/plasma-manager/";
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
|
|
inputs.home-manager.follows = "home-manager-unstable";
|
|
};
|
|
|
|
nix-flatpak.url = "github:gmodena/nix-flatpak/main";
|
|
|
|
catppuccin.url = "github:catppuccin/nix";
|
|
|
|
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";
|
|
};
|
|
|
|
# Non flake inputs / random things
|
|
lix = {
|
|
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
|
flake = false;
|
|
};
|
|
|
|
eza-themes = {
|
|
url = "github:eza-community/eza-themes";
|
|
flake = false;
|
|
};
|
|
|
|
catppuccin-konsole = {
|
|
url = "github:catppuccin/konsole";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
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/pr471291.patch
|
|
./nixpkgs-patches/revert-mangohud-update.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.nixpkgs-unstable-raw;};
|
|
nixpkgs = (import "${nixpkgs-patched}/flake.nix").outputs {self = inputs.nixpkgs-raw;};
|
|
in {
|
|
formatter.x86_64-linux = nixpkgs-unstable.legacyPackages.x86_64-linux.alejandra;
|
|
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShellNoCC {
|
|
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)> "
|
|
'';
|
|
};
|
|
overlays.default = final: prev: {
|
|
kasane-teto-cursor = final.callPackage ./pkgs/kasane-teto-cursor {};
|
|
kame-editor = final.callPackage ./pkgs/kame-editor {};
|
|
kame-tools = final.callPackage ./pkgs/kame-tools {};
|
|
rstmcpp = final.callPackage ./pkgs/rstmcpp {};
|
|
};
|
|
packages = {
|
|
x86_64-linux = with import nixpkgs-unstable-raw {
|
|
system = "x86_64-linux";
|
|
overlays = [self.overlays.default];
|
|
}; {
|
|
inherit kasane-teto-cursor kame-editor kame-tools rstmcpp;
|
|
};
|
|
};
|
|
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 = {
|
|
flakeSelf = self;
|
|
};
|
|
lib = import ./lib {nixpkgs = pkgs;};
|
|
modules =
|
|
[
|
|
agenix.nixosModules.default
|
|
sops-nix.nixosModules.sops
|
|
(
|
|
if stable
|
|
then home-manager
|
|
else home-manager-unstable
|
|
)
|
|
.nixosModules
|
|
.home-manager
|
|
(
|
|
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 = [
|
|
nixos-hardware.nixosModules.gpd-win-max-2-2023
|
|
./roles/desktop
|
|
./roles/kde
|
|
./roles/gaming
|
|
];
|
|
Everest = {
|
|
stable = true;
|
|
modules = [
|
|
copyparty.nixosModules.default
|
|
./roles/server
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|