diff --git a/flake.nix b/flake.nix index d824430..1e05990 100644 --- a/flake.nix +++ b/flake.nix @@ -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 diff --git a/home/allegro.nix b/home/allegro.nix index 594ddcc..edbb669 100644 --- a/home/allegro.nix +++ b/home/allegro.nix @@ -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 diff --git a/home/base.nix b/home/base.nix index ca3fca2..7da0812 100644 --- a/home/base.nix +++ b/home/base.nix @@ -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 ]; diff --git a/home/gaming.nix b/home/gaming.nix index 965e954..8888826 100644 --- a/home/gaming.nix +++ b/home/gaming.nix @@ -1,5 +1,4 @@ { lib, config, pkgs, ... }: { -nixpkgs.config = { allowUnfree = true; }; home.packages = with pkgs; [ lutris diff --git a/home/gui-software.nix b/home/gui-software.nix index 022aa15..058ecc7 100644 --- a/home/gui-software.nix +++ b/home/gui-software.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, pkgs-unstable, ... }: +{ lib, config, pkgs, ... }: { imports = [ ./base.nix diff --git a/home/ui.nix b/home/ui.nix index da8dcb4..a665ee4 100644 --- a/home/ui.nix +++ b/home/ui.nix @@ -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; diff --git a/os/basado/configuration.nix b/os/basado/configuration.nix index c26ecd9..8a46c49 100644 --- a/os/basado/configuration.nix +++ b/os/basado/configuration.nix @@ -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; diff --git a/os/hs/configuration.nix b/os/hs/configuration.nix index dc5bac3..5d8ebf2 100644 --- a/os/hs/configuration.nix +++ b/os/hs/configuration.nix @@ -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; diff --git a/os/ks/configuration.nix b/os/ks/configuration.nix index 506f0b0..a1f127a 100644 --- a/os/ks/configuration.nix +++ b/os/ks/configuration.nix @@ -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 = { diff --git a/os/moon/configuration.nix b/os/moon/configuration.nix index f347075..c604165 100644 --- a/os/moon/configuration.nix +++ b/os/moon/configuration.nix @@ -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;