minor refractor

This commit is contained in:
js0ny 2025-10-21 15:36:02 +01:00
parent 679f5bea9d
commit 1b99070718
22 changed files with 248 additions and 298 deletions

View file

@ -27,87 +27,95 @@
};
};
outputs = {
self,
nixpkgs,
nix-flatpak,
nix-darwin,
home-manager,
plasma-manager,
nur,
winboat,
caelestia-shell,
...
} @ inputs: let
overlays = [
nur.overlays.default
(final: prev: {
winboat = winboat.packages.x86_64-linux.winboat;
caelestia-shell = caelestia-shell.packages.x86_64-linux.caelestia-shell;
})
];
forSystem = system:
import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
specialArgs = {inherit inputs overlays;};
nixosHosts = [
"zp"
"zephyrus"
"nixvirt"
];
mkNixosSystem = hostname:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [./hosts/${hostname} {nixpkgs.overlays = overlays;}];
};
in {
# This will automatically generate nixOS config for `nixosHosts'
# Include the module ./hosts/${hostname} by default.
nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem;
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
inherit specialArgs;
modules = [
./hosts/zen
outputs =
{
self,
nixpkgs,
nix-flatpak,
nix-darwin,
home-manager,
plasma-manager,
nur,
winboat,
caelestia-shell,
...
}@inputs:
let
overlays = [
nur.overlays.default
(final: prev: {
winboat = winboat.packages.x86_64-linux.winboat;
caelestia-shell = caelestia-shell.packages.x86_64-linux.caelestia-shell;
})
];
forSystem =
system:
import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
specialArgs = { inherit inputs overlays; };
nixosHosts = [
"zp"
"zephyrus"
"nixvirt"
];
};
homeConfigurations = {
js0ny = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
mkNixosSystem =
hostname:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [
./hosts/${hostname}
{ nixpkgs.overlays = overlays; }
];
};
in
{
# This will automatically generate nixOS config for `nixosHosts'
# Include the module ./hosts/${hostname} by default.
nixosConfigurations = nixpkgs.lib.genAttrs nixosHosts mkNixosSystem;
darwinConfigurations."zen" = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
inherit specialArgs;
modules = [
./users/js0ny
./hosts/zen
];
};
"js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/zephyrus.nix
plasma-manager.homeModules.plasma-manager
nix-flatpak.homeManagerModules.nix-flatpak
];
};
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/nixvirt.nix
];
};
"js0ny@zen" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "aarch64-darwin";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/zen.nix
];
homeConfigurations = {
js0ny = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny
];
};
"js0ny@zephyrus" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/zephyrus.nix
plasma-manager.homeModules.plasma-manager
nix-flatpak.homeManagerModules.nix-flatpak
];
};
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "x86_64-linux";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/nixvirt.nix
];
};
"js0ny@zen" = home-manager.lib.homeManagerConfiguration {
pkgs = forSystem "aarch64-darwin";
extraSpecialArgs = specialArgs;
modules = [
./users/js0ny/zen.nix
];
};
};
};
};
}

View file

@ -1,126 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.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 = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Europe/London";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# services.pulseaudio.enable = true;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = 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.
users.users.js0ny = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
packages = with pkgs; [
tree
];
};
# programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "25.05"; # Did you read the comment?
}

View file

@ -1,5 +1,5 @@
# ~/.config/nixcfgs/hosts/zephyrus/default.nix
{config, ...}: {
{...}: {
imports = [
../../modules/nixos
../../modules/nixos/host-machine.nix
@ -14,7 +14,9 @@
../../modules/nixos/chromium.nix
../../modules/nixos/obs-studio.nix
../../modules/nixos/wine.nix
../../modules/nixos/exp.nix
../../modules/nixos/gnome-keyring.nix
../../modules/nixos/udev/basys3.nix
../../modules/nixos/desktop/kde.nix
../../modules/nixos/desktop/hyprland.nix
../../modules/nixos/display-manager/sddm.nix
@ -25,14 +27,6 @@
nixpkgs.config.allowUnfree = true;
networking.hostName = "zephyrus";
hardware.enableRedistributableFirmware = true;
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
networking.modemmanager.enable = false;
# Xilinx Artix-7 Basys 3
services.udev.extraRules = ''
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0660", GROUP="dialout", SYMLINK+="basys3"
'';
system.stateVersion = "25.05";
}

View file

@ -3,4 +3,8 @@
gcc
llvmPackages_21.clang-tools # clangd
];
programs.vscode.profiles.default.extensions = with pkgs.vscode-extensions; [
llvm-vs-code-extensions.vscode-clangd
];
}

View file

@ -1,6 +1,11 @@
{pkgs, ...}: {
{...}: let
alias = {"v" = "nvim";};
in {
programs.neovim = {
enable = true;
defaultEditor = true;
};
programs.fish.shellAbbrs = alias;
programs.bash.shellAliases = alias;
programs.zsh.shellAliases = alias;
}

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{...}: {
programs.starship = {
enable = true;
enableBashIntegration = true;

View file

@ -1,6 +1,11 @@
{pkgs, ...}: {
{pkgs, ...}: let
alias = {"c" = "codium";};
in {
programs.vscode = {
package = pkgs.vscodium;
enable = true;
};
programs.fish.shellAbbrs = alias;
programs.bash.shellAliases = alias;
programs.zsh.shellAliases = alias;
}

View file

@ -1,8 +1,19 @@
{pkgs, ...}: {
{...}: let
zoxideAliases = {
".." = "z ..";
"..." = "z ../..";
"...." = "z ../../..";
"....." = "z ../../../..";
"......" = "z ../../../../..";
};
in {
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableFishIntegration = true;
};
programs.fish.shellAliases = zoxideAliases;
programs.bash.shellAliases = zoxideAliases;
programs.zsh.shellAliases = zoxideAliases;
}

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{
{pkgs, ...}: {
services.desktopManager.plasma6.enable = true;
environment.systemPackages = with pkgs.kdePackages; [
akonadi
korganizer
kdepim-addons
];
}

View file

@ -0,0 +1,5 @@
{...}: {
# services.forgejo.enable = true;
services.syncthing.enable = true;
services.tailscale.enable = true;
}

View file

@ -1,5 +1,8 @@
{ pkgs, ... }:
{
{config, ...}: {
hardware.enableRedistributableFirmware = true;
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
programs.obs-studio = {
enable = true;
enableVirtualCamera = true;

View file

@ -0,0 +1,6 @@
{...}: {
# Xilinx Artix-7 Basys 3
services.udev.extraRules = ''
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0660", GROUP="dialout", SYMLINK+="basys3"
'';
}

View file

@ -1,12 +1,11 @@
{ config, ... }:
{
{config, ...}: {
programs.distrobox = {
enable = true;
containers = {
Xilinx = {
# Container to run Xilinx Vivado Toolchain 2022.2
image = "ubuntu:22.04";
additional_packages = "libncurses5-dev libtinfo5 ncurses-compat-libs lsb-release graphviz openssl xscreensaver gcc c++ xvfb xorg-dev libwebkit2gtk-4.0-37 libgtk-3-dev libgtk-4-dev libgvfsdbus gvfs libwayland-client0 libwayland-cursor0";
additional_packages = "libncurses5-dev libtinfo5 ncurses-compat-libs lsb-release graphviz openssl xscreensaver gcc c++ xvfb xorg-dev libwebkit2gtk-4.0-37 libgtk-3-dev libgtk-4-dev libgvfsdbus gvfs libwayland-client0 libwayland-cursor0 x11-utils";
home = "${config.home.homeDirectory}/.local/distrobox/Xilinx";
init_hooks = [
"sudo chown $USER:$USER /opt"

View file

@ -0,0 +1,16 @@
{pkgs, ...}: {
programs.emacs = {
enable = true;
package = pkgs.emacs-pgtk;
extraPackages = epkgs:
with epkgs; [
evil
telega
beancount
counsel
];
};
home.packages = with pkgs; [
tdlib
];
}

View file

@ -1,4 +1,5 @@
{
xdg.configFile."mimeapps.list".force = true;
xdg.mime.enable = true;
xdg.mimeApps = {
enable = true;
@ -8,6 +9,12 @@
"text/x-csrc" = "nvim-qt.desktop";
"text/x-chdr" = "nvim-qt.desktop";
"inode/directory" = "org.kde.dolphin.desktop";
"x-scheme-handler/tg" = "org.telegram.desktop.desktop";
"x-scheme-handler/tonsite" = "org.telegram.desktop.desktop";
};
associations.added = {
"x-scheme-handler/tg" = "org.telegram.desktop.desktop";
"x-scheme-handler/tonsite" = "org.telegram.desktop.desktop";
};
};
}

View file

@ -1,11 +1,9 @@
{config, ...}: let
commonAliases = {
v = "nvim";
g = "lazygit";
ni = "touch";
cls = "clear";
ii = "open";
c = "code";
aic = "aichat -s";
aicc = "aichat -c";
nrs = "sudo nixos-rebuild switch --flake ~/.dotfiles/nixcfgs";

View file

@ -1,4 +1,6 @@
{pkgs, ...}: {
{pkgs, ...}: let
alias = {"c" = "code";};
in {
programs.vscode = {
package = pkgs.vscode;
enable = true;
@ -14,4 +16,7 @@
vspacecode.whichkey
];
};
programs.fish.shellAbbrs = alias;
programs.bash.shellAliases = alias;
programs.zsh.shellAliases = alias;
}

View file

@ -8,7 +8,8 @@
./packages/fonts.nix
./packages/catppuccin.nix
./programs/chromium.nix
./programs/gnome.nix
./programs/emacs.nix
# ./programs/gnome.nix
./programs/plasma.nix
./programs/shell.nix
./programs/vscode.nix