From aaf4ff29c4fb8aa017f938659d3f92abb480485d Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Sat, 9 Aug 2025 17:19:12 +0200 Subject: [PATCH] snowfall migration wip fixed user config --- homes/x86_64-linux/kylekrein/default.nix | 24 ++-- homes/x86_64-linux/kylekrein/kitty.nix | 7 +- lib/users/default.nix | 4 +- .../nixos/hardware/framework12/default.nix | 1 + modules/nixos/users/kylekrein/default.nix | 2 +- modules/nixos/users/tania/default.nix | 2 +- .../x86_64-linux/kylekrein-homepc/default.nix | 124 +++++++++--------- templates/user/default.nix | 2 +- 8 files changed, 87 insertions(+), 79 deletions(-) diff --git a/homes/x86_64-linux/kylekrein/default.nix b/homes/x86_64-linux/kylekrein/default.nix index 4031af9..40b4906 100644 --- a/homes/x86_64-linux/kylekrein/default.nix +++ b/homes/x86_64-linux/kylekrein/default.nix @@ -23,20 +23,22 @@ in }; }; home = { - packages = with pkgs; [ - gdb - element-desktop - obs-studio - neovim - localsend - kdePackages.kdenlive - ] ++ lib.optionals osConfig.custom.presets.gaming.enable [mcpelauncher-ui-qt]; + packages = with pkgs; + [ + gdb + element-desktop + obs-studio + neovim + localsend + kdePackages.kdenlive + ] + ++ lib.optionals osConfig.custom.presets.gaming.enable [mcpelauncher-ui-qt]; sessionVariables = { EDITOR = "emacsclient -c"; - NH_OS_FLAKE = "${home}/nixos-config"; - NH_HOME_FLAKE = "${home}/nixos-config"; - NH_DARWIN_FLAKE = "${home}/nixos-config"; + NH_OS_FLAKE = "${home}/nixos-config"; + NH_HOME_FLAKE = "${home}/nixos-config"; + NH_DARWIN_FLAKE = "${home}/nixos-config"; }; stateVersion = "25.05"; diff --git a/homes/x86_64-linux/kylekrein/kitty.nix b/homes/x86_64-linux/kylekrein/kitty.nix index eba071a..4c2de42 100644 --- a/homes/x86_64-linux/kylekrein/kitty.nix +++ b/homes/x86_64-linux/kylekrein/kitty.nix @@ -1,5 +1,8 @@ -{osConfig, pkgs, ...}: { + osConfig, + pkgs, + ... +}: { home.packages = with pkgs; [kitty-themes]; programs.fzf = { enable = true; @@ -10,7 +13,7 @@ enable = true; icons = "always"; }; -programs.kitty = { + programs.kitty = { enable = osConfig.custom.presets.workstation.enable; font = { name = "JetBrainsMono Nerd Font"; diff --git a/lib/users/default.nix b/lib/users/default.nix index 706afe2..96a5251 100644 --- a/lib/users/default.nix +++ b/lib/users/default.nix @@ -5,8 +5,6 @@ ... }: with lib; rec { - mkHomeManagerConfigOpt = config: lib.${namespace}.mkOpt' types.anything {}; - mkUser = { config, enable, @@ -25,7 +23,7 @@ with lib; rec { home = { enable = enable; - #config = homeConfig; + config = homeConfig; }; }; users.users.${username} = mkIf enable { diff --git a/modules/nixos/hardware/framework12/default.nix b/modules/nixos/hardware/framework12/default.nix index e1234bf..ef576b8 100644 --- a/modules/nixos/hardware/framework12/default.nix +++ b/modules/nixos/hardware/framework12/default.nix @@ -17,6 +17,7 @@ with lib.${namespace}; let in { options.${namespace}.hardware.framework12 = with types; { enable = mkBoolOpt false "Enable hardware support for framework 12. P.s. you still need to import inputs.nixos-hardware.nixosModules.framework-12-13th-gen-intel yourself"; + imports = [inputs.nixos-hardware.nixosModules.framework-12-13th-gen-intel]; }; config = mkIf cfg.enable { # Ensure that the `pinctrl_tigerlake` kernel module is loaded before `soc_button_array`. diff --git a/modules/nixos/users/kylekrein/default.nix b/modules/nixos/users/kylekrein/default.nix index 4dd4a25..5a2694b 100644 --- a/modules/nixos/users/kylekrein/default.nix +++ b/modules/nixos/users/kylekrein/default.nix @@ -26,7 +26,7 @@ with lib.${namespace}; let in { options.${namespace}.users.${username} = with types; { enable = mkBoolOpt false "Enable ${username} user"; - config = mkHomeManagerConfigOpt config; + config = mkOpt types.attrs {} "Additional home manager config for ${username}"; }; config = mkUser { diff --git a/modules/nixos/users/tania/default.nix b/modules/nixos/users/tania/default.nix index f1faa0a..425b9f6 100644 --- a/modules/nixos/users/tania/default.nix +++ b/modules/nixos/users/tania/default.nix @@ -22,7 +22,7 @@ with lib.${namespace}; let in { options.${namespace}.users.${username} = with types; { enable = mkBoolOpt false "Enable ${username} user"; - config = mkHomeManagerConfigOpt config; + config = mkOpt types.attrs {} "Additional home manager config for ${username}"; }; config = mkUser { diff --git a/systems/x86_64-linux/kylekrein-homepc/default.nix b/systems/x86_64-linux/kylekrein-homepc/default.nix index 479479b..abb3f07 100644 --- a/systems/x86_64-linux/kylekrein-homepc/default.nix +++ b/systems/x86_64-linux/kylekrein-homepc/default.nix @@ -10,69 +10,73 @@ systems, config, ... -}: -with lib; -with lib.${namespace}; { - facter.reportPath = ./facter.json; - systemd.network.wait-online.enable = lib.mkForce false; #facter - - custom.hardware.nvidia = enabled; - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos; - services.scx.enable = true; # by default uses scx_rustland scheduler - custom.impermanence = enabled; - custom.presets.workstation = enabled; - custom.presets.gaming = enabled; - custom.presets.disko.impermanenceBtrfs = { - enable = true; - device = "/dev/nvme0n1"; - swapSize = 32; - }; - custom.windowManagers.niri = enabled; - custom.loginManagers.sddm = enabled; - custom.services.ai = { - enable = true; - models = ["qwq" "llama3.1" "qwen2.5-coder:7b" "gpt-oss:20b" "gpt-oss:120b"]; - }; - - custom.users = { - tania = enabled; - kylekrein = { - enable = true; +}: let + niri-outputs = { + programs.niri.settings.outputs = { + "DP-1" = { + scale = 1.6; + position.x = 1600; + position.y = 0; + }; + "DP-3" = { + scale = 1.6; + position.x = 0; + position.y = 0; + }; }; }; - snowfallorg.users.kylekrein.home.config = { - programs.niri.settings.outputs = { - "DP-1" = { - scale = 1.6; - position.x = 1600; - position.y = 0; - }; - "DP-3" = { - scale = 1.6; - position.x = 0; - position.y = 0; - }; - }; +in + with lib; + with lib.${namespace}; { + facter.reportPath = ./facter.json; + systemd.network.wait-online.enable = lib.mkForce false; #facter + + custom.hardware.nvidia = enabled; + boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos; + services.scx.enable = true; # by default uses scx_rustland scheduler + custom.impermanence = enabled; + custom.presets.workstation = enabled; + custom.presets.gaming = enabled; + custom.presets.disko.impermanenceBtrfs = { + enable = true; + device = "/dev/nvme0n1"; + swapSize = 32; + }; + custom.windowManagers.niri = enabled; + custom.loginManagers.sddm = enabled; + custom.services.ai = { + enable = true; + models = ["qwq" "llama3.1" "qwen2.5-coder:7b" "gpt-oss:20b" "gpt-oss:120b"]; + }; + + custom.users = { + kylekrein = { + enable = true; + config = niri-outputs; }; + tania = { + inherit (config.custom.users.kylekrein) enable config; + }; + }; - environment.systemPackages = with pkgs; [ - blender - nix-schemas - ]; - - services.zerotierone = { - enable = true; - port = 9994; - joinNetworks = [ - "A84AC5C10AD269CA" - "db64858fed285e0f" + environment.systemPackages = with pkgs; [ + blender + nix-schemas ]; - }; - #Chat host - networking.firewall.allowedTCPPorts = [80 443 22 8448 9993 8081] ++ [config.services.zerotierone.port]; - networking.firewall.allowedUDPPorts = [config.services.zerotierone.port]; - # ======================== DO NOT CHANGE THIS ======================== - system.stateVersion = "25.05"; - # ======================== DO NOT CHANGE THIS ======================== -} + services.zerotierone = { + enable = true; + port = 9994; + joinNetworks = [ + "A84AC5C10AD269CA" + "db64858fed285e0f" + ]; + }; + #Chat host + networking.firewall.allowedTCPPorts = [80 443 22 8448 9993 8081] ++ [config.services.zerotierone.port]; + networking.firewall.allowedUDPPorts = [config.services.zerotierone.port]; + + # ======================== DO NOT CHANGE THIS ======================== + system.stateVersion = "25.05"; + # ======================== DO NOT CHANGE THIS ======================== + } diff --git a/templates/user/default.nix b/templates/user/default.nix index 93ef90b..c5eea41 100644 --- a/templates/user/default.nix +++ b/templates/user/default.nix @@ -22,7 +22,7 @@ with lib.${namespace}; let in { options.${namespace}.users.${username} = with types; { enable = mkBoolOpt false "Enable ${username} user"; - config = mkHomeManagerConfigOpt config; + config = mkOpt types.attrs {} "Additional home manager config for ${username}"; }; config = mkUser {