fixed zshell config editing aliases, rewrote the 'if (host == 'oganesson')' statements to be more readable

This commit is contained in:
pagedmov
2024-10-22 17:38:57 -04:00
parent b20e6d745c
commit 4ab38e199b
7 changed files with 33 additions and 21 deletions

View File

@@ -3,7 +3,12 @@
host, host,
scheme, scheme,
... ...
}: { }:
let
desktop = (host == "oganesson");
in
{
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
monitor = monitor =
@@ -28,7 +33,7 @@
]; ];
workspace = workspace =
if (host == "oganesson") if desktop
then [ then [
"1,persistent=true,monitor:HDMI-A-1" "1,persistent=true,monitor:HDMI-A-1"
"2,persistent=true,monitor:HDMI-A-1" "2,persistent=true,monitor:HDMI-A-1"

View File

@@ -3,12 +3,13 @@
host, host,
... ...
}: }:
let let
desktop = (host == "oganesson");
extraFigletFonts = pkgs.fetchFromGitHub { extraFigletFonts = pkgs.fetchFromGitHub {
owner = "xero"; owner = "xero";
repo = "figlet-fonts"; repo = "figlet-fonts";
rev = "master"; rev = "master";
sha256 = "sha256-dAs7N66D2Fpy4/UB5Za1r2qb1iSAJR6TMmau1asxgtY="; sha256 = "sha256-dAs7N66D2Fpy4/UB5Za1r2qb1iSAJR6TMmau1asxgtY=";
}; };
toilet-extrafonts = pkgs.toilet.overrideAttrs (oldAttrs: { toilet-extrafonts = pkgs.toilet.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs or [] ++ [extraFigletFonts]; buildInputs = oldAttrs.buildInputs or [] ++ [extraFigletFonts];
@@ -19,9 +20,9 @@
cp -r ${extraFigletFonts}/* $out/share/figlet cp -r ${extraFigletFonts}/* $out/share/figlet
''; '';
}); });
desktop_pkgs = desktop_pkgs =
if (host == "oganesson") if desktop
then then
with pkgs; [ with pkgs; [
uhk-agent uhk-agent

View File

@@ -13,6 +13,7 @@
VISUAL = "nvim"; VISUAL = "nvim";
LANG = "en_US.UTF-8"; LANG = "en_US.UTF-8";
BROWSER = "firefox"; BROWSER = "firefox";
FLAKEPATH = "$HOME/.sysflake";
}; };
oh-my-zsh = { oh-my-zsh = {
@@ -48,15 +49,15 @@
psg = "ps aux | grep -v grep | grep -i -e VSZ -e"; psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
mkdir = "mkdir -p"; mkdir = "mkdir -p";
pk = "pkill -9 -f"; pk = "pkill -9 -f";
zrc = "nvim ${self}/modules/home/environment/zshell.nix"; zrc = "nvim $FLAKEPATH/modules/home/environment/zshell.nix";
svcu = "systemctl --user"; svcu = "systemctl --user";
svc = "sudo systemctl"; svc = "sudo systemctl";
viflake = "nvim flake.nix"; viflake = "nvim flake.nix";
hyprconf = "yazi ${self}/modules/home/hyprland && popd &> /dev/null"; hyprconf = "yazi $FLAKEPATH/modules/home/hyprland && popd &> /dev/null";
hmconf = "yazi ${self}/modules/home/ && popd &> /dev/null"; hmconf = "yazi $FLAKEPATH/modules/home/ && popd &> /dev/null";
nixconf = "yazi ${self}/modules/sys/ && popd &> /dev/null"; nixconf = "yazi $FLAKEPATH/modules/sys/ && popd &> /dev/null";
hostconf = "yazi ${self}/hosts && popd &> /dev/null"; hostconf = "yazi $FLAKEPATH/hosts && popd &> /dev/null";
nvimcfg = "yazi ${self}/pkgs/nixvim/config && popd &> /dev/null"; nvimcfg = "yazi $FLAKEPATH/pkgs/nixvim/config && popd &> /dev/null";
}; };
initExtra = '' initExtra = ''
@@ -127,6 +128,7 @@
clear clear
splash splash
scheck && runbg aplay ${self}/assets/sound/sh-source.wav scheck && runbg aplay ${self}/assets/sound/sh-source.wav
[ ! -f $FLAKEPATH/flake.nix ] && echo "WARNING: flake.nix not found at \$FLAKEPATH. Shell aliases for editing config files won't work correctly!" && echo "Edit the FLAKEPATH session variable in zshell.nix to point to the path where you saved the system configuration flake."
''; '';
}; };
} }

View File

@@ -9,8 +9,9 @@
home-manager, home-manager,
... ...
}: let }: let
desktop = (host == "onagesson");
desktop_modules = desktop_modules =
if (host == "onagesson") if desktop
then [(import ./gaming)] then [(import ./gaming)]
else []; else [];
in { in {

View File

@@ -1,8 +1,12 @@
{host, ...}: { {host, ...}:
let
desktop = (host == "oganesson");
in
{
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
hostName = hostName =
if (host == "oganesson") if desktop
then "oganesson" then "oganesson"
else "mercury"; else "mercury";
hosts = { hosts = {

View File

@@ -1,4 +1,3 @@
{ {
inputs, inputs,
nixpkgs, nixpkgs,
@@ -7,18 +6,18 @@
username, username,
host, host,
... ...
}: }:
let let
desktop_modules = if (host == "oganesson") then desktop = (host == "oganesson");
desktop_modules = if desktop then
[(import ./virtualization.nix)] ++ [(import ./gaming)] [(import ./virtualization.nix)] ++ [(import ./gaming)]
else []; else [];
in in
{ {
imports = imports =
[(import ./packages.nix)] [(import ./packages.nix)]
++ [(import ./programs.nix)] ++ [(import ./programs.nix)]
++ [(import ./services.nix)] ++ [(import ./services.nix)]
++ [(import ./nixvim)] ++ [(import ./nixvim)]
++ desktop_modules; ++ desktop_modules;
} }