From 658274939a83bb49bcd60b93d0a00163e6353e14 Mon Sep 17 00:00:00 2001 From: rocketcamel Date: Wed, 22 Jan 2025 00:55:50 +0000 Subject: [PATCH] feat: add tux --- nix/flake.nix | 14 ++++-- nix/hosts/tux/configuration.nix | 81 +++++++++++---------------------- nix/modules/default.nix | 4 +- nix/modules/hm.nix | 1 - nix/modules/i3.nix | 17 +++++-- nix/users/luca/home.nix | 2 - 6 files changed, 52 insertions(+), 67 deletions(-) diff --git a/nix/flake.nix b/nix/flake.nix index edb526c..7815b26 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -11,10 +11,16 @@ outputs = inputs@{ nixpkgs, home-manager, nixos-wsl, ... }: let systems = [ "x86_64-linux" ]; - hosts = [{ - name = "wsl-kumatani"; - isWSL = true; - }]; + hosts = [ + { + name = "wsl-kumatani"; + isWSL = true; + } + { + name = "tux"; + isWSL = false; + } + ]; in { nixosConfigurations = builtins.listToAttrs (map (host: { name = host.name; diff --git a/nix/hosts/tux/configuration.nix b/nix/hosts/tux/configuration.nix index 7eb91a8..0f2b1ef 100644 --- a/nix/hosts/tux/configuration.nix +++ b/nix/hosts/tux/configuration.nix @@ -2,13 +2,13 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, inputs, home-manager, ... }: +{ config, lib, pkgs, inputs, home-manager, meta, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../modules/default.nix + ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -19,28 +19,15 @@ networking.networkmanager.enable = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - networking.hostName = "tux"; # Define your hostname. - -# services.xserver = { -# enable = true; -# windowManager.i3.enable = true; -# }; -# -# services.displayManager = { -# defaultSession = "none+i3"; -# }; - - - #programs.hyprland = { - # enable = true; - # xwayland.enable = true; - #}; + networking.hostName = meta.hostname; # Define your hostname. security.sudo = { enable = true; wheelNeedsPassword = false; }; + hm.enable = true; + i3.enable = true; #programs.hyprland.package = inputs.hyprland.packages."${pkgs.system}".hyprland; programs.firefox.enable = true; @@ -54,11 +41,7 @@ xdg.portal = { enable = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - config.common = { - default = [ - "gtk" - ]; - }; + config.common = { default = [ "gtk" ]; }; }; # Pick only one of the below networking options. @@ -83,9 +66,6 @@ # Enable the X11 windowing system. # services.xserver.enable = true; - - - # Configure keymap in X11 # services.xserver.xkb.layout = "us"; # services.xserver.xkb.options = "eurosign:e,caps:escape"; @@ -100,47 +80,38 @@ enable = true; pulse.enable = true; }; - - hardware = { - graphics.enable = true; - }; + + hardware = { graphics.enable = true; }; # Enable touchpad support (enabled default in most desktopManager). # services.libinput.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.luca = import ./home/home.nix; users.users.luca = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - vesktop - nodejs_22 - pnpm - ]; + packages = with pkgs; [ vesktop nodejs_22 pnpm ]; shell = pkgs.zsh; - hashedPassword = "$y$j9T$wp9I05TfxjrAzCMCcxlei1$Fm7sJJSwFHpSIQT0RESOdJ7vkTYyN0IXs5n/xkg65y3"; + hashedPassword = + "$y$j9T$wp9I05TfxjrAzCMCcxlei1$Fm7sJJSwFHpSIQT0RESOdJ7vkTYyN0IXs5n/xkg65y3"; }; - programs.zsh.enable = true; # programs.firefox.enable = true; # List packages installed in system profile. To search, run: # $ nix search wget - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - curl - ripgrep - git - neovim - busybox - dolphin - wireguard-tools - gh - ]; + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + curl + ripgrep + git + neovim + busybox + dolphin + wireguard-tools + gh + ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 9ea2a10..2698517 100644 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -1,2 +1,4 @@ -{ pkgs, lib, config, ... }: { imports = [ ./commonPackages.nix ./hm.nix ]; } +{ pkgs, lib, config, ... }: { + imports = [ ./commonPackages.nix ./hm.nix ./i3.nix ]; +} diff --git a/nix/modules/hm.nix b/nix/modules/hm.nix index 0f47d39..af39586 100644 --- a/nix/modules/hm.nix +++ b/nix/modules/hm.nix @@ -5,7 +5,6 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.luca = import ../users/luca/home.nix; - users.users.luca.shell = pkgs.zsh; programs.zsh.enable = true; }; } diff --git a/nix/modules/i3.nix b/nix/modules/i3.nix index 0eb093e..dba3cf3 100644 --- a/nix/modules/i3.nix +++ b/nix/modules/i3.nix @@ -16,11 +16,20 @@ settings.window.opacity = 0.6; }; }; - }; - services.picom = { - enable = true; - vSync = true; + services.picom = { + enable = true; + vSync = true; + }; + + xsession.windowManager.i3 = { + enable = true; + config = { + modifier = "Mod4"; + defaultWorkspace = "workspace number 1"; + terminal = "alacritty"; + }; + }; }; }; } diff --git a/nix/users/luca/home.nix b/nix/users/luca/home.nix index cd3b342..6f6890b 100755 --- a/nix/users/luca/home.nix +++ b/nix/users/luca/home.nix @@ -11,8 +11,6 @@ helix = import ./helix.nix { inherit pkgs; }; }; - config.i3.enable ? - home.packages = with pkgs; [ nodePackages_latest.typescript-language-server nodejs_22