code cleanup

This commit is contained in:
Aly Raffauf 2024-05-27 21:39:30 -04:00
parent 730778f91d
commit 2ab53ed2b9
35 changed files with 207 additions and 211 deletions

View file

@ -9,7 +9,7 @@
}: {
imports = [
./disko.nix
./hardware-configuration.nix
./hardware.nix
./home.nix
self.nixosModules.default
];

View file

@ -9,7 +9,7 @@
}: {
imports = [
./disko.nix
./hardware-configuration.nix
./hardware.nix
./home.nix
self.nixosModules.default
];

View file

@ -14,7 +14,7 @@
archiveDirectory = "/mnt/Archive";
in {
imports = [
./hardware-configuration.nix
./hardware.nix
./home.nix
self.nixosModules.default
];
@ -72,7 +72,7 @@ in {
syncthing = {
enable = true;
syncMusic = true;
syncMusicPath = "${mediaDirectory}/Music";
musicPath = "${mediaDirectory}/Music";
};
tailscale.enable = true;
};

View file

@ -9,7 +9,7 @@
}: {
imports = [
./disko.nix
./hardware-configuration.nix
./hardware.nix
./home.nix
self.nixosModules.default
inputs.jovian.nixosModules.default

View file

@ -9,7 +9,7 @@
}: {
imports = [
./disko.nix
./hardware-configuration.nix
./hardware.nix
./home.nix
self.nixosModules.default
];

View file

@ -9,7 +9,7 @@
}: {
imports = [
./disko.nix
./hardware-configuration.nix
./hardware.nix
./home.nix
self.nixosModules.default
];

View file

@ -3,5 +3,13 @@ inputs: {
pkgs,
...
}: {
imports = [./apps ./containers ./desktop ./scripts ./services ./system ./user];
imports = [
./apps
./containers
./desktop
./scripts
./services
./system
./user
];
}

View file

@ -10,7 +10,6 @@
};
config = lib.mkIf config.alyraffauf.desktop.cinnamon.enable {
# Enable Cinnamon.
services = {
xserver = {
enable = true;

View file

@ -23,24 +23,24 @@
config = lib.mkIf config.alyraffauf.desktop.enable {
environment.sessionVariables.NIXOS_OZONE_WL = "1";
services = {
gnome.gnome-keyring.enable = true;
gvfs.enable = true; # Mount, trash, etc.
# Enable the X11 windowing system.
xserver = {
enable = true;
xkb.layout = "us";
xkb.variant = "altgr-intl";
excludePackages = with pkgs; [xterm];
};
};
# Install pretty fonts.
fonts.packages = with pkgs; [
liberation_ttf
(nerdfonts.override {
fonts = ["DroidSansMono" "Noto"];
})
];
services = {
gnome.gnome-keyring.enable = true;
gvfs.enable = true; # Mount, trash, etc.
xserver = {
enable = true;
xkb = {
layout = "us";
variant = "altgr-intl";
};
excludePackages = with pkgs; [xterm];
};
};
};
}

View file

@ -20,9 +20,7 @@
'';
in {
imports = [
# Include X settings.
./fprintdFix.nix
./tripleBuffering.nix
];
options = {

View file

@ -7,14 +7,15 @@
options = {
alyraffauf.desktop.gnome.fprintdFix.enable =
lib.mkEnableOption
"Fixes fprintd and pam issues with GNOME Display Manager.";
"Fix fprintd and pam issues with GNOME Display Manager.";
};
config = lib.mkIf config.alyraffauf.desktop.gnome.fprintdFix.enable {
# Need to change the order pam loads its modules
# to get proper fingerprint behavior on GDM and the lockscreen.
security.pam.services.login.fprintAuth = false;
security.pam.services.gdm-fingerprint = lib.mkIf (config.services.fprintd.enable) {
security.pam.services = {
login.fprintAuth = false;
gdm-fingerprint = lib.mkIf (config.services.fprintd.enable) {
text = ''
auth required pam_shells.so
auth requisite pam_nologin.so
@ -34,4 +35,5 @@
'';
};
};
};
}

View file

@ -1,30 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
options = {
desktopConfig.desktopEnvironments.gnome.tripleBuffering.enable =
lib.mkEnableOption "Enables dynamic triple buffering for GNOME.";
};
config =
lib.mkIf
config.desktopConfig.desktopEnvironments.gnome.tripleBuffering.enable {
nixpkgs.overlays = [
(final: prev: {
gnome = prev.gnome.overrideScope (gnomeFinal: gnomePrev: {
mutter = gnomePrev.mutter.overrideAttrs (old: {
src = pkgs.fetchgit {
url = "https://gitlab.gnome.org/vanvugt/mutter.git";
# GNOME 45: triple-buffering-v4-45
rev = "0b896518b2028d9c4d6ea44806d093fd33793689";
sha256 = "sha256-mzNy5GPlB2qkI2KEAErJQzO//uo8yO0kPQUwvGDwR4w=";
};
});
});
})
];
};
}

View file

@ -6,24 +6,26 @@
...
}: {
options = {
alyraffauf.desktop.greetd.enable =
alyraffauf.desktop.greetd = {
enable =
lib.mkEnableOption "Enable greetd.";
alyraffauf.desktop.greetd.session = lib.mkOption {
session = lib.mkOption {
description = "Default command to execute on login.";
default = lib.getExe config.programs.hyprland.package;
type = lib.types.str;
};
alyraffauf.desktop.greetd.autologin.enable = lib.mkOption {
autologin.enable = lib.mkOption {
description = "Whether to enable autologin.";
default = false;
type = lib.types.bool;
};
alyraffauf.desktop.greetd.autologin.user = lib.mkOption {
autologin.user = lib.mkOption {
description = "User to autologin.";
default = "aly";
type = lib.types.str;
};
};
};
config = lib.mkIf config.alyraffauf.desktop.greetd.enable {
security.pam.services = {

View file

@ -11,7 +11,7 @@
};
config = lib.mkIf config.alyraffauf.desktop.hyprland.enable {
alyraffauf.desktop.waylandComp.enable = true;
alyraffauf.desktop.waylandComp.enable = lib.mkDefault true;
programs = {
hyprland = {

View file

@ -11,33 +11,42 @@
};
config = lib.mkIf config.alyraffauf.desktop.lightdm.enable {
security.pam.services.lightdm.enableKwallet = true;
security.pam.services.lightdm.enableGnomeKeyring = true;
security.pam.services.lightdm = {
enableGnomeKeyring = true;
enableKwallet = true;
};
services.xserver.displayManager.lightdm = {
enable = true;
greeters.slick = {
enable = true;
theme.name = "Catppuccin-Frappe-Compact-Mauve-Dark";
theme.package = pkgs.catppuccin-gtk.override {
theme = {
name = "Catppuccin-Frappe-Compact-Mauve-Dark";
package = pkgs.catppuccin-gtk.override {
accents = ["mauve"];
size = "compact";
variant = "frappe";
tweaks = ["normal"];
};
};
iconTheme.name = "Papirus-Dark";
iconTheme.package = pkgs.catppuccin-papirus-folders.override {
iconTheme = {
name = "Papirus-Dark";
package = pkgs.catppuccin-papirus-folders.override {
flavor = "frappe";
accent = "mauve";
};
};
font.name = "NotoSans Nerd Font Regular";
font.package = pkgs.nerdfonts.override {fonts = ["Noto"];};
font = {
name = "NotoSans Nerd Font Regular";
package = pkgs.nerdfonts.override {fonts = ["Noto"];};
};
cursorTheme.package = pkgs.catppuccin-cursors.frappeDark;
cursorTheme.name = "Catppuccin-Frappe-Dark-Cursors";
cursorTheme.size = 24;
cursorTheme = {
name = "Catppuccin-Frappe-Dark-Cursors";
size = 24;
};
extraConfig = ''
background=#303446

View file

@ -22,17 +22,6 @@ in {
};
config = lib.mkIf config.alyraffauf.desktop.plasma.enable {
# Enable SDDM + Plasma Desktop.
services = {
desktopManager.plasma6.enable = true;
xserver = {
displayManager.sddm = {
enable = true;
wayland.enable = true;
};
};
};
environment.systemPackages = with pkgs;
[
kdePackages.kate
@ -44,8 +33,15 @@ in {
++ [plasmaCsAdjuster];
programs.kdeconnect.enable = true;
# nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
# nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto";
security.pam.services.sddm.enableGnomeKeyring = true;
services = {
desktopManager.plasma6.enable = true;
xserver = {
displayManager.sddm = {
enable = true;
wayland.enable = true;
};
};
};
};
}

View file

@ -11,7 +11,7 @@
};
config = lib.mkIf config.alyraffauf.desktop.sway.enable {
alyraffauf.desktop.waylandComp.enable = true;
alyraffauf.desktop.waylandComp.enable = lib.mkDefault true;
programs = {
sway = {

View file

@ -11,6 +11,10 @@
};
config = lib.mkIf config.alyraffauf.desktop.waylandComp.enable {
programs = {
gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3;
};
services = {
blueman.enable = lib.mkDefault true;
dbus.packages = [pkgs.gcr];
@ -44,9 +48,5 @@
'';
};
};
programs = {
gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3;
};
};
}

View file

@ -3,8 +3,15 @@
lib,
config,
...
}: let
hoenn = pkgs.writeShellScriptBin "hoenn" ''
}: {
options = {
alyraffauf.scripts.hoenn.enable =
lib.mkEnableOption "Enable hoenn system configuration script";
};
config = lib.mkIf config.alyraffauf.scripts.hoenn.enable {
environment.systemPackages = [
(pkgs.writeShellScriptBin "hoenn" ''
FLAKE=''${2:-"github:alyraffauf/nixcfg"}
HOST=''${HOST:-${config.networking.hostName}}
GIT=https://''${FLAKE//:/\.com\/}.git
@ -23,14 +30,7 @@
cd nixcfg
exit 0;
fi
'';
in {
options = {
alyraffauf.scripts.hoenn.enable =
lib.mkEnableOption "Enable hoenn system configuration script";
};
config = lib.mkIf config.alyraffauf.scripts.hoenn.enable {
environment.systemPackages = with pkgs; [hoenn];
'')
];
};
}

View file

@ -4,5 +4,11 @@
config,
...
}: {
imports = [./binaryCache ./flatpak ./ollama ./syncthing ./tailscale];
imports = [
./binaryCache
./flatpak
./ollama
./syncthing
./tailscale
];
}

View file

@ -10,13 +10,8 @@
};
config = lib.mkIf config.alyraffauf.services.flatpak.enable {
# Needed for Flatpaks
xdg.portal.enable = true;
services.flatpak.enable = true;
fonts.fontDir.enable = true;
environment.systemPackages = with pkgs; [gnome.gnome-software];
# Allow access to system fonts.
system.fsPackages = [pkgs.bindfs];
fileSystems = let
mkRoSymBind = path: {
device = path;
@ -33,6 +28,10 @@
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
};
environment.systemPackages = with pkgs; [gnome.gnome-software];
fonts.fontDir.enable = true;
services.flatpak.enable = true;
system.fsPackages = [pkgs.bindfs];
xdg.portal.enable = true;
};
}

View file

@ -5,18 +5,20 @@
...
}: {
options = {
alyraffauf.services.ollama.enable = lib.mkEnableOption "Enable ollama interface for LLMs.";
alyraffauf.services.ollama.listenAddress = lib.mkOption {
alyraffauf.services.ollama = {
enable = lib.mkEnableOption "Enable ollama interface for LLMs.";
listenAddress = lib.mkOption {
description = "Listen Address for Ollama.";
default = "127.0.0.1:11434";
type = lib.types.str;
};
alyraffauf.services.ollama.gpu = lib.mkOption {
gpu = lib.mkOption {
description = "Type of GPU for enabling GPU acceleration.";
default = null;
type = lib.types.str;
};
};
};
config = lib.mkIf config.alyraffauf.services.ollama.enable {
services.ollama = {

View file

@ -7,19 +7,31 @@
imports = [./syncMusic.nix];
options = {
alyraffauf.services.syncthing.enable = lib.mkEnableOption "Enable Syncthing";
alyraffauf.services.syncthing.user = lib.mkOption {
alyraffauf.services.syncthing = {
enable = lib.mkEnableOption "Enable Syncthing";
user = lib.mkOption {
description = "Specify user Syncthing runs as.";
default = "aly";
type = lib.types.str;
};
syncMusic = lib.mkOption {
description = "Whether to sync music folder.";
default = true;
type = lib.types.bool;
};
musicPath = lib.mkOption {
description = "Whether to sync music folder.";
default = "/home/${config.alyraffauf.services.syncthing.user}/music";
type = lib.types.str;
};
};
};
config = lib.mkIf config.alyraffauf.services.syncthing.enable {
services.syncthing = {
enable = true;
openDefaultPorts = true;
user = "${config.alyraffauf.services.syncthing.user}";
user = config.alyraffauf.services.syncthing.user;
dataDir = "/home/${config.alyraffauf.services.syncthing.user}";
settings = {
options = {
@ -58,8 +70,8 @@
path = "/home/${config.alyraffauf.services.syncthing.user}/pics/camera";
devices = ["brawly" "fallarbor" "lavaridge" "mauville" "petalburg" "rustboro" "wattson" "winona"];
versioning = {
type = "trashcan";
params.cleanoutDays = "15";
type = "trashcan";
};
};
};

View file

@ -4,30 +4,17 @@
config,
...
}: {
options = {
alyraffauf.services.syncthing.syncMusic = lib.mkOption {
description = "Whether to sync music folder.";
default = true;
type = lib.types.bool;
};
alyraffauf.services.syncthing.syncMusicPath = lib.mkOption {
description = "Whether to sync music folder.";
default = "/home/${config.alyraffauf.services.syncthing.user}/music";
type = lib.types.str;
};
};
config = lib.mkIf config.alyraffauf.services.syncthing.syncMusic {
services.syncthing = {
settings = {
folders = {
"music" = {
id = "6nzmu-z9der";
path = config.alyraffauf.services.syncthing.syncMusicPath;
path = config.alyraffauf.services.syncthing.musicPath;
devices = ["lavaridge" "mauville" "petalburg" "rustboro" "wattson"];
versioning = {
type = "trashcan";
params.cleanoutDays = "1";
type = "trashcan";
};
};
};

View file

@ -9,7 +9,6 @@
alyraffauf.system.power-profiles-daemon.enable = lib.mkDefault true;
console = {
useXkbConfig = true;
colors = [
"303446"
"e78284"
@ -29,12 +28,13 @@
"81c8be"
"a5adce"
];
useXkbConfig = true;
};
time.timeZone = "America/New_York";
i18n = {
defaultLocale = "en_US.UTF-8";
defaultLocale = lib.mkDefault "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = config.i18n.defaultLocale;
LC_IDENTIFICATION = config.i18n.defaultLocale;

View file

@ -5,13 +5,15 @@
...
}: {
options = {
alyraffauf.system.zramSwap.enable = lib.mkEnableOption "Enables zram swap.";
alyraffauf.system.zramSwap.size = lib.mkOption {
alyraffauf.system.zramSwap = {
enable = lib.mkEnableOption "Enables zram swap.";
size = lib.mkOption {
description = "Percent size of the zram swap.";
default = 50;
type = lib.types.int;
};
};
};
config = lib.mkIf config.alyraffauf.system.zramSwap.enable {
zramSwap = {

View file

@ -6,20 +6,22 @@
...
}: {
options = {
alyraffauf.user.aly.enable = lib.mkEnableOption "Enables Aly's user.";
alyraffauf.user.aly.password = lib.mkOption {
alyraffauf.user.aly = {
enable = lib.mkEnableOption "Enables Aly's user.";
password = lib.mkOption {
description = "Hashed password for user aly.";
type = lib.types.str;
};
};
};
config = lib.mkIf config.alyraffauf.user.aly.enable {
users.users.aly = {
isNormalUser = true;
description = "Aly Raffauf";
extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"];
linger = true;
hashedPassword = config.alyraffauf.user.aly.password;
isNormalUser = true;
linger = true;
openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
};
};

View file

@ -12,18 +12,18 @@
./dustin
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.extraSpecialArgs = {inherit inputs unstable;};
home-manager.sharedModules = [{imports = [../../homeManagerModules];}];
home-manager.backupFileExtension = "backup";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
users.mutableUsers = false;
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA5xWjZIdMQaQE7vyPP7VRAKNHbrFeh0QtF3bAXni66V aly@lavaridge"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGcJBb7+ZxkDdk06A0csNsbgT9kARUN185M8k3Lq7E/d u0_a336@localhost" # termux on winona
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXlNHLi7aWZ+4/P9TN1wYzFvw5R01GYF/YC1Dl6Z/VJ aly@rustboro"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJBK+QkM3C98BxnJtcEOuxjT7bbUG8gsUafrzW9uKuxz aly@petalburg"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINHdpGTfjmnnau18CowChY4hPn/fzRkgJvXFs+yPy74I aly@mauville"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA5xWjZIdMQaQE7vyPP7VRAKNHbrFeh0QtF3bAXni66V aly@lavaridge"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXlNHLi7aWZ+4/P9TN1wYzFvw5R01GYF/YC1Dl6Z/VJ aly@rustboro"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGcJBb7+ZxkDdk06A0csNsbgT9kARUN185M8k3Lq7E/d u0_a336@localhost" # termux on winona
];
}

View file

@ -6,19 +6,21 @@
...
}: {
options = {
alyraffauf.user.dustin.enable = lib.mkEnableOption "Enables Dustin's user.";
alyraffauf.user.dustin.password = lib.mkOption {
alyraffauf.user.dustin = {
enable = lib.mkEnableOption "Enables Dustin's user.";
password = lib.mkOption {
description = "Hashed password.";
type = lib.types.str;
};
};
};
config = lib.mkIf config.alyraffauf.user.dustin.enable {
users.users.dustin = {
isNormalUser = true;
description = "Dustin Raffauf";
extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"];
hashedPassword = config.alyraffauf.user.dustin.password;
isNormalUser = true;
};
};
}