included relevant work from impermanence branch

This commit is contained in:
pagedmov
2024-10-17 22:07:34 -04:00
parent f512c7c7bb
commit 11f97cf4f3
23 changed files with 222 additions and 173 deletions

View File

@@ -7,7 +7,14 @@
config,
home-manager,
...
}: {
}:
let
desktop_modules = if (host == "onagesson") then
[(import ./programs/steam.nix)] else
[];
in
{
imports =
[(import ./programs/btop.nix)]
++ [(import ./programs/yazi.nix)]
@@ -29,5 +36,6 @@
++ [(import ./hyprland)]
++ [(import ./scripts)]
++ [(import ./swaync/swaync.nix)]
++ [(import ./waybar)];
++ [(import ./waybar)]
++ desktop_modules;
}

View File

@@ -1,16 +1,22 @@
{
pkgs,
inputs,
host,
...
}: let
nvim = inputs.nvim.packages."x86_64-linux".default;
toilet = inputs.toilet.packages."x86_64-linux".default;
desktop_pkgs = if (host == "oganesson") then with pkgs; [
uhk-agent
zathura
handbrake
snes9x-gtk
obs-studio
] else [ ];
in {
home.packages = with pkgs; [
gtk3
uhk-agent
sqlite
zathura
gimp
imagemagick
yt-dlp
@@ -19,21 +25,18 @@ in {
speedtest-cli
vesktop
qbittorrent
obs-studio
neovide
zsh
zsh-syntax-highlighting
zsh-history-substring-search
zsh-autosuggestions
audacity
snes9x-gtk
rustup
libreoffice
handbrake
gtrash
ripgrep
nvim
toilet
python3
];
] ++ desktop_pkgs;
}

View File

@@ -8,14 +8,11 @@
sessionVariables = {
SOUNDS_ENABLED = "1";
EDITOR = "/nixbin/nvim";
SUDO_EDITOR = "/nixbin/nvim";
VISUAL = "/nixbin/nvim";
EDITOR = "nvim";
SUDO_EDITOR = "nvim";
VISUAL = "nvim";
LANG = "en_US.UTF-8";
BROWSER = "/nixbin/firefox";
NVIM = "${self}/nixvim/config/";
HYPRCONF = "${self}/hyprland/";
SYSCONF = "${self}/glasshouse-desktop/sys";
BROWSER = "firefox";
};
oh-my-zsh = {
@@ -51,14 +48,15 @@
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
mkdir = "mkdir -p";
pk = "pkill -9 -f";
zrc = "nvim $HOME/dots/zshell.nix";
zrc = "nvim ${self}/modules/home/environment/zshell.nix";
svcu = "systemctl --user";
svc = "sudo systemctl";
hyprconf = "nvim $HOME/dots/hyprland/config.nix";
nixconf = "nvim $HOME/sysflakes/glasshouse-desktop/sys";
hmconf = "nvim $HOME/sysflakes/glasshouse-desktop/home";
viflake = "nvim flake.nix";
nvimcfg = "nvim $HOME/dots/nixvim/config";
hyprconf = "yazi ${self}/modules/home/hyprland && popd &> /dev/null";
hmconf = "yazi ${self}/modules/home/ && popd &> /dev/null";
nixconf = "yazi ${self}/modules/sys/ && popd &> /dev/null";
hostconf = "yazi ${self}/hosts && popd &> /dev/null";
nvimcfg = "yazi ${self}/pkgs/nixvim/config && popd &> /dev/null";
};
initExtra = ''

View File

@@ -4,7 +4,7 @@
...
}: let
host_config =
if (host == "desktop")
if (host == "oganesson")
then [./desktop.nix]
else [./laptop.nix];
in {

View File

@@ -1,10 +1,12 @@
{username, ...}: {
{username, host, ...}: {
wayland.windowManager.hyprland = {
settings = {
monitor = [
monitor = if (host == "oganesson") then [
"DP-1, 1920x1080@144, 1920x0, 1"
"HDMI-A-1, 1920x1080, 0x0, 1"
];
] else [
"eDP-1, 1600x900, 0x0, 1"
];
exec-once = [
"waybar &"
@@ -17,14 +19,19 @@
"aplay /home/${username}/sound/sys/login.wav &"
];
workspace = [
workspace = if (host == "oganesson") then [
"1,persistent=true,monitor:HDMI-A-1"
"2,persistent=true,monitor:HDMI-A-1"
"3,persistent=true,monitor:HDMI-A-1"
"4,persistent=true,monitor:DP-1"
"5,persistent=true,monitor:DP-1"
"6,persistent=true,monitor:DP-1"
];
] else [
"1,persistent=true,monitor:eDP-1"
"2,persistent=true,monitor:eDP-1"
"3,persistent=true,monitor:eDP-1"
"4,persistent=true,monitor:eDP-1"
];
input = {
kb_layout = "us";

View File

@@ -1,6 +1,7 @@
{
host,
username,
self,
...
}: {
services.hyprpaper = {
@@ -9,16 +10,16 @@
ipc = "on";
splash = false;
splash_offset = 2.0;
preload = ["/home/${username}/Pictures/Wallpapers/cat-leaves.png"];
preload = ["${self}/media/wallpapers/catppuccin/cat-leaves.png"];
wallpaper =
if (host == "desktop")
if (host == "oganesson")
then [
"DP-1,/home/${username}/Pictures/Wallpapers/cat-leaves.png"
"HDMI-A-1,/home/${username}/Pictures/Wallpapers/cat-leaves.png"
"DP-1,${self}/media/wallpapers/catppuccin/cat-leaves.png"
"HDMI-A-1,${self}/media/wallpapers/catppuccin/cat-leaves.png"
]
else [
"eDP-1,/home/${username}/Pictures/Wallpapers/cat-leaves.png"
"eDP-1,${self}/media/wallpapers/catppuccin/cat-leaves.png"
];
};
};

View File

@@ -0,0 +1,6 @@
{...}: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
}

View File

@@ -2219,7 +2219,7 @@
fg_light = "#74c7ec";
}
{
name = "desktop";
name = "oganesson";
text = "";
fg_dark = "#45475a";
fg_light = "#45475a";

View File

@@ -18,7 +18,7 @@ pkgs.writeShellScriptBin "homep" ''
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
# Append each selected package to the Nix config file
sed -i "/^\t]/i \ \t\t$package" "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix"
sed -i "/^\t]/i \ \t\t$package" "${self}/modules/home/userpkgs.nix"
echo "Added $package to the Home Manager configuration."
done

View File

@@ -5,11 +5,11 @@
pkgs.writeShellScriptBin "homer" ''
#!/run/current-system/sw/bin/bash
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
selected_packages=$(sed -n '/\[/,/\]/p' "${self}/modules/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
sed -i "/\b$package\b/d" "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix"
sed -i "/\b$package\b/d" "${self}/modules/home/userpkgs.nix"
echo "Removed $package from the Home Manager configuration."
done

View File

@@ -7,8 +7,7 @@ pkgs.writeShellScriptBin "nixcommit" ''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
builtin cd "$HOME/sysflakes" || exit
nix flake update
pushd "${self}" || exit
if [ -n "$2" ]; then
echo "too many arguments"
@@ -45,5 +44,5 @@ pkgs.writeShellScriptBin "nixcommit" ''
fi
scheck && runbg aplay ${self}/media/sound/gitcommit.wav
builtin cd - || exit
popd || exit
''

View File

@@ -18,7 +18,7 @@ pkgs.writeShellScriptBin "nixp" ''
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
# Append each selected package to the Nix config file
sed -i "/^\t]/i \ \t\t$package" "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix"
sed -i "/^\t]/i \ \t\t$package" "${self}/modules/sys/packages.nix"
echo "Added $package to the Nix configuration."
done

View File

@@ -7,7 +7,7 @@ pkgs.writeShellScriptBin "nixpush" ''
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
pushd "$HOME/sysflakes"
pushd "${self}"
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
if [ -z "$commits" ]; then

View File

@@ -5,11 +5,11 @@
pkgs.writeShellScriptBin "nixr" ''
#!/run/current-system/sw/bin/bash
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix" | sed '1d;$d' | fzf -m)
selected_packages=$(sed -n '/\[/,/\]/p' "${self}/modules/sys/packages.nix" | sed '1d;$d' | fzf -m)
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
sed -i "/\b$package\b/d" "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix"
sed -i "/\b$package\b/d" "${self}/modules/sys/packages.nix"
echo "Removed $package from the Nix configuration."
done

View File

@@ -8,14 +8,10 @@ pkgs.writeShellScriptBin "rebuild" ''
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
pushd "$HOME/sysflakes"
nix flake update
sudo nixos-rebuild switch --flake "$HOME/sysflakes#${host}"
sudo nixos-rebuild switch --flake "$HOME/.sysflake#${host}"
if [ $? -eq 0 ]; then
scheck && runbg aplay ${self}/media/sound/update.wav
else
scheck && runbg aplay ${self}/media/sound/error.wav
fi
popd
''