move host names to flakes

This commit is contained in:
2026-02-27 21:14:37 +01:00
parent cbc68e2b5a
commit 997e669803
2 changed files with 48 additions and 23 deletions

View File

@@ -32,7 +32,7 @@
}@inputs:
let
userConfig = {
baseUserConfig = {
username = "szymon";
# for git
email = "szymon_jozef@proton.me";
@@ -40,7 +40,7 @@
# your public ssh key
signingKey = "~/.ssh/github.pub";
mainMonitor = "eDP-1"; # only for some applications: you still need to set hyprland monitors yourself!
mainMonitor = "DP-1"; # only for some applications: you still need to set hyprland monitors yourself!
statusBar = "ashell"; # available: ashell|waybar
pathConfig = {
@@ -51,45 +51,70 @@
};
system = "x86_64-linux";
general_import = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
general_special_args = {
inherit
inputs
userConfig
;
};
general_module_import = [
./home.nix
catppuccin.homeModules.catppuccin
nixvim.homeModules.nixvim
];
in
{
homeConfigurations = {
"arch" = home-manager.lib.homeManagerConfiguration {
mkHomeConfig =
{
isNixOS,
overrides ? { },
hostName,
}:
home-manager.lib.homeManagerConfiguration {
pkgs = general_import;
extraSpecialArgs = general_special_args // {
isNixOS = false;
extraSpecialArgs = {
inherit inputs isNixOS hostName;
userConfig = baseUserConfig // overrides;
};
modules = general_module_import;
};
"nixos" = home-manager.lib.homeManagerConfiguration {
pkgs = general_import;
in
{
homeConfigurations = {
"arch" = mkHomeConfig {
isNixOS = false;
hostName = "arch";
};
extraSpecialArgs = general_special_args // {
isNixOS = true;
"nixos" = mkHomeConfig {
isNixOS = true;
hostName = "nixos";
};
"pitagoras" = mkHomeConfig {
isNixOS = true;
overrides = {
mainMonitor = "eDP-1";
};
hostName = "pitagoras";
};
modules = general_module_import;
"pilecki" = mkHomeConfig {
isNixOS = true;
overrides = {
mainMonitor = "LVDS-1";
};
hostName = "pilecki";
};
"paderewski" = mkHomeConfig {
isNixOS = false;
overrides = {
mainMonitor = "DP-1";
};
hostName = "paderewski";
};
};
};

View File

@@ -1,4 +1,4 @@
{ isNixOS, ... }:
{ isNixOS, hostName, ... }:
{
programs.fish = {
@@ -45,7 +45,7 @@
set -l rel_file (realpath --relative-to=$config_dir $file)
if nh home switch $config_dir -c ${if isNixOS then "nixos" else "arch"}
if nh home switch $config_dir -c ${hostName}
git add -A
set commit_msg "update: $rel_file"
git commit -m "$commit_msg"
@@ -61,7 +61,7 @@
reload_dotfiles = {
body = # fish
"nh home switch ~/.config/home-manager -c ${if isNixOS then "nixos" else "arch"}";
"nh home switch ~/.config/home-manager -c ${hostName}";
};
ls = {