This commit is contained in:
lsoriano-mcm
2025-06-23 14:32:58 -05:00
commit b631cb20a4
16 changed files with 483 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
{
general = {
Hostname = "TEXAS";
Username = "kenji";
Timezone = "America/Chicago";
allowUnfree = true; # allows installation of commercial apps.
terminal = {
Font = "JetBrainsMono Nerd Font"; # e.g., JetBrainsMono Nerd Font
Size = "11";
Shell = "fish";
Aliases = {
ls = "ls --color=auto";
update = ''
if [[ $(uname) == "Darwin" ]];
sudo darwin-rebuild switch --flake ~/.config/nixos#macos
else
sudo nixos-rebuild switch --flake ~/.config/nixos#desktop && home-manager switch --flake ~/.config/nixos#desktop
fi
'';
agu = "pkill gjs & ags run ~/.config/nixos/pkgs/ags/biscuit/app.ts & disown (jobs -p) &";
};
};
gitProfile = {
User = "kenji";
Email = "kenji@texas.sakamoto.dev";
defaultBranch = "master";
};
ssh = {
extraConfig = ''
Host macair
User biscuit
HostName 192.168.68.81
'';
};
};
builds = {
builder = {
trustedUsers = [
"@groups"
"biscuit"
];
buildMachines = [
{
hostName = "192.168.68.81";
sshUser = "biscuit";
sshKey = "/home/biscuit/.ssh/id_rsa.pub";
system = "x86_64-linux";
supportedFeatures = ["big-parallel" "kvm" "nixos-test"];
}
];
};
};
linux = {
system = "x86_64";
vpn = {
Enable = true;
secretFile = builtins.toPath ./secrets/.vpn.yaml;
};
touchpadSupport = false;
logitech-hardware.enable = false;
# Custom Applications
linux-apps = {
gaming = true;
my-apps = pkgs:
with pkgs; [
jellyfin-media-player
];
};
hyprconf = {
Monitor = [
# hyprctl monitors all
# monitor, resolution@refreshrate, position (e.g., 0x0 is middle, 0x1080 is top), scale
",highres@highrr,auto,auto"
];
};
};
}
+16
View File
@@ -0,0 +1,16 @@
{username, ...}: {
imports = [
];
programs.home-manager.enable = true;
home = {
username = "${username}";
homeDirectory = "/home/${username}";
packages = [];
sessionVariables = {};
};
systemd.user.startServices = "sd-switch";
home.stateVersion = "23.05";
}
+16
View File
@@ -0,0 +1,16 @@
{general, ...}: {
imports = [
];
programs.home-manager.enable = true;
home = {
username = "${general.Username}";
homeDirectory = "/home/${general.Username}";
packages = [];
sessionVariables = {};
};
systemd.user.startServices = "sd-switch";
home.stateVersion = "23.05";
}
View File
+17
View File
@@ -0,0 +1,17 @@
{
config,
pkgs,
inputs,
...
}: {
imports = [
../packages/fish/default.nix
../packages/kitty/default.nix
../packages/neovim/default.nix
];
programs.home-manager.enable = true;
home.packages = [];
home.stateVersion = "23.05";
}
+125
View File
@@ -0,0 +1,125 @@
{
description = "Sakamoto's NixOS Configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; # `follows` ensure it follows nixpkgs versiona. Avoids breaking updates.
darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
ags.url = "github:aylur/ags";
ags.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
hyprland.inputs.nixpkgs.follows = "nixpkgs";
unlisted-fonts.url = "git+https://git.sakamoto.dev/kenji/nix-fonts.git";
unlisted-fonts.inputs.nixpkgs.follows = "nixpkgs";
nixovim.url = "git+https://git.sakamoto.dev/kenji/nix-neovim.git";
nixovim.inputs.nixpkgs.follows = "nixpkgs";
matugen.url = "github:/InioX/Matugen";
matugen.inputs.nixpkgs.follows = "nixpkgs";
nix-gaming.url = "github:fufexan/nix-gaming";
nix-gaming.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
home-manager,
darwin,
ags,
hyprland,
unlisted-fonts,
nixovim,
...
} @ inputs: let
config = import ./config.nix;
lib = nixpkgs.lib;
system = "x86_64-linux";
# pkgs = nixpkgs.legacyPackages.${system}; # alternative, without overlays. Unused.
args =
{
inherit inputs system;
}
// config;
in {
# nixosConfiguration for linux system
nixosConfigurations = {
desktop = lib.nixosSystem {
inherit system;
specialArgs = args;
modules = [
./hosts/desktop/configuration.nix
];
};
gaming = lib.nixosSystem {
inherit system;
specialArgs = args;
modules = [
./hosts/gaming/configuration.nix
];
};
headless = lib.nixosSystem {
inherit system;
specialArgs = args;
modules = [
./hosts/headless/configuration.nix
];
};
};
homeConfigurations = {
desktop = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
overlays = [
# (final: prev: {
# ags_1 = prev.ags_1.overrideAttrs (old: {
# buildInputs = old.buildInputs ++ [pkgs.libdbusmenu-gtk3];
# });
# })
];
};
extraSpecialArgs = args;
modules = [./dotfiles/desktop.nix];
};
gaming = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
overlays = [];
};
extraSpecialArgs = args;
modules = [./dotfiles/gaming.nix];
};
headless = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
inherit system;
overlays = [];
};
extraSpecialArgs = args;
modules = [./dotfiles/headless.nix];
};
};
# darwinConfiguration for macOS M series
darwinConfigurations = {
macos = darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = args;
modules = [
./nixos/macos/darwin.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = args;
}
];
};
};
};
}
+27
View File
@@ -0,0 +1,27 @@
{
pkgs,
general,
builds,
...
}: {
imports = [
# Include the results of the hardware scan.
];
environment.systemPackages = with pkgs; [];
nixpkgs.config.allowUnfree = general.allowUnfree;
nix.settings = {
trusted-users = builds.builder.trustedUsers;
experimental-features = ["nix-command" "flakes"];
};
programs.ssh.extraConfig = general.ssh.extraConfig;
nix.distributedBuilds = true;
nix.settings.builders-use-substitutes = true;
# nix.buildMachines = builder.buildMachines;
system.stateVersion = "25.05";
}
+29
View File
@@ -0,0 +1,29 @@
{
pkgs,
general,
builds,
inputs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
];
environment.systemPackages = with pkgs; [];
nixpkgs.config.allowUnfree = general.allowUnfree;
nix.settings = {
trusted-users = builds.builder.trustedUsers;
experimental-features = ["nix-command" "flakes"];
};
programs.ssh.extraConfig = general.ssh.extraConfig;
nix.distributedBuilds = true;
nix.settings.builders-use-substitutes = true;
# nix.buildMachines = builder.buildMachines;
system.stateVersion = "25.05";
}
+39
View File
@@ -0,0 +1,39 @@
{
pkgs,
builds,
general,
...
}: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
python313
];
# Auto upgrade nix package and the daemon service.
# services.nix-daemon.enable = true;
# services.karabiner-elements.enable = true;
# nix.package = pkgs.nix;
# Necessary for using flakes on this system.
nix.settings.experimental-features = "nix-command flakes";
nix.settings.trusted-users = builds.builder.trustedUsers;
# Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enable = true; # default shell on catalina
programs.fish.enable = true;
# $ darwin-rebuild changelog
system.stateVersion = 5;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = "aarch64-darwin";
users.users.${general.Username} = {
name = "${general.Username}";
home = "/Users/${general.Username}";
shell = pkgs.${general.terminal.Shell};
};
home-manager.users.${general.Username} = import ../../dotfiles/macos.nix;
}
+20
View File
@@ -0,0 +1,20 @@
{
pkgs,
general,
...
}: {
programs.zoxide.enable = true;
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting
fish_vi_key_bindings
zoxide init fish | source
'';
shellAliases = general.terminal.Aliases;
plugins = with pkgs.fishPlugins; [
];
};
}
+25
View File
@@ -0,0 +1,25 @@
{terminal, ...}: {
programs.kitty = {
enable = true;
themeFile = "kanagawa";
settings = {
confirm_os_window_close = 0;
window_padding_width = 10;
font_size = terminal.Size;
font_family = terminal.Font;
bold_font = "auto";
italic_font = "auto";
bold_italic_font = "auto";
# optimization
input_delay = 0;
repaint_delay = 2;
sync_to_monitor = false;
wayland_enable_ime = false;
allow_remote_control = true;
};
extraConfig = "include colors.conf";
};
}
+12
View File
@@ -0,0 +1,12 @@
{
pkgs,
inputs,
...
}: let
nixovim = inputs.nixovim.packages.${pkgs.system}.default;
in {
home.packages = [
nixovim
pkgs.lazygit
];
}
+23
View File
@@ -0,0 +1,23 @@
{
pkgs,
inputs,
...
}: {
environment.systemPackages = with pkgs; [
wl-clipboard
hypridle
hyprlock
];
programs.hyprland = {
enable = true;
# package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
# portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
};
hardware = {
graphics.enable = true;
};
services = {
# displayManager.sddm.wayland = true;
displayManager.gdm.enable = true;
};
}
+11
View File
@@ -0,0 +1,11 @@
{
pkgs,
inputs,
...
}: {
environment.systemPackages = [
# or home.packages
inputs.nix-gaming.packages.${pkgs.system}.wine # installs a package
];
programs.steam.platformOptimizations.enable = true;
}
+19
View File
@@ -0,0 +1,19 @@
{
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
lowLatency = {
# enable this module
enable = true;
# defaults (no need to be set unless modified)
quantum = 64;
rate = 48000;
};
};
# make pipewire realtime-capable
security.rtkit.enable = true;
}
+20
View File
@@ -0,0 +1,20 @@
{
pkgs,
general,
terminal,
...
}: {
users = {
defaultUserShell = pkgs.${terminal.Shell};
users = {
${general.Username} = {
isNormalUser = true;
extraGroups = ["wheel" "networkmanager" "input"];
initialHashedPassword = "$6$Qab6SSvEJM2YRtVA$7Oyl7E3pp/FKtCC.2Tb2tyzp3yp7BFHFAKngUYJssQJ.v1Q2mqsgW9m7njpaKNcka2vyCwrnmw1R.YPlFqR0p1";
useDefaultShell = true;
packages = [
];
};
};
};
}