From 18c8365f40d2d00f96de047c9607a7d6eccf5e0a Mon Sep 17 00:00:00 2001 From: Emmet Date: Thu, 18 Jan 2024 15:36:52 -0600 Subject: [PATCH] Optimized some specialArgs and module argument use --- flake.nix | 114 +++++++++--------- profiles/homelab/configuration.nix | 32 ++--- profiles/homelab/home.nix | 6 +- profiles/personal/configuration.nix | 3 +- profiles/personal/home.nix | 6 +- profiles/work/configuration.nix | 31 ++--- profiles/work/home.nix | 22 ++-- profiles/wsl/configuration.nix | 32 ++--- profiles/wsl/home.nix | 10 +- system/app/docker.nix | 4 +- system/app/flatpak.nix | 2 +- system/app/gamemode.nix | 2 +- system/app/prismlauncher.nix | 2 +- system/app/steam.nix | 2 +- system/app/virtualization.nix | 2 +- system/hardware/bluetooth.nix | 2 +- system/hardware/kernel.nix | 2 +- system/hardware/opengl.nix | 2 +- system/hardware/openrgb.nix | 2 +- system/hardware/power.nix | 2 +- system/hardware/printing.nix | 2 +- system/hardware/systemd.nix | 2 +- system/hardware/time.nix | 2 +- system/security/automount.nix | 2 +- system/security/blocklist.nix | 2 +- system/security/doas.nix | 4 +- system/security/firejail.nix | 2 +- system/security/firewall.nix | 2 +- system/security/gpg.nix | 2 +- system/security/openvpn.nix | 2 +- system/security/sshd.nix | 4 +- system/style/stylix.nix | 22 ++-- system/wm/dbus.nix | 2 +- system/wm/fonts.nix | 2 +- system/wm/gnome-keyring.nix | 2 +- system/wm/hyprland.nix | 2 +- system/wm/pipewire.nix | 2 +- system/wm/wayland.nix | 2 +- system/wm/x11.nix | 2 +- system/wm/xmonad.nix | 2 +- user/app/browser/brave.nix | 2 +- user/app/browser/floorp.nix | 2 +- user/app/browser/librewolf.nix | 10 +- user/app/browser/qute-containers.nix | 2 +- user/app/browser/qutebrowser.nix | 32 ++--- .../dmenu-scripts/networkmanager-dmenu.nix | 2 +- user/app/doom-emacs/doom.nix | 24 ++-- user/app/doom-emacs/doom.org | 24 ++-- user/app/flatpak/flatpak.nix | 2 +- user/app/games/games.nix | 2 +- user/app/git/git.nix | 6 +- user/app/keepass/keepass.nix | 2 +- user/app/ranger/ranger.nix | 2 +- user/app/terminal/alacritty.nix | 2 +- user/app/terminal/kitty.nix | 2 +- user/app/virtualization/virtualization.nix | 2 +- user/bin/phoenix.nix | 12 +- user/bin/ytsub-wrappers.nix | 2 +- user/hardware/bluetooth.nix | 2 +- user/lang/android/android.nix | 2 +- user/lang/cc/cc.nix | 2 +- user/lang/godot/godot.nix | 2 +- user/lang/haskell/haskell.nix | 2 +- user/lang/python/python-packages.nix | 2 +- user/lang/python/python.nix | 2 +- user/lang/rust/rust.nix | 2 +- user/pkgs/blockbench.nix | 4 +- user/pkgs/impressive.nix | 2 +- user/pkgs/rogauracore.nix | 2 +- user/shell/cli-collection.nix | 2 +- user/shell/sh.nix | 2 +- user/style/stylix.nix | 28 ++--- user/wm/hyprland/hyprland.nix | 24 ++-- user/wm/picom/picom.nix | 2 +- user/wm/xmonad/xmonad.nix | 4 +- user/wm/xmonad/xmonad.org | 4 +- 76 files changed, 282 insertions(+), 284 deletions(-) diff --git a/flake.nix b/flake.nix index 0e02137..ae216b3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,39 +1,47 @@ { description = "Flake of LibrePhoenix"; - outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, org-nursery, org-yaap, org-timeblock, phscroll, blocklist-hosts, rust-overlay, hyprland-plugins, ... }@inputs: + outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, + blocklist-hosts, rust-overlay, hyprland-plugins, + eaf, eaf-browser, org-nursery, org-yaap, + org-side-tree, org-timeblock, phscroll, ... }@inputs: let # ---- SYSTEM SETTINGS ---- # - system = "x86_64-linux"; # system arch - hostname = "snowfire"; # hostname - profile = "personal"; # select a profile defined from my profiles directory - timezone = "America/Chicago"; # select timezone - locale = "en_US.UTF-8"; # select locale + systemSettings = { + system = "x86_64-linux"; # system arch + hostname = "snowfire"; # hostname + profile = "personal"; # select a profile defined from my profiles directory + timezone = "America/Chicago"; # select timezone + locale = "en_US.UTF-8"; # select locale + }; # ----- USER SETTINGS ----- # - username = "emmet"; # username - name = "Emmet"; # name/identifier - email = "emmet@librephoenix.com"; # email (used for certain configurations) - dotfilesDir = "~/.dotfiles"; # absolute path of the local repo - theme = "uwunicorn-yt"; # selcted theme from my themes directory (./themes/) - wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/ - wmType = "wayland"; # x11 or wayland - browser = "qutebrowser"; # Default browser; must select one from ./user/app/browser/ - editor = "emacsclient"; # Default editor; - defaultRoamDir = "Personal.p"; # Default org roam directory relative to ~/Org - term = "alacritty"; # Default terminal command; - font = "Intel One Mono"; # Selected font - fontPkg = pkgs.intel-one-mono; # Font package + userSettings = rec { + username = "emmet"; # username + name = "Emmet"; # name/identifier + email = "emmet@librephoenix.com"; # email (used for certain configurations) + dotfilesDir = "~/.dotfiles"; # absolute path of the local repo + theme = "uwunicorn-yt"; # selcted theme from my themes directory (./themes/) + wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/ + # window manager type (hyprland or x11) translator + wmType = if (wm == "hyprland") then "wayland" else "x11"; + browser = "qutebrowser"; # Default browser; must select one from ./user/app/browser/ + defaultRoamDir = "Personal.p"; # Default org roam directory relative to ~/Org + term = "alacritty"; # Default terminal command; + font = "Intel One Mono"; # Selected font + fontPkg = pkgs.intel-one-mono; # Font package + editor = "emacsclient"; # Default editor; + # editor spawning translator + # generates a command that can be used to spawn editor inside a gui + # EDITOR and TERM session variables must be set in home.nix or other module + # I set the session variable SPAWNEDITOR to this in my home.nix for convenience + spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'" + else (if ((editor == "vim") || (editor == "nvim") || (editor == "nano")) then "exec " + term + " -e " + editor else editor); + }; - # editor spawning translator - # generates a command that can be used to spawn editor inside a gui - # EDITOR and TERM session variables must be set in home.nix or other module - # I set the session variable SPAWNEDITOR to this in my home.nix for convenience - spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'" - else (if ((editor == "vim") || (editor == "nvim") || (editor == "nano")) then "exec " + term + " -e " + editor else editor); # create patched nixpkgs - nixpkgs-patched = (import nixpkgs { inherit system; }).applyPatches { + nixpkgs-patched = (import nixpkgs { system = systemSettings.system; }).applyPatches { name = "nixpkgs-patched"; src = nixpkgs; patches = [ @@ -44,7 +52,7 @@ # configure pkgs pkgs = import nixpkgs-patched { - inherit system; + system = systemSettings.system; config = { allowUnfree = true; allowUnfreePredicate = (_: true); }; overlays = [ rust-overlay.overlays.default ]; @@ -57,30 +65,14 @@ homeConfigurations = { user = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = [ (./. + "/profiles"+("/"+profile)+"/home.nix") # load home.nix from selected PROFILE + modules = [ (./. + "/profiles"+("/"+systemSettings.profile)+"/home.nix") # load home.nix from selected PROFILE # inputs.nix-flatpak.homeManagerModules.nix-flatpak # Declarative flatpaks ]; extraSpecialArgs = { # pass config variables from above - inherit username; - inherit name; - inherit hostname; - inherit profile; - inherit email; - inherit dotfilesDir; - inherit defaultRoamDir; - inherit theme; - inherit font; - inherit fontPkg; - inherit wm; - inherit wmType; - inherit browser; - inherit editor; - inherit term; - inherit spawnEditor; + inherit systemSettings; + inherit userSettings; inherit (inputs) nix-doom-emacs; - #inherit (inputs) nix-flatpak; - inherit (inputs) stylix; inherit (inputs) eaf; inherit (inputs) eaf-browser; inherit (inputs) org-nursery; @@ -88,25 +80,20 @@ inherit (inputs) org-side-tree; inherit (inputs) org-timeblock; inherit (inputs) phscroll; + #inherit (inputs) nix-flatpak; + inherit (inputs) stylix; inherit (inputs) hyprland-plugins; }; }; }; nixosConfigurations = { system = lib.nixosSystem { - inherit system; - modules = [ (./. + "/profiles"+("/"+profile)+"/configuration.nix") ]; # load configuration.nix from selected PROFILE + system = systemSettings.system; + modules = [ (./. + "/profiles"+("/"+systemSettings.profile)+"/configuration.nix") ]; # load configuration.nix from selected PROFILE specialArgs = { # pass config variables from above - inherit username; - inherit name; - inherit hostname; - inherit timezone; - inherit locale; - inherit theme; - inherit font; - inherit fontPkg; - inherit wm; + inherit systemSettings; + inherit userSettings; inherit (inputs) stylix; inherit (inputs) blocklist-hosts; }; @@ -116,12 +103,11 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager/master"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nix-doom-emacs.url = "github:librephoenix/nix-doom-emacs?ref=pgtk-patch"; - stylix.url = "github:danth/stylix"; - rust-overlay.url = "github:oxalica/rust-overlay"; - #nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.2.0"; eaf = { url = "github:emacs-eaf/emacs-application-framework"; flake = false; @@ -150,10 +136,18 @@ url = "github:misohena/phscroll"; flake = false; }; + + stylix.url = "github:danth/stylix"; + + rust-overlay.url = "github:oxalica/rust-overlay"; + + #nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.2.0"; + blocklist-hosts = { url = "github:StevenBlack/hosts"; flake = false; }; + hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; flake = false; diff --git a/profiles/homelab/configuration.nix b/profiles/homelab/configuration.nix index a10a9a2..ae284a3 100644 --- a/profiles/homelab/configuration.nix +++ b/profiles/homelab/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, blocklist-hosts, username, hostname, timezone, locale, ... }: +{ lib, pkgs, systemSettings, userSettings, ... }: { imports = @@ -7,7 +7,7 @@ ../../system/security/doas.nix ../../system/security/gpg.nix ../../system/security/sshd.nix - ( import ../../system/app/docker.nix {storageDriver = "btrfs"; inherit username pkgs config lib;} ) + ( import ../../system/app/docker.nix {storageDriver = "btrfs"; inherit userSettings pkgs lib;} ) ]; # Fix nix path @@ -34,28 +34,28 @@ boot.loader.efi.efiSysMountPoint = "/boot/efi"; # Networking - networking.hostName = hostname; # Define your hostname. + networking.hostName = systemSettings.hostname; # Define your hostname. networking.networkmanager.enable = true; # Use networkmanager # Timezone and locale - time.timeZone = timezone; # time zone - i18n.defaultLocale = locale; + time.timeZone = systemSettings.timezone; # time zone + i18n.defaultLocale = systemSettings.locale; i18n.extraLocaleSettings = { - LC_ADDRESS = locale; - LC_IDENTIFICATION = locale; - LC_MEASUREMENT = locale; - LC_MONETARY = locale; - LC_NAME = locale; - LC_NUMERIC = locale; - LC_PAPER = locale; - LC_TELEPHONE = locale; - LC_TIME = locale; + LC_ADDRESS = systemSettings.locale; + LC_IDENTIFICATION = systemSettings.locale; + LC_MEASUREMENT = systemSettings.locale; + LC_MONETARY = systemSettings.locale; + LC_NAME = systemSettings.locale; + LC_NUMERIC = systemSettings.locale; + LC_PAPER = systemSettings.locale; + LC_TELEPHONE = systemSettings.locale; + LC_TIME = systemSettings.locale; }; # User account - users.users.${username} = { + users.users.${userSettings.username} = { isNormalUser = true; - description = "Emmet"; + description = userSettings.name; extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; []; uid = 1000; diff --git a/profiles/homelab/home.nix b/profiles/homelab/home.nix index 8968714..723c102 100644 --- a/profiles/homelab/home.nix +++ b/profiles/homelab/home.nix @@ -1,10 +1,10 @@ -{ config, lib, pkgs, username, email, dotfilesDir, ... }: +{ pkgs, userSettings, ... }: { # Home Manager needs a bit of information about you and the paths it should # manage. - home.username = username; - home.homeDirectory = "/home/"+username; + home.username = userSettings.username; + home.homeDirectory = "/home/"+userSettings.username; programs.home-manager.enable = true; diff --git a/profiles/personal/configuration.nix b/profiles/personal/configuration.nix index 60314fa..cebf953 100644 --- a/profiles/personal/configuration.nix +++ b/profiles/personal/configuration.nix @@ -2,13 +2,12 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, lib, pkgs, blocklist-hosts, username, name, hostname, timezone, locale, wm, theme, ... }: +{ ... }: { imports = [ ../work/configuration.nix # Personal is essentially work system + games ../../system/hardware-configuration.nix #../../system/hardware/openrgb.nix - ( import ../../system/app/docker.nix {storageDriver = "btrfs"; inherit username pkgs config lib;} ) ../../system/app/gamemode.nix ../../system/app/steam.nix ../../system/app/prismlauncher.nix diff --git a/profiles/personal/home.nix b/profiles/personal/home.nix index 7c39e21..51e6868 100644 --- a/profiles/personal/home.nix +++ b/profiles/personal/home.nix @@ -1,10 +1,10 @@ -{ config, lib, pkgs, nix-doom-emacs, stylix, username, email, dotfilesDir, theme, wm, browser, editor, spawnEditor, term, ... }: +{ config, pkgs, userSettings, ... }: { # Home Manager needs a bit of information about you and the paths it should # manage. - home.username = username; - home.homeDirectory = "/home/"+username; + home.username = userSettings.username; + home.homeDirectory = "/home/"+userSettings.username; programs.home-manager.enable = true; diff --git a/profiles/work/configuration.nix b/profiles/work/configuration.nix index 376ef73..4a7329a 100644 --- a/profiles/work/configuration.nix +++ b/profiles/work/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, lib, pkgs, blocklist-hosts, username, name, hostname, timezone, locale, wm, theme, ... }: +{ pkgs, lib, systemSettings, userSettings, ... }: { imports = [ ../../system/hardware-configuration.nix @@ -16,6 +16,7 @@ (./. + "../../../system/wm"+("/"+wm)+".nix") # My window manager ../../system/app/flatpak.nix ../../system/app/virtualization.nix + ( import ../../system/app/docker.nix {storageDriver = "btrfs"; inherit userSettings lib;} ) ../../system/security/doas.nix ../../system/security/gpg.nix ../../system/security/blocklist.nix @@ -50,28 +51,28 @@ boot.loader.efi.efiSysMountPoint = "/boot/efi"; # Networking - networking.hostName = hostname; # Define your hostname. + networking.hostName = systemSettings.hostname; # Define your hostname. networking.networkmanager.enable = true; # Use networkmanager # Timezone and locale - time.timeZone = timezone; # time zone - i18n.defaultLocale = locale; + time.timeZone = systemSettings.timezone; # time zone + i18n.defaultLocale = systemSettings.locale; i18n.extraLocaleSettings = { - LC_ADDRESS = locale; - LC_IDENTIFICATION = locale; - LC_MEASUREMENT = locale; - LC_MONETARY = locale; - LC_NAME = locale; - LC_NUMERIC = locale; - LC_PAPER = locale; - LC_TELEPHONE = locale; - LC_TIME = locale; + LC_ADDRESS = systemSettings.locale; + LC_IDENTIFICATION = systemSettings.locale; + LC_MEASUREMENT = systemSettings.locale; + LC_MONETARY = systemSettings.locale; + LC_NAME = systemSettings.locale; + LC_NUMERIC = systemSettings.locale; + LC_PAPER = systemSettings.locale; + LC_TELEPHONE = systemSettings.locale; + LC_TIME = systemSettings.locale; }; # User account - users.users.${username} = { + users.users.${userSettings.username} = { isNormalUser = true; - description = name; + description = userSettings.name; extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; []; uid = 1000; diff --git a/profiles/work/home.nix b/profiles/work/home.nix index f1bae41..d693db6 100644 --- a/profiles/work/home.nix +++ b/profiles/work/home.nix @@ -1,17 +1,17 @@ -{ config, lib, pkgs, stdenv, fetchurl, nix-doom-emacs, stylix, username, email, dotfilesDir, theme, wm, browser, editor, spawnEditor, term, ... }: +{ config, pkgs, nix-doom-emacs, stylix, userSettings, ... }: { # Home Manager needs a bit of information about you and the paths it should # manage. - home.username = username; - home.homeDirectory = "/home/"+username; + home.username = userSettings.username; + home.homeDirectory = "/home/"+userSettings.username; programs.home-manager.enable = true; imports = [ - nix-doom-emacs.hmModule + (if ((userSettings.editor == "emacs") || (userSettings.editor == "emacsclient")) then nix-doom-emacs.hmModule else null) stylix.homeManagerModules.stylix - (./. + "../../../user/wm"+("/"+wm+"/"+wm)+".nix") # My window manager selected from flake + (./. + "../../../user/wm"+("/"+userSettings.wm+"/"+userSettings.wm)+".nix") # My window manager selected from flake ../../user/shell/sh.nix # My zsh and bash config ../../user/shell/cli-collection.nix # Useful CLI apps ../../user/bin/phoenix.nix # My nix command wrapper @@ -19,13 +19,13 @@ ../../user/app/ranger/ranger.nix # My ranger file manager config ../../user/app/git/git.nix # My git config ../../user/app/keepass/keepass.nix # My password manager - (./. + "../../../user/app/browser"+("/"+browser)+".nix") # My default browser selected from flake + (./. + "../../../user/app/browser"+("/"+userSettings.browser)+".nix") # My default browser selected from flake ../../user/app/virtualization/virtualization.nix # Virtual machines ../../user/app/flatpak/flatpak.nix # Flatpaks ../../user/style/stylix.nix # Styling and themes for my apps ../../user/lang/cc/cc.nix # C and C++ tools ../../user/lang/godot/godot.nix # Game development - ../../user/pkgs/blockbench.nix # Blockbench + #../../user/pkgs/blockbench.nix # Blockbench ## marked as insecure ../../user/hardware/bluetooth.nix # Bluetooth ]; @@ -146,10 +146,10 @@ }; home.sessionVariables = { - EDITOR = editor; - SPAWNEDITOR = spawnEditor; - TERM = term; - BROWSER = browser; + EDITOR = userSettings.editor; + SPAWNEDITOR = userSettings.spawnEditor; + TERM = userSettings.term; + BROWSER = userSettings.browser; }; } diff --git a/profiles/wsl/configuration.nix b/profiles/wsl/configuration.nix index a514a2f..9d83988 100644 --- a/profiles/wsl/configuration.nix +++ b/profiles/wsl/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, lib, pkgs, blocklist-hosts, username, name, hostname, timezone, locale, wm, theme, ... }: +{ lib, pkgs, systemSettings, userSettings, ... }: with lib; let @@ -28,7 +28,7 @@ in wsl = { enable = true; automountPath = "/mnt"; - defaultUser = username; + defaultUser = userSettings.username; startMenuLaunchers = true; # Enable native Docker support @@ -61,27 +61,27 @@ in boot.kernelModules = [ "i2c-dev" "i2c-piix4" "cpufreq_powersave" ]; # Networking - networking.hostName = hostname; # Define your hostname. + networking.hostName = systemSettings.hostname; # Define your hostname. # Timezone and locale - time.timeZone = timezone; # time zone - i18n.defaultLocale = locale; + time.timeZone = systemSettings.timezone; # time zone + i18n.defaultLocale = systemSettings.locale; i18n.extraLocaleSettings = { - LC_ADDRESS = locale; - LC_IDENTIFICATION = locale; - LC_MEASUREMENT = locale; - LC_MONETARY = locale; - LC_NAME = locale; - LC_NUMERIC = locale; - LC_PAPER = locale; - LC_TELEPHONE = locale; - LC_TIME = locale; + LC_ADDRESS = systemSettings.locale; + LC_IDENTIFICATION = systemSettings.locale; + LC_MEASUREMENT = systemSettings.locale; + LC_MONETARY = systemSettings.locale; + LC_NAME = systemSettings.locale; + LC_NUMERIC = systemSettings.locale; + LC_PAPER = systemSettings.locale; + LC_TELEPHONE = systemSettings.locale; + LC_TIME = systemSettings.locale; }; # User account - users.users.${username} = { + users.users.${userSettings.username} = { isNormalUser = true; - description = name; + description = userSettings.name; extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; []; uid = 1000; diff --git a/profiles/wsl/home.nix b/profiles/wsl/home.nix index 35815be..16c5048 100644 --- a/profiles/wsl/home.nix +++ b/profiles/wsl/home.nix @@ -1,15 +1,15 @@ -{ config, lib, pkgs, stdenv, fetchurl, nix-doom-emacs, stylix, username, email, dotfilesDir, theme, wm, editor, ... }: +{ config, pkgs, nix-doom-emacs, stylix, userSettings, ... }: { # Home Manager needs a bit of information about you and the paths it should # manage. - home.username = username; - home.homeDirectory = "/home/"+username; + home.username = userSettings.username; + home.homeDirectory = "/home/"+userSettings.username; programs.home-manager.enable = true; imports = [ - nix-doom-emacs.hmModule + (if ((userSettings.editor == "emacs") || (userSettings.editor == "emacsclient")) then nix-doom-emacs.hmModule else null) stylix.homeManagerModules.stylix ../../user/shell/sh.nix # My zsh and bash config ../../user/shell/cli-collection.nix # Useful CLI apps @@ -63,7 +63,7 @@ xdg.mimeApps.enable = true; home.sessionVariables = { - EDITOR = editor; + EDITOR = userSettings.editor; }; } diff --git a/system/app/docker.nix b/system/app/docker.nix index 47d4221..fa652cc 100644 --- a/system/app/docker.nix +++ b/system/app/docker.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, username, storageDriver ? null, ... }: +{ lib, userSettings, storageDriver ? null, ... }: assert lib.asserts.assertOneOf "storageDriver" storageDriver [ null @@ -17,5 +17,5 @@ assert lib.asserts.assertOneOf "storageDriver" storageDriver [ storageDriver = storageDriver; autoPrune.enable = true; }; - users.users.${username}.extraGroups = [ "docker" ]; + users.users.${userSettings.username}.extraGroups = [ "docker" ]; } diff --git a/system/app/flatpak.nix b/system/app/flatpak.nix index 51d62bd..b674d62 100644 --- a/system/app/flatpak.nix +++ b/system/app/flatpak.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { # Need some flatpaks diff --git a/system/app/gamemode.nix b/system/app/gamemode.nix index c1f4939..934211e 100644 --- a/system/app/gamemode.nix +++ b/system/app/gamemode.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { # Feral GameMode diff --git a/system/app/prismlauncher.nix b/system/app/prismlauncher.nix index 0709ae1..f6932a6 100644 --- a/system/app/prismlauncher.nix +++ b/system/app/prismlauncher.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { environment.systemPackages = [ pkgs.prismlauncher ]; diff --git a/system/app/steam.nix b/system/app/steam.nix index 1226729..8162a71 100644 --- a/system/app/steam.nix +++ b/system/app/steam.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { hardware.opengl.driSupport32Bit = true; diff --git a/system/app/virtualization.nix b/system/app/virtualization.nix index 1135888..2058838 100644 --- a/system/app/virtualization.nix +++ b/system/app/virtualization.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, pkgs, ... }: { environment.systemPackages = with pkgs; [ virt-manager virtualbox distrobox ]; diff --git a/system/hardware/bluetooth.nix b/system/hardware/bluetooth.nix index b823396..82cc112 100644 --- a/system/hardware/bluetooth.nix +++ b/system/hardware/bluetooth.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { # Bluetooth diff --git a/system/hardware/kernel.nix b/system/hardware/kernel.nix index 6927ec3..3bfd156 100644 --- a/system/hardware/kernel.nix +++ b/system/hardware/kernel.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ ... }: { boot.kernelPackages = pkgs.linuxPackages_zen; diff --git a/system/hardware/opengl.nix b/system/hardware/opengl.nix index 2a03da1..2d48cba 100644 --- a/system/hardware/opengl.nix +++ b/system/hardware/opengl.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { # OpenGL diff --git a/system/hardware/openrgb.nix b/system/hardware/openrgb.nix index 6f06af7..81066f5 100644 --- a/system/hardware/openrgb.nix +++ b/system/hardware/openrgb.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { environment.systemPackages = [ pkgs.openrgb-with-all-plugins ]; diff --git a/system/hardware/power.nix b/system/hardware/power.nix index cc59a4b..eef4d28 100644 --- a/system/hardware/power.nix +++ b/system/hardware/power.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { #services.auto-cpufreq.enable = true; diff --git a/system/hardware/printing.nix b/system/hardware/printing.nix index 985f27e..8adce81 100644 --- a/system/hardware/printing.nix +++ b/system/hardware/printing.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { # Enable printing diff --git a/system/hardware/systemd.nix b/system/hardware/systemd.nix index 70bda51..e05058c 100644 --- a/system/hardware/systemd.nix +++ b/system/hardware/systemd.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { services.journald.extraConfig = "SystemMaxUse=50M\nSystemMaxFiles=5"; diff --git a/system/hardware/time.nix b/system/hardware/time.nix index f647855..5e79a60 100644 --- a/system/hardware/time.nix +++ b/system/hardware/time.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ ... }: { services.timesyncd.enable = true; diff --git a/system/security/automount.nix b/system/security/automount.nix index 25fcbc4..fdc5da0 100644 --- a/system/security/automount.nix +++ b/system/security/automount.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ ... }: { services.devmon.enable = true; diff --git a/system/security/blocklist.nix b/system/security/blocklist.nix index 0ef1b93..c7d2792 100644 --- a/system/security/blocklist.nix +++ b/system/security/blocklist.nix @@ -1,4 +1,4 @@ -{ config, blocklist-hosts, pkgs, ... }: +{ blocklist-hosts, ... }: let blocklist = builtins.readFile "${blocklist-hosts}/alternates/gambling-porn/hosts"; in diff --git a/system/security/doas.nix b/system/security/doas.nix index a402113..6dfadec 100644 --- a/system/security/doas.nix +++ b/system/security/doas.nix @@ -1,11 +1,11 @@ -{ config, username, pkgs, ... }: +{ userSettings, pkgs, ... }: { # Doas instead of sudo security.doas.enable = true; security.sudo.enable = false; security.doas.extraRules = [{ - users = [ "${username}" ]; + users = [ "${userSettings.username}" ]; keepEnv = true; persist = true; }]; diff --git a/system/security/firejail.nix b/system/security/firejail.nix index 382a346..6cf8caa 100644 --- a/system/security/firejail.nix +++ b/system/security/firejail.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { environment.systemPackages = with pkgs; [ firejail ]; diff --git a/system/security/firewall.nix b/system/security/firewall.nix index 84b4b6c..60d339a 100644 --- a/system/security/firewall.nix +++ b/system/security/firewall.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { # Firewall diff --git a/system/security/gpg.nix b/system/security/gpg.nix index e3de8fb..df99f96 100644 --- a/system/security/gpg.nix +++ b/system/security/gpg.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { # Some programs need SUID wrappers, can be configured further or are diff --git a/system/security/openvpn.nix b/system/security/openvpn.nix index 232a3bd..b1fe8c0 100644 --- a/system/security/openvpn.nix +++ b/system/security/openvpn.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { environment.systemPackages = [ pkgs.openvpn ]; diff --git a/system/security/sshd.nix b/system/security/sshd.nix index e17b00d..a753e05 100644 --- a/system/security/sshd.nix +++ b/system/security/sshd.nix @@ -1,4 +1,4 @@ -{ config, pkgs, username, ... }: +{ userSettings, ... }: { # Enable incoming ssh @@ -10,7 +10,7 @@ PermitRootLogin = "no"; }; }; - users.users.${username}.openssh.authorizedKeys.keys = [ + users.users.${userSettings.username}.openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDaeejVJwUVrIZSo1isbu+gkQ7+8ftCgCsczy3OclkEVWHyRTqlG6yp74hr3j8ZNsOhov7c2Q6RqC8oy669hlxi/y9BsvtlI7sBr94oAKFOmkCS4RiK72ngJjBvI0vbk89wQQjmAd3r8B7ZcedpNOC8CkHu8SebKdYPRIUvAbPc3fTEt7DsJkazAepZCB8LEhUp57FAqQ/Ezlt3X/1uwNq5S0EbE9Zm+nUpEfSqR9apY2neKWLyGiCxpK3dzyNOuulCxvtVz+ie2sTk/6SxM+qWEoVVxhdwyxPihEjgC0EvtG0S5mVh5JmcjRkJOzzBHJuw+6r8yWn/AxGdIsoJ4rKNxH1XH1iLHgCraOLOUjUNlmejTcQPu6o92a79fdz2gCHT/BuIjfCW7MErAC3YSmF45TSur/kiWCBaTqYo06pgbQ3w1vKg7fievQlQzsutmg47RvJp6fb74yxuOdVg39cShQu/l8r6zqm21JAeUaaIp4P/0MrAIMOOVUhbK0QgsNElO4yn0ZKH8wGIF8xORh7ikxUIAyq8C41gjJiO2sAFJc3M8DhduQU3X0lHB7U0Qyu+8ZXn05+zdFPXJ73LKc7DCcLkppRXJsdHLSDEFdWqFnV7o08B4qZkPMT4pmvhwhY0Pf1fwavOqxuTstzw18gUGyQzl0foQi0Qrmdazsp2Qw== emmet@snowfire" ]; } diff --git a/system/style/stylix.nix b/system/style/stylix.nix index 3ba2a57..d8fe483 100644 --- a/system/style/stylix.nix +++ b/system/style/stylix.nix @@ -1,11 +1,11 @@ -{ config, lib, pkgs, stylix, theme, font, fontPkg, ... }: +{ lib, pkgs, stylix, userSettings, ... }: let - themePath = "../../../themes/"+theme+"/"+theme+".yaml"; - themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../themes"+("/"+theme)+"/polarity.txt")); + themePath = "../../../themes/"+userSettings.theme+"/"+userSettings.theme+".yaml"; + themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); myLightDMTheme = if themePolarity == "light" then "Adwaita" else "Adwaita-dark"; - backgroundUrl = builtins.readFile (./. + "../../../themes"+("/"+theme)+"/backgroundurl.txt"); - backgroundSha256 = builtins.readFile (./. + "../../../themes/"+("/"+theme)+"/backgroundsha256.txt"); + backgroundUrl = builtins.readFile (./. + "../../../themes"+("/"+userSettings.theme)+"/backgroundurl.txt"); + backgroundSha256 = builtins.readFile (./. + "../../../themes/"+("/"+userSettings.theme)+"/backgroundsha256.txt"); in { imports = [ stylix.nixosModules.stylix ]; @@ -19,16 +19,16 @@ in stylix.base16Scheme = ./. + themePath; stylix.fonts = { monospace = { - name = font; - package = fontPkg; + name = userSettings.font; + package = userSettings.fontPkg; }; serif = { - name = font; - package = fontPkg; + name = userSettings.font; + package = userSettings.fontPkg; }; sansSerif = { - name = font; - package = fontPkg; + name = userSettings.font; + package = userSettings.fontPkg; }; emoji = { name = "Noto Color Emoji"; diff --git a/system/wm/dbus.nix b/system/wm/dbus.nix index ede1bb2..c034326 100644 --- a/system/wm/dbus.nix +++ b/system/wm/dbus.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { services.dbus = { diff --git a/system/wm/fonts.nix b/system/wm/fonts.nix index 7bffd6e..a7cd969 100644 --- a/system/wm/fonts.nix +++ b/system/wm/fonts.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { # Fonts are nice to have diff --git a/system/wm/gnome-keyring.nix b/system/wm/gnome-keyring.nix index 7990550..19fe9c4 100644 --- a/system/wm/gnome-keyring.nix +++ b/system/wm/gnome-keyring.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { services.gnome = { diff --git a/system/wm/hyprland.nix b/system/wm/hyprland.nix index 11c51ed..f2e3b79 100644 --- a/system/wm/hyprland.nix +++ b/system/wm/hyprland.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { # Import wayland config diff --git a/system/wm/pipewire.nix b/system/wm/pipewire.nix index 97756c0..2c14a10 100644 --- a/system/wm/pipewire.nix +++ b/system/wm/pipewire.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { # Pipewire diff --git a/system/wm/wayland.nix b/system/wm/wayland.nix index a339432..44f345b 100644 --- a/system/wm/wayland.nix +++ b/system/wm/wayland.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { imports = [ ./pipewire.nix diff --git a/system/wm/x11.nix b/system/wm/x11.nix index 7c2a445..993c399 100644 --- a/system/wm/x11.nix +++ b/system/wm/x11.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { imports = [ ./pipewire.nix diff --git a/system/wm/xmonad.nix b/system/wm/xmonad.nix index e4ea2b3..e820f92 100644 --- a/system/wm/xmonad.nix +++ b/system/wm/xmonad.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { # import X11 config diff --git a/user/app/browser/brave.nix b/user/app/browser/brave.nix index e420782..b26853f 100644 --- a/user/app/browser/brave.nix +++ b/user/app/browser/brave.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { # Module installing brave as default browser diff --git a/user/app/browser/floorp.nix b/user/app/browser/floorp.nix index 9090b4d..c7fe445 100644 --- a/user/app/browser/floorp.nix +++ b/user/app/browser/floorp.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, wmType, font, ... }: +{ pkgs, ... }: { # Module installing as default browser diff --git a/user/app/browser/librewolf.nix b/user/app/browser/librewolf.nix index f62890c..b8f0c5f 100644 --- a/user/app/browser/librewolf.nix +++ b/user/app/browser/librewolf.nix @@ -1,17 +1,17 @@ -{ config, lib, pkgs, wmType, font, ... }: +{ pkgs, userSettings, ... }: { # Module installing librewolf as default browser - home.packages = if (wmType == "wayland") then [ pkgs.librewolf-wayland ] + home.packages = if (userSettings.wmType == "wayland") then [ pkgs.librewolf-wayland ] else [ pkgs.librewolf ]; - home.sessionVariables = if (wmType == "wayland") + home.sessionVariables = if (userSettings.wmType == "wayland") then { DEFAULT_BROWSER = "${pkgs.librewolf-wayland}/bin/librewolf";} else { DEFAULT_BROWSER = "${pkgs.librewolf}/bin/librewolf";}; home.file.".librewolf/librewolf.overrides.cfg".text = '' - defaultPref("font.name.serif.x-western","''+font+''"); + defaultPref("font.name.serif.x-western","''+userSettings.font+''"); defaultPref("font.size.variable.x-western",20); defaultPref("browser.toolbars.bookmarks.visibility","always"); @@ -22,7 +22,7 @@ defaultPref("privacy.clearOnShutdown.cookies",true); defaultPref("gfx.webrender.software.opengl",false); defaultPref("webgl.disabled",true); - pref("font.name.serif.x-western","''+font+''"); + pref("font.name.serif.x-western","''+userSettings.font+''"); pref("font.size.variable.x-western",20); pref("browser.toolbars.bookmarks.visibility","always"); diff --git a/user/app/browser/qute-containers.nix b/user/app/browser/qute-containers.nix index 526a1c6..990194a 100644 --- a/user/app/browser/qute-containers.nix +++ b/user/app/browser/qute-containers.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, pkgs, dmenuCmd ? "rofi -dmenu", ... }: +{ lib, stdenv, fetchFromGitHub, dmenuCmd ? "rofi -dmenu", ... }: let name = "qute-containers"; version = "unstable"; diff --git a/user/app/browser/qutebrowser.nix b/user/app/browser/qutebrowser.nix index 395e0e9..7704840 100644 --- a/user/app/browser/qutebrowser.nix +++ b/user/app/browser/qutebrowser.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, font, qute-containers, ... }: +{ config, pkgs, userSettings, ... }: { @@ -194,7 +194,7 @@ c.colors.tabs.selected.even.fg = base05 c.colors.tabs.selected.even.bg = base02 c.colors.webpage.bg = base00 -font = "''+font+''" +font = "''+userSettings.font+''" c.fonts.default_family = font c.fonts.default_size = '14pt' @@ -222,7 +222,7 @@ c.fonts.web.family.cursive = font } /*paragraphs*/ p { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:24px; text-align:center; @@ -255,7 +255,7 @@ c.fonts.web.family.cursive = font /*xmp tag style for ascii art*/ xmp { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:22px; color: #''+config.lib.stylix.colors.base01+'' @@ -340,7 +340,7 @@ Bard } /*paragraphs*/ p { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:24px; text-align:center; @@ -373,7 +373,7 @@ Bard /*xmp tag style for ascii art*/ xmp { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:22px; color: #''+config.lib.stylix.colors.base01+'' @@ -447,7 +447,7 @@ Bard } /*paragraphs*/ p { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:24px; text-align:center; @@ -480,7 +480,7 @@ Bard /*xmp tag style for ascii art*/ xmp { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:22px; color: #''+config.lib.stylix.colors.base01+'' @@ -554,7 +554,7 @@ Bard } /*paragraphs*/ p { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:24px; text-align:center; @@ -587,7 +587,7 @@ Bard /*xmp tag style for ascii art*/ xmp { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:22px; color: #''+config.lib.stylix.colors.base01+'' @@ -661,7 +661,7 @@ Bard } /*paragraphs*/ p { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:24px; text-align:center; @@ -694,7 +694,7 @@ Bard /*xmp tag style for ascii art*/ xmp { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:22px; color: #''+config.lib.stylix.colors.base01+'' @@ -768,7 +768,7 @@ Bard } /*paragraphs*/ p { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:24px; text-align:center; @@ -801,7 +801,7 @@ Bard /*xmp tag style for ascii art*/ xmp { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:22px; color: #''+config.lib.stylix.colors.base01+'' @@ -875,7 +875,7 @@ Bard } /*paragraphs*/ p { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:24px; text-align:center; @@ -908,7 +908,7 @@ Bard /*xmp tag style for ascii art*/ xmp { - font-family:''+font+''; + font-family:''+userSettings.font+''; font-size:22px; color: #''+config.lib.stylix.colors.base01+'' diff --git a/user/app/dmenu-scripts/networkmanager-dmenu.nix b/user/app/dmenu-scripts/networkmanager-dmenu.nix index f78a27c..a6b38b9 100644 --- a/user/app/dmenu-scripts/networkmanager-dmenu.nix +++ b/user/app/dmenu-scripts/networkmanager-dmenu.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, dmenu_command ? "rofi -show dmenu", ... }: +{ pkgs, dmenu_command ? "rofi -show dmenu", ... }: { home.packages = with pkgs; [ networkmanager_dmenu networkmanagerapplet ]; diff --git a/user/app/doom-emacs/doom.nix b/user/app/doom-emacs/doom.nix index 81c30b7..2015433 100644 --- a/user/app/doom-emacs/doom.nix +++ b/user/app/doom-emacs/doom.nix @@ -1,6 +1,8 @@ -{ config, lib, pkgs, eaf, eaf-browser, org-nursery, phscroll, org-yaap, org-side-tree, org-timeblock, theme, font, name, username, email, dotfilesDir, profile, wmType, defaultRoamDir, ... }: +{ config, lib, pkgs, userSettings, systemSettings, + eaf, eaf-browser, org-nursery, org-yaap, + org-side-tree, org-timeblock, phscroll, ... }: let - themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+theme)+"/polarity.txt")); + themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; in { @@ -139,14 +141,14 @@ in ;; Import relevant variables from flake into emacs - (setq user-full-name "''+name+''") ; name - (setq user-username "''+username+''") ; username - (setq user-mail-address "''+email+''") ; email - (setq user-home-directory "/home/''+username+''") ; absolute path to home directory as string - (setq user-default-roam-dir "''+defaultRoamDir+''") ; absolute path to home directory as string - (setq system-nix-profile "''+profile+''") ; what profile am I using? - (setq system-wm-type "''+wmType+''") ; wayland or x11? - (setq doom-font (font-spec :family "''+font+''" :size 20)) ; import font - (setq dotfiles-dir "''+dotfilesDir+''") ; import location of dotfiles directory + (setq user-full-name "''+userSettings.name+''") ; name + (setq user-username "''+userSettings.username+''") ; username + (setq user-mail-address "''+userSettings.email+''") ; email + (setq user-home-directory "/home/''+userSettings.username+''") ; absolute path to home directory as string + (setq user-default-roam-dir "''+userSettings.defaultRoamDir+''") ; absolute path to home directory as string + (setq system-nix-profile "''+systemSettings.profile+''") ; what profile am I using? + (setq system-wm-type "''+userSettings.wmType+''") ; wayland or x11? + (setq doom-font (font-spec :family "''+userSettings.font+''" :size 20)) ; import font + (setq dotfiles-dir "''+userSettings.dotfilesDir+''") ; import location of dotfiles directory ''; } diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index 959938e..db8bd31 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -1982,9 +1982,11 @@ Any git package can be configured for a particular commit or branch: * Nix Integration In order to have Nix load my Doom Emacs configuration [[./doom.nix][doom.nix]], which I source in the =imports= block of my [[../../../profiles/work/home.nix][home.nix]]. #+BEGIN_SRC nix :tangle doom.nix -{ config, lib, pkgs, eaf, eaf-browser, org-nursery, phscroll, org-yaap, org-side-tree, org-timeblock, theme, font, name, username, email, dotfilesDir, profile, wmType, defaultRoamDir, ... }: +{ config, lib, pkgs, userSettings, systemSettings, + eaf, eaf-browser, org-nursery, org-yaap, + org-side-tree, org-timeblock, phscroll, ... }: let - themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+theme)+"/polarity.txt")); + themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); dashboardLogo = ./. + "/nix-" + themePolarity + ".png"; in { @@ -2123,15 +2125,15 @@ in ;; Import relevant variables from flake into emacs - (setq user-full-name "''+name+''") ; name - (setq user-username "''+username+''") ; username - (setq user-mail-address "''+email+''") ; email - (setq user-home-directory "/home/''+username+''") ; absolute path to home directory as string - (setq user-default-roam-dir "''+defaultRoamDir+''") ; absolute path to home directory as string - (setq system-nix-profile "''+profile+''") ; what profile am I using? - (setq system-wm-type "''+wmType+''") ; wayland or x11? - (setq doom-font (font-spec :family "''+font+''" :size 20)) ; import font - (setq dotfiles-dir "''+dotfilesDir+''") ; import location of dotfiles directory + (setq user-full-name "''+userSettings.name+''") ; name + (setq user-username "''+userSettings.username+''") ; username + (setq user-mail-address "''+userSettings.email+''") ; email + (setq user-home-directory "/home/''+userSettings.username+''") ; absolute path to home directory as string + (setq user-default-roam-dir "''+userSettings.defaultRoamDir+''") ; absolute path to home directory as string + (setq system-nix-profile "''+systemSettings.profile+''") ; what profile am I using? + (setq system-wm-type "''+userSettings.wmType+''") ; wayland or x11? + (setq doom-font (font-spec :family "''+userSettings.font+''" :size 20)) ; import font + (setq dotfiles-dir "''+userSettings.dotfilesDir+''") ; import location of dotfiles directory ''; } #+END_SRC diff --git a/user/app/flatpak/flatpak.nix b/user/app/flatpak/flatpak.nix index 75a367e..45d9238 100644 --- a/user/app/flatpak/flatpak.nix +++ b/user/app/flatpak/flatpak.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { home.packages = [ pkgs.flatpak ]; diff --git a/user/app/games/games.nix b/user/app/games/games.nix index 6534d71..d059806 100644 --- a/user/app/games/games.nix +++ b/user/app/games/games.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, ... }: let myRetroarch = (pkgs.retroarch.override { diff --git a/user/app/git/git.nix b/user/app/git/git.nix index 0e094f9..3d51049 100644 --- a/user/app/git/git.nix +++ b/user/app/git/git.nix @@ -1,10 +1,10 @@ -{ config, lib, pkgs, name, email, ... }: +{ config, pkgs, userSettings, ... }: { home.packages = [ pkgs.git ]; programs.git.enable = true; - programs.git.userName = name; - programs.git.userEmail = email; + programs.git.userName = userSettings.name; + programs.git.userEmail = userSettings.email; programs.git.extraConfig = { init.defaultBranch = "main"; }; diff --git a/user/app/keepass/keepass.nix b/user/app/keepass/keepass.nix index 35f8889..89358c6 100644 --- a/user/app/keepass/keepass.nix +++ b/user/app/keepass/keepass.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, pkgs, ... }: { # nixpkgs.overlays = [ diff --git a/user/app/ranger/ranger.nix b/user/app/ranger/ranger.nix index 11c414c..f3dece8 100644 --- a/user/app/ranger/ranger.nix +++ b/user/app/ranger/ranger.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, pkgs, ... }: let myCbxScript = '' # TODO fix this for wayland #!/bin/sh diff --git a/user/app/terminal/alacritty.nix b/user/app/terminal/alacritty.nix index c97282b..b87cb71 100644 --- a/user/app/terminal/alacritty.nix +++ b/user/app/terminal/alacritty.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, lib, ... }: { home.packages = with pkgs; [ diff --git a/user/app/terminal/kitty.nix b/user/app/terminal/kitty.nix index afbd70a..d3651a2 100644 --- a/user/app/terminal/kitty.nix +++ b/user/app/terminal/kitty.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, lib, ... }: { home.packages = with pkgs; [ diff --git a/user/app/virtualization/virtualization.nix b/user/app/virtualization/virtualization.nix index db49fcc..f1fb7bd 100644 --- a/user/app/virtualization/virtualization.nix +++ b/user/app/virtualization/virtualization.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, pkgs, ... }: { # Various packages related to virtualization, compatability and sandboxing diff --git a/user/bin/phoenix.nix b/user/bin/phoenix.nix index dd988ed..4814659 100644 --- a/user/bin/phoenix.nix +++ b/user/bin/phoenix.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, username, dotfilesDir, ... }: +{ pkgs, userSettings, ... }: let # This sets up my "phoenix" script with my configuration paths @@ -43,7 +43,7 @@ let } function sync_system { echo -e "$ORANGE### Syncing system configuration ###$NC" - pushd ''+dotfilesDir+'' &> /dev/null; + pushd ''+userSettings.dotfilesDir+'' &> /dev/null; if [ "$1" = "verbose" ]; then echo "Syncing system configuration (stack traces will be shown):" sudo systemd-run --no-ask-password --uid=0 --system --scope -p MemoryLimit=16000M -p CPUQuota=60% nixos-rebuild switch --flake .#system --show-trace; @@ -81,7 +81,7 @@ let } function sync_user { echo -e "$BLUE### Syncing user configuration ###$NC" - pushd ''+dotfilesDir+'' &> /dev/null; + pushd ''+userSettings.dotfilesDir+'' &> /dev/null; if [ "$1" = "verbose" ]; then echo "Syncing user configuration (stack traces will be shown):" echo "Running home-manager switch --flake .#user --show-trace" @@ -107,7 +107,7 @@ let } function update_flake { echo -e "$CYAN### Updating flake and other package managers$NC"; - pushd ''+dotfilesDir+'' &> /dev/null; + pushd ''+userSettings.dotfilesDir+'' &> /dev/null; if [ "$1" = "verbose" ]; then echo "Updating flake inputs"; echo "Running nix flake update"; @@ -123,7 +123,7 @@ let npm install darkreader @mozilla/readability; echo "Running rm package*.json"; rm package*.json; - echo "Returning to ''+dotfilesDir+''" + echo "Returning to ''+userSettings.dotfilesDir+''" popd &> /dev/null; fi echo "" @@ -173,7 +173,7 @@ let fi popd &> /dev/null; echo -e "$CYAN### Flake and other updates finished ###$NC"; - echo -e "Please run$GREEN git$NC diff HEAD flake.lock inside ''+dotfilesDir+(" "+'' to see flake input changes";'')+ + echo -e "Please run$GREEN git$NC diff HEAD flake.lock inside ''+userSettings.dotfilesDir+(" "+'' to see flake input changes";'')+ ''} if [ "$1" = "sync" ]; then if [ "$#" = 1 ]; then diff --git a/user/bin/ytsub-wrappers.nix b/user/bin/ytsub-wrappers.nix index ea2b388..2ac0aa3 100644 --- a/user/bin/ytsub-wrappers.nix +++ b/user/bin/ytsub-wrappers.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: let myYtpScript = '' #!/bin/sh diff --git a/user/hardware/bluetooth.nix b/user/hardware/bluetooth.nix index 77dd6d9..a6b6cd8 100644 --- a/user/hardware/bluetooth.nix +++ b/user/hardware/bluetooth.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/lang/android/android.nix b/user/lang/android/android.nix index 762d6a2..9158b97 100644 --- a/user/lang/android/android.nix +++ b/user/lang/android/android.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/lang/cc/cc.nix b/user/lang/cc/cc.nix index b5c13dd..12733fa 100644 --- a/user/lang/cc/cc.nix +++ b/user/lang/cc/cc.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/lang/godot/godot.nix b/user/lang/godot/godot.nix index 9054741..6cf5426 100644 --- a/user/lang/godot/godot.nix +++ b/user/lang/godot/godot.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/lang/haskell/haskell.nix b/user/lang/haskell/haskell.nix index bd1ce41..b903e8c 100644 --- a/user/lang/haskell/haskell.nix +++ b/user/lang/haskell/haskell.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/lang/python/python-packages.nix b/user/lang/python/python-packages.nix index f1c03db..10af8e8 100644 --- a/user/lang/python/python-packages.nix +++ b/user/lang/python/python-packages.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { # Python packages diff --git a/user/lang/python/python.nix b/user/lang/python/python.nix index 67b4ca3..681c776 100644 --- a/user/lang/python/python.nix +++ b/user/lang/python/python.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/lang/rust/rust.nix b/user/lang/rust/rust.nix index 414f084..23bccb1 100644 --- a/user/lang/rust/rust.nix +++ b/user/lang/rust/rust.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/pkgs/blockbench.nix b/user/pkgs/blockbench.nix index 83840c2..4f852ae 100644 --- a/user/pkgs/blockbench.nix +++ b/user/pkgs/blockbench.nix @@ -1,4 +1,4 @@ -{ config, stdenv, fetchurl, appimageTools, makeWrapper, electron_22, lib, pkgs, ... }: +{ lib, pkgs, ... }: { nixpkgs.overlays = [ @@ -53,4 +53,6 @@ } ) ]; + + home.packages = [ pkgs.blockbench-electron ]; } diff --git a/user/pkgs/impressive.nix b/user/pkgs/impressive.nix index cafdf04..6ee0ea3 100644 --- a/user/pkgs/impressive.nix +++ b/user/pkgs/impressive.nix @@ -1,5 +1,5 @@ # THIS DOES NOT WORK YET! -{ lib, stdenv, buildPythonPackage, pkgs, ... }: +{ lib, buildPythonPackage, pkgs, ... }: let name = "Impressive"; _name = "impressive"; diff --git a/user/pkgs/rogauracore.nix b/user/pkgs/rogauracore.nix index c09991c..d141753 100644 --- a/user/pkgs/rogauracore.nix +++ b/user/pkgs/rogauracore.nix @@ -1,5 +1,5 @@ # THIS DOES NOT WORK YET! -{ lib, stdenv, pkgs, ... }: +{ stdenv, pkgs, ... }: let name = "rogauracore"; owner = "wroberts"; diff --git a/user/shell/cli-collection.nix b/user/shell/cli-collection.nix index b9b947e..57f52b9 100644 --- a/user/shell/cli-collection.nix +++ b/user/shell/cli-collection.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { # Collection of useful CLI apps diff --git a/user/shell/sh.nix b/user/shell/sh.nix index d7884e5..ff3467b 100644 --- a/user/shell/sh.nix +++ b/user/shell/sh.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: let # My shell aliases diff --git a/user/style/stylix.nix b/user/style/stylix.nix index fcc8fd2..f3c02b1 100644 --- a/user/style/stylix.nix +++ b/user/style/stylix.nix @@ -1,13 +1,13 @@ -{ config, lib, pkgs, theme, font, fontPkg, wmType, ... }: +{ config, lib, pkgs, userSettings, ... }: let - themePath = "../../../themes"+("/"+theme+"/"+theme)+".yaml"; - themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../themes"+("/"+theme)+"/polarity.txt")); - backgroundUrl = builtins.readFile (./. + "../../../themes"+("/"+theme)+"/backgroundurl.txt"); - backgroundSha256 = builtins.readFile (./. + "../../../themes/"+("/"+theme)+"/backgroundsha256.txt"); + themePath = "../../../themes"+("/"+userSettings.theme+"/"+userSettings.theme)+".yaml"; + themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../themes"+("/"+userSettings.theme)+"/polarity.txt")); + backgroundUrl = builtins.readFile (./. + "../../../themes"+("/"+userSettings.theme)+"/backgroundurl.txt"); + backgroundSha256 = builtins.readFile (./. + "../../../themes/"+("/"+userSettings.theme)+"/backgroundsha256.txt"); in { - home.file.".currenttheme".text = theme; + home.file.".currenttheme".text = userSettings.theme; stylix.autoEnable = false; stylix.polarity = themePolarity; stylix.image = pkgs.fetchurl { @@ -18,16 +18,16 @@ in stylix.fonts = { monospace = { - name = font; - package = fontPkg; + name = userSettings.font; + package = userSettings.fontPkg; }; serif = { - name = font; - package = fontPkg; + name = userSettings.font; + package = userSettings.fontPkg; }; sansSerif = { - name = font; - package = fontPkg; + name = userSettings.font; + package = userSettings.fontPkg; }; emoji = { name = "Noto Color Emoji"; @@ -72,8 +72,8 @@ in }; stylix.targets.kitty.enable = true; stylix.targets.gtk.enable = true; - stylix.targets.rofi.enable = if (wmType == "x11") then true else false; - stylix.targets.feh.enable = if (wmType == "x11") then true else false; + stylix.targets.rofi.enable = if (userSettings.wmType == "x11") then true else false; + stylix.targets.feh.enable = if (userSettings.wmType == "x11") then true else false; programs.feh.enable = true; home.file.".fehbg-stylix".text = '' #!/bin/sh diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index 9a84010..aa1b4c1 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, stdenv, toString, browser, term, spawnEditor, font, hyprland-plugins, ... }: +{ config, lib, pkgs, userSettings, ... }: { imports = [ @@ -20,9 +20,7 @@ wayland.windowManager.hyprland = { enable = true; - plugins = [ - # (pkgs.callPackage ./hyprbars.nix { inherit hyprland-plugins; } ) - ]; + plugins = [ ]; settings = { }; extraConfig = '' exec-once = dbus-update-activation-environment DISPLAY XAUTHORITY WAYLAND_DISPLAY @@ -67,7 +65,7 @@ # col.text = 0xff''+ config.lib.stylix.colors.base05 + '' - # bar_text_font = '' + font + '' + # bar_text_font = '' + userSettings.font + '' # bar_text_size = 12 @@ -91,11 +89,11 @@ bind = SUPER,R,pass,^(com\.obsproject\.Studio)$ bind = SUPERSHIFT,R,pass,^(com\.obsproject\.Studio)$ - bind=SUPER,RETURN,exec,'' + term + '' + bind=SUPER,RETURN,exec,'' + userSettings.term + '' - bind=SUPER,A,exec,'' + spawnEditor + '' + bind=SUPER,A,exec,'' + userSettings.spawnEditor + '' - bind=SUPER,S,exec,'' + browser + '' + bind=SUPER,S,exec,'' + userSettings.browser + '' bind=SUPERCTRL,S,exec,container-open # qutebrowser only @@ -551,7 +549,7 @@ style = '' * { /* `otf-font-awesome` is required to be installed for icons */ - font-family: FontAwesome, ''+font+''; + font-family: FontAwesome, ''+userSettings.font+''; font-size: 20px; } @@ -741,7 +739,7 @@ programs.fuzzel.enable = true; programs.fuzzel.settings = { main = { - font = font + ":size=13"; + font = userSettings.font + ":size=13"; terminal = "${pkgs.alacritty}/bin/alacritty"; }; colors = { @@ -764,9 +762,9 @@ anchor = "bottom-right"; stacking-order = "top-down"; min-width = 400; - title-font = font + ":size=14"; - summary-font = font + ":size=12"; - body-font = font + ":size=11"; + title-font = userSettings.font + ":size=14"; + summary-font = userSettings.font + ":size=12"; + body-font = userSettings.font + ":size=11"; border-size = 0; }; low = { diff --git a/user/wm/picom/picom.nix b/user/wm/picom/picom.nix index 0899c90..56d3a5b 100644 --- a/user/wm/picom/picom.nix +++ b/user/wm/picom/picom.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/user/wm/xmonad/xmonad.nix b/user/wm/xmonad/xmonad.nix index 9f54768..ca2b71c 100644 --- a/user/wm/xmonad/xmonad.nix +++ b/user/wm/xmonad/xmonad.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, pkgs, ... }: { @@ -6,7 +6,7 @@ ../../lang/haskell/haskell.nix ../../app/terminal/alacritty.nix ../../app/terminal/kitty.nix - ( import ../../app/dmenu-scripts/networkmanager-dmenu.nix {dmenu_command = "rofi -show dmenu"; inherit config lib pkgs;}) + ( import ../../app/dmenu-scripts/networkmanager-dmenu.nix {dmenu_command = "rofi -show dmenu"; inherit pkgs;}) ]; home.packages = with pkgs; [ diff --git a/user/wm/xmonad/xmonad.org b/user/wm/xmonad/xmonad.org index 4181998..676f055 100644 --- a/user/wm/xmonad/xmonad.org +++ b/user/wm/xmonad/xmonad.org @@ -779,7 +779,7 @@ while true * Nix Integration In order to have Nix put my xmonad/xmobar configuration in the proper places, I have [[./xmonad.nix][xmonad.nix]], which I source in the =imports= block of my [[../../home.nix][home.nix]]. #+BEGIN_SRC nix :tangle xmonad.nix -{ config, lib, pkgs, ... }: +{ config, pkgs, ... }: { @@ -787,7 +787,7 @@ In order to have Nix put my xmonad/xmobar configuration in the proper places, I ../../lang/haskell/haskell.nix ../../app/terminal/alacritty.nix ../../app/terminal/kitty.nix - ( import ../../app/dmenu-scripts/networkmanager-dmenu.nix {dmenu_command = "rofi -show dmenu"; inherit config lib pkgs;}) + ( import ../../app/dmenu-scripts/networkmanager-dmenu.nix {dmenu_command = "rofi -show dmenu"; inherit pkgs;}) ]; home.packages = with pkgs; [