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

166
flake.nix
View File

@@ -1,90 +1,95 @@
{
description = "pagedMov's NixOS configuration";
description = "pagedMov's NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
hypr-contrib.url = "github:hyprwm/contrib";
hyprpicker.url = "github:hyprwm/hyprpicker";
hypr-contrib.url = "github:hyprwm/contrib";
hyprpicker.url = "github:hyprwm/hyprpicker";
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
catppuccin-bat = {
url = "github:catppuccin/bat";
flake = false;
};
catppuccin-cava = {
url = "github:catppuccin/cava";
flake = false;
};
catppuccin-starship = {
url = "github:catppuccin/starship";
flake = false;
};
catppuccin-yazi = {
url = "github:catppuccin/yazi";
flake = false;
};
spicetify-nix = {
url = "github:gerg-l/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
catppuccin-bat = {
url = "github:catppuccin/bat";
flake = false;
};
catppuccin-cava = {
url = "github:catppuccin/cava";
flake = false;
};
catppuccin-starship = {
url = "github:catppuccin/starship";
flake = false;
};
catppuccin-yazi = {
url = "github:catppuccin/yazi";
flake = false;
};
spicetify-nix = {
url = "github:gerg-l/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nvim = {
url = "github:pagedMov/pagedmov-nixvim";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
toilet = {
url = "github:pagedMov/toilet-extra-fonts";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
nur,
home-manager,
self,
nvim,
toilet,
...
} @ inputs: let
system = "x86_64-linux";
username = "pagedmov";
in {
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "desktop";
inherit self inputs username;
};
inherit system;
modules = [
./hosts/desktop
nur.nixosModules.nur
];
};
laptop = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "laptop";
inherit self inputs username;
};
modules = [
./hosts/laptop
nur.nixosModules.nur
];
};
toilet = {
url = "github:pagedMov/toilet-extra-fonts";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
nur,
home-manager,
self,
nvim,
toilet,
...
} @ inputs: let
system = "x86_64-linux";
username = "pagedmov";
in {
nixosConfigurations = {
oganesson = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "oganesson";
inherit self inputs username;
};
inherit system;
modules = [
./hosts/desktop
nur.nixosModules.nur
];
};
mercury = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "mercury";
inherit self inputs username;
};
modules = [
./hosts/laptop
nur.nixosModules.nur
];
};
installer = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "installer";
@@ -92,9 +97,8 @@
};
modules = [
./hosts/installer
inputs.disko.nixosModules.default
];
};
};
};
};
};
}

View File

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

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

@@ -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
''

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,42 +1,57 @@
{
config,
inputs,
pkgs,
username,
self,
host,
...
config,
inputs,
pkgs,
username,
self,
host,
...
}: let
nur = config.nur;
nur = config.nur;
in {
imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "backup";
extraSpecialArgs = {inherit self inputs host username nur;};
users.${username} = {
programs.home-manager.enable = true;
imports = [./../../home];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "24.05";
pointerCursor = {
name = "Quintom_Ink";
size = 36;
package = pkgs.quintom-cursor-theme;
};
};
};
};
users.users.${username} = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = ["wheel"];
};
security.sudo.extraConfig = ''
${username} ALL=(ALL) NOPASSWD: /run/current-system/sw/bin/nixos-rebuild
'';
nix.settings.allowed-users = ["${username}"];
imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "backup";
extraSpecialArgs = {inherit self inputs host username nur;};
users.${username} = {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
programs.home-manager.enable = true;
imports = [
./../../home
];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "24.05";
pointerCursor = {
name = "Quintom_Ink";
size = 36;
package = pkgs.quintom-cursor-theme;
};
};
};
};
users = {
groups.persist = {};
users = {
root.hashedPassword = "$y$j9T$/eZO.0cE2EcsF4od78laE/$A3kqgNhr6LkUZHI/0MXAhk.SSKk7QsCIwH/l6xeryy8";
${username} = {
isNormalUser = true;
hashedPassword = "$y$j9T$pdvRk/.3GbwvcPw0NTdwW0$ugclmwwlOO7iKLcJY4DkyD2tX6.LS26LHQ//0W1zLQ.";
shell = pkgs.zsh;
extraGroups = ["wheel" "persist" "libvirtd"];
};
};
};
security.sudo.extraConfig = ''
${username} ALL=(ALL) NOPASSWD: /run/current-system/sw/bin/nixos-rebuild
'';
nix.settings.allowed-users = ["${username}"];
}

View File

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