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

@@ -4,13 +4,14 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
hypr-contrib.url = "github:hyprwm/contrib";
hyprpicker.url = "github:hyprwm/hyprpicker";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hypr-contrib.url = "github:hyprwm/contrib";
hyprpicker.url = "github:hyprwm/hyprpicker";
hyprland = { hyprland = {
type = "git"; type = "git";
url = "https://github.com/hyprwm/Hyprland"; url = "https://github.com/hyprwm/Hyprland";
@@ -21,30 +22,32 @@
url = "github:catppuccin/bat"; url = "github:catppuccin/bat";
flake = false; flake = false;
}; };
catppuccin-cava = { catppuccin-cava = {
url = "github:catppuccin/cava"; url = "github:catppuccin/cava";
flake = false; flake = false;
}; };
catppuccin-starship = { catppuccin-starship = {
url = "github:catppuccin/starship"; url = "github:catppuccin/starship";
flake = false; flake = false;
}; };
catppuccin-yazi = { catppuccin-yazi = {
url = "github:catppuccin/yazi"; url = "github:catppuccin/yazi";
flake = false; flake = false;
}; };
spicetify-nix = { spicetify-nix = {
url = "github:gerg-l/spicetify-nix"; url = "github:gerg-l/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
nvim = { nvim = {
url = "github:pagedMov/pagedmov-nixvim"; url = "github:pagedMov/pagedmov-nixvim";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
toilet = { toilet = {
url = "github:pagedMov/toilet-extra-fonts"; url = "github:pagedMov/toilet-extra-fonts";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -64,9 +67,9 @@
username = "pagedmov"; username = "pagedmov";
in { in {
nixosConfigurations = { nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem { oganesson = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
host = "desktop"; host = "oganesson";
inherit self inputs username; inherit self inputs username;
}; };
inherit system; inherit system;
@@ -75,9 +78,10 @@
nur.nixosModules.nur nur.nixosModules.nur
]; ];
}; };
laptop = nixpkgs.lib.nixosSystem {
mercury = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
host = "laptop"; host = "mercury";
inherit self inputs username; inherit self inputs username;
}; };
modules = [ modules = [
@@ -85,6 +89,7 @@
nur.nixosModules.nur nur.nixosModules.nur
]; ];
}; };
installer = nixpkgs.lib.nixosSystem { installer = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
host = "installer"; host = "installer";
@@ -92,7 +97,6 @@
}; };
modules = [ modules = [
./hosts/installer ./hosts/installer
inputs.disko.nixosModules.default
]; ];
}; };
}; };

View File

@@ -11,6 +11,5 @@
./../../modules/sys ./../../modules/sys
./hardware.nix ./hardware.nix
./settings.nix ./settings.nix
./steam.nix
]; ];
} }

View File

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

View File

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

View File

@@ -8,14 +8,11 @@
sessionVariables = { sessionVariables = {
SOUNDS_ENABLED = "1"; SOUNDS_ENABLED = "1";
EDITOR = "/nixbin/nvim"; EDITOR = "nvim";
SUDO_EDITOR = "/nixbin/nvim"; SUDO_EDITOR = "nvim";
VISUAL = "/nixbin/nvim"; VISUAL = "nvim";
LANG = "en_US.UTF-8"; LANG = "en_US.UTF-8";
BROWSER = "/nixbin/firefox"; BROWSER = "firefox";
NVIM = "${self}/nixvim/config/";
HYPRCONF = "${self}/hyprland/";
SYSCONF = "${self}/glasshouse-desktop/sys";
}; };
oh-my-zsh = { oh-my-zsh = {
@@ -51,14 +48,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 $HOME/dots/zshell.nix"; zrc = "nvim ${self}/modules/home/environment/zshell.nix";
svcu = "systemctl --user"; svcu = "systemctl --user";
svc = "sudo systemctl"; 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"; 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 = '' initExtra = ''

View File

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

View File

@@ -1,9 +1,11 @@
{username, ...}: { {username, host, ...}: {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
monitor = [ monitor = if (host == "oganesson") then [
"DP-1, 1920x1080@144, 1920x0, 1" "DP-1, 1920x1080@144, 1920x0, 1"
"HDMI-A-1, 1920x1080, 0x0, 1" "HDMI-A-1, 1920x1080, 0x0, 1"
] else [
"eDP-1, 1600x900, 0x0, 1"
]; ];
exec-once = [ exec-once = [
@@ -17,13 +19,18 @@
"aplay /home/${username}/sound/sys/login.wav &" "aplay /home/${username}/sound/sys/login.wav &"
]; ];
workspace = [ workspace = if (host == "oganesson") 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"
"3,persistent=true,monitor:HDMI-A-1" "3,persistent=true,monitor:HDMI-A-1"
"4,persistent=true,monitor:DP-1" "4,persistent=true,monitor:DP-1"
"5,persistent=true,monitor:DP-1" "5,persistent=true,monitor:DP-1"
"6,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 = { input = {

View File

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

View File

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

View File

@@ -18,7 +18,7 @@ pkgs.writeShellScriptBin "homep" ''
if [ -n "$selected_packages" ]; then if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do echo "$selected_packages" | while read -r package; do
# Append each selected package to the Nix config file # 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." echo "Added $package to the Home Manager configuration."
done done

View File

@@ -5,11 +5,11 @@
pkgs.writeShellScriptBin "homer" '' pkgs.writeShellScriptBin "homer" ''
#!/run/current-system/sw/bin/bash #!/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 if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do 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." echo "Removed $package from the Home Manager configuration."
done done

View File

@@ -7,8 +7,7 @@ pkgs.writeShellScriptBin "nixcommit" ''
#!/run/current-system/sw/bin/bash #!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
builtin cd "$HOME/sysflakes" || exit pushd "${self}" || exit
nix flake update
if [ -n "$2" ]; then if [ -n "$2" ]; then
echo "too many arguments" echo "too many arguments"
@@ -45,5 +44,5 @@ pkgs.writeShellScriptBin "nixcommit" ''
fi fi
scheck && runbg aplay ${self}/media/sound/gitcommit.wav 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 if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do echo "$selected_packages" | while read -r package; do
# Append each selected package to the Nix config file # 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." echo "Added $package to the Nix configuration."
done done

View File

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

View File

@@ -5,11 +5,11 @@
pkgs.writeShellScriptBin "nixr" '' pkgs.writeShellScriptBin "nixr" ''
#!/run/current-system/sw/bin/bash #!/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 if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do 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." echo "Removed $package from the Nix configuration."
done done

View File

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

View File

@@ -6,7 +6,14 @@
username, username,
host, host,
... ...
}: { }:
let
desktop_modules = if (host == "oganesson") then [
./software/virtualization.nix
] else [ ];
in
{
imports = imports =
[(import ./hardware/bootloader.nix)] [(import ./hardware/bootloader.nix)]
++ [(import ./hardware/network.nix)] ++ [(import ./hardware/network.nix)]
@@ -15,5 +22,6 @@
++ [(import ./software/packages.nix)] ++ [(import ./software/packages.nix)]
++ [(import ./software/programs.nix)] ++ [(import ./software/programs.nix)]
++ [(import ./software/services.nix)] ++ [(import ./software/services.nix)]
++ [(import ./software/users.nix)]; ++ [(import ./software/users.nix)]
++ desktop_modules;
} }

View File

@@ -2,11 +2,11 @@
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
hostName = hostName =
if (host == "desktop") if (host == "oganesson")
then "argon" then "oganesson"
else "mercury"; else "mercury";
hosts = { hosts = {
"192.168.1.163" = ["glasshaus"]; "192.168.1.201" = ["glasshaus"];
"192.168.1.111" = ["argon"]; "192.168.1.111" = ["argon"];
"192.168.1.223" = ["mercury"]; "192.168.1.223" = ["mercury"];
}; };

View File

@@ -36,11 +36,15 @@
mesa mesa
mpd mpd
mullvad mullvad
mesa
neofetch neofetch
nh
nix-index nix-index
nix-output-monitor
nix-prefetch-scripts nix-prefetch-scripts
nixos-option nixos-option
nix-search-cli nix-search-cli
nvd
openssl openssl
p7zip p7zip
jq jq
@@ -70,5 +74,6 @@
xpad xpad
libnotify libnotify
file file
libvirt-glib
]; ];
} }

View File

@@ -15,7 +15,7 @@
) )
]; ];
services.displayManager.sddm = { services.displayManager.sddm = {
enable = true; enable = false;
wayland.enable = true; wayland.enable = true;
theme = "catppuccin-mocha"; theme = "catppuccin-mocha";
package = pkgs.kdePackages.sddm; package = pkgs.kdePackages.sddm;

View File

@@ -7,7 +7,7 @@
host, host,
... ...
}: let }: let
nur = config.nur; nur = config.nur;
in { in {
imports = [inputs.home-manager.nixosModules.home-manager]; imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = { home-manager = {
@@ -16,8 +16,16 @@ in {
backupFileExtension = "backup"; backupFileExtension = "backup";
extraSpecialArgs = {inherit self inputs host username nur;}; extraSpecialArgs = {inherit self inputs host username nur;};
users.${username} = { users.${username} = {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
programs.home-manager.enable = true; programs.home-manager.enable = true;
imports = [./../../home]; imports = [
./../../home
];
home = { home = {
username = "${username}"; username = "${username}";
homeDirectory = "/home/${username}"; homeDirectory = "/home/${username}";
@@ -30,10 +38,17 @@ in {
}; };
}; };
}; };
users.users.${username} = { users = {
groups.persist = {};
users = {
root.hashedPassword = "$y$j9T$/eZO.0cE2EcsF4od78laE/$A3kqgNhr6LkUZHI/0MXAhk.SSKk7QsCIwH/l6xeryy8";
${username} = {
isNormalUser = true; isNormalUser = true;
hashedPassword = "$y$j9T$pdvRk/.3GbwvcPw0NTdwW0$ugclmwwlOO7iKLcJY4DkyD2tX6.LS26LHQ//0W1zLQ.";
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = ["wheel"]; extraGroups = ["wheel" "persist" "libvirtd"];
};
};
}; };
security.sudo.extraConfig = '' security.sudo.extraConfig = ''
${username} ALL=(ALL) NOPASSWD: /run/current-system/sw/bin/nixos-rebuild ${username} ALL=(ALL) NOPASSWD: /run/current-system/sw/bin/nixos-rebuild

View File

@@ -0,0 +1,6 @@
{ username, ... }:
{
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
}