refaktoryzacja flake.nix, aby wspierał wielu hostów, a nie tylko jednego wpisanego na twardo
This commit is contained in:
28
flake.nix
28
flake.nix
@@ -35,14 +35,18 @@
|
|||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
hostDirs = builtins.attrNames (builtins.readDir ./hosts);
|
||||||
host = "Garand-Desktop";
|
|
||||||
profile = "nvidia";
|
|
||||||
username = "garand_plg";
|
|
||||||
|
|
||||||
# Deduplicate nixosConfigurations while preserving the top-level 'profile'
|
mkHost =
|
||||||
mkNixosConfig =
|
hostName:
|
||||||
gpuProfile:
|
let
|
||||||
|
inherit (import ./hosts/${hostName}/variables.nix)
|
||||||
|
host
|
||||||
|
username
|
||||||
|
profile
|
||||||
|
system
|
||||||
|
;
|
||||||
|
in
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
@@ -53,18 +57,12 @@
|
|||||||
inherit system;
|
inherit system;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./profiles/${gpuProfile}
|
./profiles/${profile}
|
||||||
nix-flatpak.nixosModules.nix-flatpak
|
nix-flatpak.nixosModules.nix-flatpak
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = nixpkgs.lib.genAttrs hostDirs mkHost;
|
||||||
amd = mkNixosConfig "amd";
|
|
||||||
nvidia = mkNixosConfig "nvidia";
|
|
||||||
nvidia-laptop = mkNixosConfig "nvidia-laptop";
|
|
||||||
intel = mkNixosConfig "intel";
|
|
||||||
vm = mkNixosConfig "vm";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
{
|
{
|
||||||
|
# CPU Architecture
|
||||||
|
# Available options: "x86_64-linux", "aarch64-linux", etc.
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
# Host Configuration
|
||||||
|
host = "Garand-Desktop";
|
||||||
|
username = "garand_plg";
|
||||||
|
|
||||||
|
# GPU Profile
|
||||||
|
# Available options: "amd", "nvidia", "nvidia-laptop", "intel", "vm"
|
||||||
|
profile = "nvidia";
|
||||||
|
|
||||||
# Git Configuration ( For Pulling Software Repos )
|
# Git Configuration ( For Pulling Software Repos )
|
||||||
gitUsername = "GarandPLG";
|
gitUsername = "GarandPLG";
|
||||||
gitEmail = "garandplg@garandplg.com";
|
gitEmail = "garandplg@garandplg.com";
|
||||||
|
|
||||||
# Set Displau Manager
|
|
||||||
# `tui` for Text login
|
|
||||||
# `sddm` for graphical GUI (default)
|
|
||||||
# SDDM background is set with stylixImage
|
|
||||||
displayManager = "tui";
|
|
||||||
|
|
||||||
# Hyprland Settings
|
# Hyprland Settings
|
||||||
# Examples:
|
# Examples:
|
||||||
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
||||||
@@ -27,9 +33,6 @@
|
|||||||
# or as a flatpak
|
# or as a flatpak
|
||||||
browser = "librewolf";
|
browser = "librewolf";
|
||||||
|
|
||||||
# Available Options:
|
|
||||||
# Kitty, ghostty, wezterm, aalacrity
|
|
||||||
# Note: kitty, wezterm, alacritty have to be enabled in `variables.nix`
|
|
||||||
# Setting it here does not enable it. Kitty is installed by default
|
# Setting it here does not enable it. Kitty is installed by default
|
||||||
terminal = "kitty"; # Set Default System Terminal
|
terminal = "kitty"; # Set Default System Terminal
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
{
|
{
|
||||||
# Git Configuration ( For Pulling Software Repos )
|
# CPU Architecture
|
||||||
gitUsername = "Tyler Kelley";
|
# Available options: "x86_64-linux", "aarch64-linux", etc.
|
||||||
gitEmail = "tylerzanekelley@gmail.com";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
# Set Displau Manager
|
# Host Configuration
|
||||||
# `tui` for Text login
|
host = "My-Desktop";
|
||||||
# `sddm` for graphical GUI (default)
|
username = "my_username";
|
||||||
# SDDM background is set with stylixImage
|
|
||||||
displayManager = "sddm";
|
# GPU Profile
|
||||||
|
# Available options: "amd", "nvidia", "nvidia-laptop", "intel", "vm"
|
||||||
|
profile = "nvidia";
|
||||||
|
|
||||||
|
# Git Configuration ( For Pulling Software Repos )
|
||||||
|
gitUsername = "GarandPLG";
|
||||||
|
gitEmail = "my@email.com";
|
||||||
|
|
||||||
# Hyprland Settings
|
# Hyprland Settings
|
||||||
# Examples:
|
# Examples:
|
||||||
@@ -20,23 +26,20 @@
|
|||||||
";
|
";
|
||||||
|
|
||||||
# Waybar Settings
|
# Waybar Settings
|
||||||
clock24h = false;
|
clock24h = true;
|
||||||
|
|
||||||
# Program Options
|
# Program Options
|
||||||
# Set Default Browser (google-chrome-stable for google-chrome)
|
# Set Default Browser (google-chrome-stable for google-chrome)
|
||||||
# This does NOT install your browser
|
# This does NOT install your browser
|
||||||
# You need to install it by adding it to the `packages.nix`
|
# You need to install it by adding it to the `packages.nix`
|
||||||
# or as a flatpak
|
# or as a flatpak
|
||||||
browser = "brave";
|
browser = "librewolf";
|
||||||
|
|
||||||
# Available Options:
|
|
||||||
# Kitty, ghostty, wezterm, aalacrity
|
|
||||||
# Note: kitty, wezterm, alacritty have to be enabled in `variables.nix`
|
|
||||||
# Setting it here does not enable it. Kitty is installed by default
|
# Setting it here does not enable it. Kitty is installed by default
|
||||||
terminal = "kitty"; # Set Default System Terminal
|
terminal = "kitty"; # Set Default System Terminal
|
||||||
|
|
||||||
keyboardLayout = "us";
|
keyboardLayout = "pl";
|
||||||
consoleKeyMap = "us";
|
consoleKeyMap = "pl";
|
||||||
|
|
||||||
# For Nvidia Prime support
|
# For Nvidia Prime support
|
||||||
intelID = "PCI:1:0:0";
|
intelID = "PCI:1:0:0";
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{ profile, ... }:
|
{ host, ... }:
|
||||||
{
|
{
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
# NixOS aliases
|
# NixOS aliases
|
||||||
upd = "nh os switch --hostname ${profile}";
|
upd = "nh os switch --hostname ${host}";
|
||||||
upg = "nh os switch --hostname ${profile} --update";
|
upg = "nh os switch --hostname ${host} --update";
|
||||||
upd-bt = "nh os boot --hostname ${profile}";
|
upd-bt = "nh os boot --hostname ${host}";
|
||||||
upd-ts = "nh os test --hostname ${profile}";
|
upd-ts = "nh os test --hostname ${host}";
|
||||||
upd-bd = "nh os build --hostname ${profile}";
|
upd-bd = "nh os build --hostname ${host}";
|
||||||
ncg = "nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
|
ncg = "nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
|
||||||
|
|
||||||
# Development aliases
|
# Development aliases
|
||||||
|
|||||||
@@ -1,140 +1,3 @@
|
|||||||
# {
|
|
||||||
# programs.fastfetch = {
|
|
||||||
# enable = true;
|
|
||||||
|
|
||||||
# settings = {
|
|
||||||
# display = {
|
|
||||||
# color = {
|
|
||||||
# keys = "35";
|
|
||||||
# output = "95";
|
|
||||||
# };
|
|
||||||
# separator = " ➜ ";
|
|
||||||
# };
|
|
||||||
|
|
||||||
# logo = {
|
|
||||||
# source = ./garandos.png;
|
|
||||||
# type = "kitty-direct";
|
|
||||||
# height = 10;
|
|
||||||
# width = 20;
|
|
||||||
# padding = {
|
|
||||||
# top = 2;
|
|
||||||
# left = 2;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
|
|
||||||
# modules = [
|
|
||||||
# "break"
|
|
||||||
# {
|
|
||||||
# type = "os";
|
|
||||||
# key = "OS";
|
|
||||||
# keyColor = "31";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "command";
|
|
||||||
# key = " ├ GarandOS ";
|
|
||||||
# keyColor = "31";
|
|
||||||
# text = "echo v$" + "{GARANDOS_VERSION}";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "kernel";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "31";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "packages";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "31";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "shell";
|
|
||||||
# key = " └ ";
|
|
||||||
# keyColor = "31";
|
|
||||||
# }
|
|
||||||
# "break"
|
|
||||||
# {
|
|
||||||
# type = "wm";
|
|
||||||
# key = "WM ";
|
|
||||||
# keyColor = "32";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "wmtheme";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "32";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "icons";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "32";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "cursor";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "32";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "terminal";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "32";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "terminalfont";
|
|
||||||
# key = " └ ";
|
|
||||||
# keyColor = "32";
|
|
||||||
# }
|
|
||||||
# "break"
|
|
||||||
# {
|
|
||||||
# type = "host";
|
|
||||||
# format = "{5} {1} Type {2}";
|
|
||||||
# key = "PC ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "cpu";
|
|
||||||
# format = "{1} ({3}) @ {7} GHz";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "gpu";
|
|
||||||
# format = "{1} {2} @ {12} GHz";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "memory";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "disk";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "monitor";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "player";
|
|
||||||
# key = " ├ ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# {
|
|
||||||
# type = "media";
|
|
||||||
# key = " └ ";
|
|
||||||
# keyColor = "33";
|
|
||||||
# }
|
|
||||||
# "break"
|
|
||||||
# {
|
|
||||||
# type = "uptime";
|
|
||||||
# key = " Uptime ";
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
# }
|
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.fastfetch = {
|
programs.fastfetch = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user