Modularize

This commit is contained in:
Jack Mechem 2025-07-24 11:16:51 -07:00
parent 4b1d7f684c
commit d6a288da0f
11 changed files with 346 additions and 66 deletions

158
flake.lock generated
View file

@ -1,5 +1,79 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gtkapps": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1753299093,
"narHash": "sha256-8+NgfNQX8H59VdFWtuk3neB9Ibf6JfHX9qfmg7QGP/I=",
"owner": "JackMechem",
"repo": "gtkapps",
"rev": "274ffba79071c77b7e39e8f0c440a1214f13bf40",
"type": "github"
},
"original": {
"owner": "JackMechem",
"repo": "gtkapps",
"type": "github"
}
},
"gtkbar": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1753305855,
"narHash": "sha256-rsE0clWdZz6PFKfVsN0Po19nBP42X3KfSMjJaLRaxR0=",
"owner": "JackMechem",
"repo": "gtkbar",
"rev": "f7deb6ff7eab858d3e2e600cb6e600b55b6850be",
"type": "github"
},
"original": {
"owner": "JackMechem",
"repo": "gtkbar",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -7,11 +81,11 @@
]
},
"locked": {
"lastModified": 1752798675,
"narHash": "sha256-oMJhxLVGVC7v0ReNQ/vFVKMQOPUixg/74MnZZ1Wkv4s=",
"lastModified": 1753294394,
"narHash": "sha256-1Dfgq09lHZ8AdYB2Deu/mYP1pMNpob8CgqT5Mzo44eI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "dcfd70f80fe6d872c2dc58fe3be384a681e56fea",
"rev": "1fde6fb1be6cd5dc513dc1c287d69e4eb2de973e",
"type": "github"
},
"original": {
@ -43,11 +117,43 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1752480373,
"narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=",
"lastModified": 1752950548,
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1752950548,
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1752950548,
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08",
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
"type": "github"
},
"original": {
@ -59,11 +165,43 @@
},
"root": {
"inputs": {
"gtkapps": "gtkapps",
"gtkbar": "gtkbar",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_3",
"zen-browser": "zen-browser"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"home-manager": "home-manager_2",
@ -72,11 +210,11 @@
]
},
"locked": {
"lastModified": 1752809889,
"narHash": "sha256-oTIVrw7Cy2McAVqE7GCot5Fb8Wh4JBsUDKMX8u3DFlU=",
"lastModified": 1753069499,
"narHash": "sha256-YtgY0ueqKNrBma4Euu8WH23BhUkBujirJDMDE1KujnU=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "f19d2b6b18d4a2e8bf2d6a9f69c934d6726360c4",
"rev": "c64b94235ae24e3b9e01a08f0331d8bb0e5b037a",
"type": "github"
},
"original": {

View file

@ -3,6 +3,8 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
gtkapps.url = "github:JackMechem/gtkapps";
gtkbar.url = "github:JackMechem/gtkbar";
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";

View file

@ -1,77 +1,52 @@
{ config, lib, pkgs, inputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
imports = [
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
../../modules/nixos/gtkapps.nix
../../modules/nixos/gtkbar.nix
../../modules/nixos/fonts.nix
../../modules/nixos/system-packages.nix
../../modules/nixos/user-jack.nix
../../modules/nixos/sound.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "t480"; # Define your hostname.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
networking.hostName = "t480";
networking.networkmanager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
time.timeZone = "America/LosAngeles";
time.timeZone = "America/Los_Angeles";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound.
services.pipewire = {
enable = true;
pulse.enable = true;
};
services.dbus.enable = true;
users.users.jack = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
packages = with pkgs; [
zed-editor
];
};
programs.zsh.enable = true;
programs.thunar.enable = true;
programs.dconf.enable = true;
home-manager = {
extraSpecialArgs = { inherit inputs; };
users = {
"jack" = import ./home.nix;
};
users = { "jack" = import ./home.nix; };
};
nixpkgs.config.allowUnfree = true;
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
programs.firefox.enable = true;
programs.hyprland.enable = true;
# List packages installed in system profile.
environment.systemPackages = with pkgs; [
neovim
tree
vim # Both vim and neovim just in case
wget
ghostty
git
gcc
];
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
system.stateVersion = "25.05"; # Did you read the comment?
system.stateVersion = "25.05";
}

View file

@ -4,8 +4,10 @@
imports = [
inputs.zen-browser.homeModules.twilight
../../modules/home-manager/zsh.nix
];
programs.home-manager.enable = true;
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "jack";
@ -15,19 +17,49 @@
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
];
home.packages = [ pkgs.sway-contrib.grimshot ];
programs.zen-browser.enable = true;
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
home.file = { };
gtk = {
enable = true;
theme = {
name = "Graphite-Dark";
package = pkgs.graphite-gtk-theme;
};
home.sessionVariables = {
EDITOR = "nvim";
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
};
programs.home-manager.enable = true;
home.pointerCursor = {
gtk.enable = true;
x11.enable = true;
name = "capitaine-cursors";
package = pkgs.capitaine-cursors;
size = 32; # optional, adjust as needed
};
xdg.configFile = {
"gtk-4.0/assets".source =
"${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets";
"gtk-4.0/gtk.css".source =
"${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css";
"gtk-4.0/gtk-dark.css".source =
"${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css";
};
home.shellAliases = {
nixreb = "sudo nixos-rebuild switch --flake /home/jack/nixos/#t480";
};
home.sessionVariables = { EDITOR = "nvim"; };
}

View file

@ -0,0 +1,29 @@
{ pkgs, ... }:
let
shellAliases = {
rebuild-nix = "sudo nixos-rebuild switch --flake /home/jack/nixos/#t480";
};
in
{
programs.zsh = {
enable = true;
inherit shellAliases;
syntaxHighlighting.enable = true;
autosuggestion.enable = true;
};
programs.zsh.oh-my-zsh = {
enable = true;
theme = "gentoo";
plugins = [
"git"
"kubectl"
"helm"
"docker"
];
};
programs.bash = {
enable = true;
inherit shellAliases;
};
}

31
modules/nixos/fonts.nix Normal file
View file

@ -0,0 +1,31 @@
{ pkgs, ... }: {
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
jetbrains-mono
nerd-fonts.jetbrains-mono
font-awesome
google-fonts
corefonts
vista-fonts
inter
];
fontconfig = {
enable = true;
defaultFonts = {
serif = [ "Noto Serif" ];
sansSerif = [ "Noto Sans" ];
monospace = [ "JetBrains Mono" ];
emoji = [ "Noto Color Emoji" ];
};
};
};
}

15
modules/nixos/gtkapps.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, inputs, ... }:
let cfg = config.services.gtkapps;
in
{
options.services.gtkapps = {
enable = lib.mkEnableOption "Enable the gtkapps application";
};
config = lib.mkIf cfg.enable {
environment.systemPackages =
[ inputs.gtkapps.packages.${pkgs.system}.default ];
};
}

15
modules/nixos/gtkbar.nix Normal file
View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, inputs, ... }:
let cfg = config.services.gtkbar;
in
{
options.services.gtkbar = {
enable = lib.mkEnableOption "Enable the gtkbar application";
};
config = lib.mkIf cfg.enable {
environment.systemPackages =
[ inputs.gtkbar.packages.${pkgs.system}.default ];
};
}

10
modules/nixos/sound.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
# Enable sound.
services.pipewire = {
enable = true;
pulse.enable = true;
};
}

View file

@ -0,0 +1,22 @@
{ pkgs, inputs, ... }:
{
programs.firefox.enable = true;
programs.hyprland.enable = true;
services.gtkapps.enable = true;
services.gtkbar.enable = true;
# List packages installed in system profile.
environment.systemPackages = with pkgs; [
neovim
tree
vim # Both vim and neovim just in case
wget
ghostty
git
gcc
fastfetch
];
}

View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
users.users.jack = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
packages = with pkgs; [ zed-editor cargo ];
};
}