1
0
Fork 0
nix-system-configurations/flake.nix
2025-09-29 02:57:03 -05:00

289 lines
8.5 KiB
Nix

# SPDX-FileCopyrightText: 2025 Ethan Reece <contact@ethanreece.com>
#
# SPDX-License-Identifier: MIT
# TODO: Add command to generate GPG keys
{
description = "Home Manager configuration";
inputs = {
flake-lib = {
url = "git+https://git.sudoer777.dev/me/nix-flake-base.git?ref=main";
flake = true;
inputs = {
devshell.follows = "devshell";
flake-parts.follows = "flake-parts";
git-hooks-nix.follows = "git-hooks-nix";
lix-module.follows = "lix-module";
nixgl.follows = "nixgl";
nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
catppuccin.url = "github:catppuccin/nix";
devshell.url = "github:numtide/devshell";
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
git-hooks-nix.url = "github:cachix/git-hooks.nix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
lanzaboote.url = "github:nix-community/lanzaboote";
# TODO: https://git.lix.systems/lix-project/lix/issues/943
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";
inputs.lix.follows = "lix";
};
niri = {
url = "github:sodiboo/niri-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:nix-darwin/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:nix-community/nix-on-droid/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nur.url = "github:nix-community/NUR";
pwndbg.url = "github:pwndbg/pwndbg";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
spicetify-nix.url = "github:Gerg-L/spicetify-nix";
treefmt-nix.url = "github:numtide/treefmt-nix";
xlnx-utils.url = "github:moritz-meier/xilinx-nix-utils";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, ... }:
{
systems = [
"aarch64-linux"
"aarch64-darwin"
"x86_64-linux"
];
imports = [
inputs.flake-lib.flakeModule
./options
./sops
./home-manager/flake-module.nix
./nix-darwin/flake-module.nix
./nix-on-droid/flake-module.nix
./nixos/flake-module.nix
];
profiles =
let
name = "Ethan Reece";
keys = (import ./public-keys.nix);
in
{
personal = rec {
enable = true;
domains = {
realName = "ethanreece.com";
netName = "sudoer777.dev";
};
homeManagerSystem = "aarch64-linux";
fullNames.default = name;
shortNames = rec {
realFirst = "ethan";
realLast = "reece";
realFull = "${realFirst}${realLast}";
netName = "sudoer777";
};
emails.default = "contact@${domains.realName}";
sshKeys = keys.ssh.profiles.personal;
};
utdallas = rec {
enable = true;
domains.default = "utdallas.edu";
fullNames.default = name;
shortNames.default = "edr220000";
emails.default = "${shortNames.default}@${domains.default}";
};
utd_cs4485.enable = true;
utd_syssec.enable = false;
proxmox = {
enable = true;
homeManagerSystem = "x86_64-linux";
};
};
devices = {
macos = {
enable = true;
system = "aarch64-darwin";
};
raspi = {
enable = false;
system = "aarch64-linux";
};
pixel6p = {
enable = true;
system = "aarch64-linux";
};
hpenvy = {
enable = true;
system = "x86_64-linux";
disko = {
enable = true;
disk = "/dev/nvme0n1";
};
};
minimal-x86_64 = {
enable = true;
system = "x86_64-linux";
iso = true;
disko = {
enable = true;
disk = "/dev/nvme0n1";
};
};
graphical-x86_64 = {
enable = true;
system = "x86_64-linux";
iso = true;
disko = {
enable = true;
disk = "/dev/nvme0n1";
};
};
};
perSystem =
{
lib,
pkgs,
system,
...
}:
let
pkgs = import inputs.nixpkgs {
inherit system;
config = {
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"xilinx-unified"
"xilinx-unified-wrapped"
];
};
overlays = [
inputs.niri.overlays.niri
inputs.nixgl.overlays.default
inputs.nur.overlays.default
inputs.xlnx-utils.overlays.xilinx-unified
(import ./overlays/xilinx-unified.nix { inherit inputs lib; })
];
};
in
{
_module.args.pkgs = pkgs;
editors.helix.enable = true;
languages = {
en-us = {
enable = true;
dictionary = [
"ASLR"
"Boycat"
"Floorp"
"Guix"
"Haseeb"
"iterm"
"Jujutsu"
"lajp"
"LanguageTool"
"LicenseRef"
"LLMs"
"LTeX"
"Majid"
"MatthewCroughan"
"MWMBL"
"Niri"
"Nix"
"Reece"
"TODO"
"TrackMeNot"
"UTD"
"Vivado"
"Xilinx"
];
excludes = [
".sops.yaml"
"sops/*"
"public-keys.nix"
];
vale."{**/*.md}".packages = {
RedHat.enable = true;
proselint.enable = true;
write-good.enable = true;
alex.enable = true;
};
};
markdown.enable = true;
nix.enable = true;
plain-text.enable = true;
toml.enable = true;
yaml.enable = true;
};
# pre-commit.settings.excludes = [
# ".sops.yaml"
# "sops"
# ];
# treefmt.settings.global.excludes = [
# ".sops.yaml"
# "sops/*"
# ];
devshells.default = {
packages = [ pkgs.forgejo-cli ];
commands = [
{
help = " generate GPG key";
name = "keygen-gpg";
command = "${pkgs.gnupg}/bin/gpg --generate-key";
category = " Init";
}
{
help = " generate SSH key";
name = "keygen-ssh";
command = "${pkgs.openssh}/bin/ssh-keygen";
category = " Init";
}
];
devshell = {
motd = ''
{202} Nix System Configurations{reset}
$(type -p menu &>/dev/null && menu)
'';
name = "System Configurations";
};
};
};
}
);
}