Use Nixos modules for home manager configurations
All checks were successful
/ build-all (push) Successful in 54s

This commit is contained in:
ant 2026-03-12 23:32:44 +01:00
parent 632061ac61
commit 85e75928dc
10 changed files with 65 additions and 91 deletions

View file

@ -21,7 +21,6 @@
let
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
pkgs-unstable = inputs.unstable.legacyPackages.${system};
nixgl = inputs.nixgl.packages.${system};
sshKeys = (import ./sshKeys.nix);
osConfig = modules: nixpkgs.lib.nixosSystem {
@ -35,12 +34,25 @@
inherit pkgs;
extraSpecialArgs = {
inherit pkgs-unstable;
inherit inputs;
};
inherit modules;
};
homeConfigInOs = {username, modules, userOptions ? []}: {
imports = [ inputs.home-manager.nixosModules.home-manager ];
users.users.${username} = { isNormalUser = true; } // userOptions;
home-manager = {
extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users.${username} = {
imports = modules ++ [
{ home.username = username; }
];
};
};
};
in
rec {
homeConfigurations."anvaure@Allegro23-12" = homeConfig [
@ -62,35 +74,6 @@
];
homeConfigurations."anvaure@msm-lnx-demo-01" = homeConfigurations."anvaure@msm-lnx-ipva-01";
homeConfigurations."ant@hs" = homeConfig [
{ home.username = "ant"; }
./home/more-software.nix
];
homeConfigurations."ant@ks" = homeConfig [
{ home.username = "ant"; }
./home/more-software.nix
];
homeConfigurations."ant@basado" = homeConfig [
{ home.username = "ant"; }
./home/ui.nix
./home/more-software.nix
./home/gaming.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/basado.nix
];
homeConfigurations."ant@moon" = homeConfig [
{ home.username = "ant"; }
./home/more-software.nix
./home/ui.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/moon.nix
];
nixosConfigurations.basado = osConfig [
./os/basado/configuration.nix
./os/basado/hardware-configuration.nix
@ -102,14 +85,40 @@
./os/kdeconnect-ports.nix
(import ./os/swapfile.nix 64)
./os/ccache.nix
(homeConfigInOs {
username = "ant";
modules = [
./home/ui.nix
./home/more-software.nix
./home/gaming.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/basado.nix
];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "video" "libvirtd" "msr" "docker" "gamemode" ];
};
})
];
nixosConfigurations.moon = osConfig [
./os/moon/configuration.nix
./os/moon/hardware-configuration.nix
./os/common.nix
./os/common-graphics.nix
./os/kdeconnect-ports.nix
(homeConfigInOs {
username = "ant";
modules = [
./home/more-software.nix
./home/ui.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/moon.nix
];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "video" ];
};
} )
];
nixosConfigurations.hs = osConfig [
./os/hs/configuration.nix
@ -124,12 +133,28 @@
./os/builder.nix
./os/ccache.nix
(import ./os/swapfile.nix 64)
(homeConfigInOs {
username = "ant";
modules = [ ./home/more-software.nix ];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "jellyfin" ];
openssh.authorizedKeys.keys = (with sshKeys; [ basado moon allegro hs ]);
};
})
];
nixosConfigurations.ks = osConfig [
./os/ks/configuration.nix
./os/ks/hardware-configuration.nix
./os/common.nix
./os/3proxy.nix
(homeConfigInOs {
username = "ant";
modules = [ ./home/more-software.nix ];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "jellyfin" ];
openssh.authorizedKeys.keys = with sshKeys; [ basado hs moon ];
};
})
];
build-all = pkgs.runCommand "build-all" {
@ -142,10 +167,6 @@
(osDerivation "hs")
(osDerivation "ks")
(homeDerivation "anvaure@Allegro23-12")
(homeDerivation "ant@hs")
(homeDerivation "ant@ks")
(homeDerivation "ant@basado")
(homeDerivation "ant@moon")
];
} ''
echo Build all derivations

View file

@ -1,4 +1,8 @@
{ config, lib, pkgs, ... }: {
nix.package = pkgs.nixVersions.latest;
home.homeDirectory = "/home/${config.home.username}";
nixpkgs.config = { allowUnfree = true; };
programs.fish = {
loginShellInit = ''
source ${pkgs.nix}/etc/profile.d/nix.fish

View file

@ -1,13 +1,10 @@
{ inputs, config, lib, pkgs, pkgs-unstable, ... }:
{ system, inputs, config, lib, pkgs, ... }:
{
imports = [
./fish.nix
];
nix.package = pkgs.nixVersions.latest;
home.homeDirectory = "/home/${config.home.username}";
home.stateVersion = "23.05"; # Please read the comment before changing.
home.packages = with pkgs; [
@ -92,7 +89,7 @@
enable = true;
viAlias = true;
defaultEditor = true;
package = pkgs-unstable.neovim-unwrapped;
package = inputs.unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system}.neovim-unwrapped;
extraPackages = with pkgs; [
gcc
];

View file

@ -1,5 +1,4 @@
{ lib, config, pkgs, ... }: {
nixpkgs.config = { allowUnfree = true; };
home.packages = with pkgs; [
lutris

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, pkgs-unstable, ... }:
{ lib, config, pkgs, ... }:
{
imports = [
./base.nix

View file

@ -21,7 +21,7 @@ in
config = {
home.packages = with pkgs; [
inputs.st-flexipatch.packages.${system}.st
inputs.st-flexipatch.packages.${pkgs.stdenv.hostPlatform.system}.st
gentium
nerd-fonts.noto
@ -54,11 +54,6 @@ in
})
];
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"joypixels"
];
nixpkgs.config.joypixels.acceptLicense = true;
home.file = {
".config/kitty/light.conf".source = dotfiles/kitty/light.conf;

View file

@ -20,15 +20,6 @@
boot.supportedFilesystems = [ "ntfs" ];
networking.hostName = "basado"; # Define your hostname.
users.users.ant = {
isNormalUser = true;
shell = pkgs.fish;
description = "ant";
extraGroups =
[ "networkmanager" "wheel" "video" "libvirtd" "msr" "docker" "gamemode" ];
packages = with pkgs; [ ];
};
users.users.anvaure = {
isNormalUser = true;
shell = pkgs.fish;

View file

@ -23,16 +23,6 @@ in {
networking.hostName = "hs"; # Define your hostname.
networking.domain = domain;
users.users.ant = {
isNormalUser = true;
description = "ant";
extraGroups = [
"networkmanager"
"wheel"
"jellyfin"
];
openssh.authorizedKeys.keys = (with sshKeys; [ basado moon allegro hs ]);
};
security.sudo.wheelNeedsPassword = false;
nixpkgs.config.allowUnfree = true;

View file

@ -23,20 +23,6 @@ in {
users.users.root.openssh.authorizedKeys.keys = [ sshKeys.hs ];
users.users.ant = {
isNormalUser = true;
description = "ant";
extraGroups = [
"networkmanager"
"wheel"
"jellyfin"
];
openssh.authorizedKeys.keys = with sshKeys; [
basado
hs
moon
];
};
security.sudo.wheelNeedsPassword = false;
services.fail2ban = {

View file

@ -18,15 +18,6 @@
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.ant = {
isNormalUser = true;
shell = pkgs.fish;
description = "ant";
extraGroups = [ "networkmanager" "wheel" "video" ];
packages = with pkgs; [ ];
};
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;